arm64: factor work_pending state machine to C
[cascardo/linux.git] / arch / arm64 / kernel / entry.S
index 441420c..6a64182 100644 (file)
@@ -707,18 +707,13 @@ ret_fast_syscall_trace:
  * Ok, we need to do extra processing, enter the slow path.
  */
 work_pending:
-       tbnz    x1, #TIF_NEED_RESCHED, work_resched
-       /* TIF_SIGPENDING, TIF_NOTIFY_RESUME or TIF_FOREIGN_FPSTATE case */
        mov     x0, sp                          // 'regs'
-       enable_irq                              // enable interrupts for do_notify_resume()
        bl      do_notify_resume
-       b       ret_to_user
-work_resched:
 #ifdef CONFIG_TRACE_IRQFLAGS
-       bl      trace_hardirqs_off              // the IRQs are off here, inform the tracing code
+       bl      trace_hardirqs_on               // enabled while in userspace
 #endif
-       bl      schedule
-
+       ldr     x1, [tsk, #TI_FLAGS]            // re-check for single-step
+       b       finish_ret_to_user
 /*
  * "slow" syscall return path.
  */
@@ -727,6 +722,7 @@ ret_to_user:
        ldr     x1, [tsk, #TI_FLAGS]
        and     x2, x1, #_TIF_WORK_MASK
        cbnz    x2, work_pending
+finish_ret_to_user:
        enable_step_tsk x1, x2
        kernel_exit 0
 ENDPROC(ret_to_user)