Re: [PATCH v2 17/21] arm64: entry: Use SPSel to switch to overflow stack

From: Linus Walleij

Date: Wed Sep 30 2026 - 17:24:11 EST


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

> When detecting a stack overflow on exception entry from EL1, use SPSel
> to switch to the overflow stack without corrupting any GPRs. Not only is
> this simpler than the previous logic, but it also opens the door to
> more complicated overflow checks (for example, based on per-task stack
> sizes or stacks which are not aligned to a specific page order) as well
> as the possibility of returning from a stack fault if we were able to
> resolve it.
>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Signed-off-by: Will Deacon <will@xxxxxxxxxx>

I really like what I see here. The change up to this point
stands alone as a serious stability improvement because you are
not deleting code that made me feel very icky when I was reading
it. Before this patch it was pretty much an
"overflow and crash gracefully" stack, not an overflow stack.
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij