[PATCH] arm64: scs: Remove redundant save/restore of SCS SP on entry to/from EL0
Ard Biesheuvel
ardb at kernel.org
Fri Mar 13 06:26:16 PDT 2026
On Fri, 13 Mar 2026, at 13:32, Will Deacon wrote:
> When returning to userspace, the SCS is empty and so the SCS SP just
> points to the base address of the SCS page.
>
> Rather than saving and restoring this address in the current task, we
> can simply restore the SCS SP to point at the base of the stack on entry
> to EL1 from EL0.
>
> Cc: Ard Biesheuvel <ardb at kernel.org>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Cc: Sami Tolvanen <samitolvanen at google.com>
> Signed-off-by: Will Deacon <will at kernel.org>
> ---
> arch/arm64/include/asm/scs.h | 8 ++++++++
> arch/arm64/kernel/entry.S | 4 +---
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
Acked-by: Ard Biesheuvel <ardb at kernel.org>
More information about the linux-arm-kernel
mailing list