aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2016-01-05 12:33:34 -0500
committerWill Deacon <will.deacon@arm.com>2016-01-06 10:40:38 -0500
commitee03353bc04f8e460cc4e3da80d9721d9ecb89f1 (patch)
tree7079b34f326357afdc3aff8af868f327684ac31f
parent39b5be9b4233a9f212b98242bddf008f379b5122 (diff)
arm64: entry: remove pointless SPSR mode check
In work_pending, we may skip work if the stacked SPSR value represents anything other than an EL0 context. We then immediately invoke the kernel_exit 0 macro as part of ret_to_user, assuming a return to EL0. This is somewhat confusing. We use work_pending as part of the ret_to_user/ret_fast_syscall state machine. We only use ret_fast_syscall in the return from an SVC issued from EL0. We use ret_to_user for return from EL0 exception handlers and also for return from ret_from_fork in the case the task was not a kernel thread (i.e. it is a user task). Thus in all cases the stacked SPSR value must represent an EL0 context, and the check is redundant. This patch removes it, along with the now unused no_work_pending label. Cc: Chris Metcalf <cmetcalf@ezchip.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arch/arm64/kernel/entry.S4
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index c0db321db7e1..1f7f5a2b61bf 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -676,10 +676,7 @@ ret_fast_syscall_trace:
676work_pending: 676work_pending:
677 tbnz x1, #TIF_NEED_RESCHED, work_resched 677 tbnz x1, #TIF_NEED_RESCHED, work_resched
678 /* TIF_SIGPENDING, TIF_NOTIFY_RESUME or TIF_FOREIGN_FPSTATE case */ 678 /* TIF_SIGPENDING, TIF_NOTIFY_RESUME or TIF_FOREIGN_FPSTATE case */
679 ldr x2, [sp, #S_PSTATE]
680 mov x0, sp // 'regs' 679 mov x0, sp // 'regs'
681 tst x2, #PSR_MODE_MASK // user mode regs?
682 b.ne no_work_pending // returning to kernel
683 enable_irq // enable interrupts for do_notify_resume() 680 enable_irq // enable interrupts for do_notify_resume()
684 bl do_notify_resume 681 bl do_notify_resume
685 b ret_to_user 682 b ret_to_user
@@ -698,7 +695,6 @@ ret_to_user:
698 and x2, x1, #_TIF_WORK_MASK 695 and x2, x1, #_TIF_WORK_MASK
699 cbnz x2, work_pending 696 cbnz x2, work_pending
700 enable_step_tsk x1, x2 697 enable_step_tsk x1, x2
701no_work_pending:
702 kernel_exit 0 698 kernel_exit 0
703ENDPROC(ret_to_user) 699ENDPROC(ret_to_user)
704 700