Re: [PATCH v2 06/21] arm64: Store 'current' in TPIDRRO_EL0 instead of SP_EL0

From: Linus Walleij

Date: Wed Sep 30 2026 - 18:15:26 EST


On Fri, Sep 18, 2026 at 6:14 PM Will Deacon <will@xxxxxxxxxx> wrote:

> To make SP_EL0 available to point at the per-cpu kernel overflow stack,
> we must relocate 'current' elsewhere. With TPIDRRO_EL0 now restored late
> in the return-to-user path, we can otherwise use it to hold 'current'
> and update the various accessors accordingly.
>
> Move 'current' from SP_EL0 to TPIDRRO_EL0.
>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Signed-off-by: Will Deacon <will@xxxxxxxxxx>

I just intuitively like this change, if for nothing else then for the
fact that SP_EL0 "stack pointer" was a bad register to use for
this and something named "thread/process ID register" (something)
is a more natural name for something that gets to contain
current.
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij