UPSTREAM: arm64: entry: remove pointless SPSR mode check
authorMark Rutland <mark.rutland@arm.com>
Tue, 5 Jan 2016 17:33:34 +0000 (17:33 +0000)
committerJeff Vander Stoep <jeffv@google.com>
Sun, 18 Sep 2016 21:17:59 +0000 (14:17 -0700)
commitd686cf4829c01ca92e8b10603b9250221b3bdfcb
treedc0d09aca16649e839331841dabc7e572796c3c4
parent606d0cab2091ee86fa8dc7c77a53a9e59e9fac05
UPSTREAM: 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>
Bug: 30369029
Patchset: rework-pagetable

(cherry picked from commit ee03353bc04f8e460cc4e3da80d9721d9ecb89f1)
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Change-Id: I2738149342ef469e8cde7c5f8f7c65daab93fb2b
arch/arm64/kernel/entry.S