Re: [PATCH v2 02/21] arm64: entry: Only check for stack overflow on exceptions from EL1
From: Linus Walleij
Date: Wed Sep 30 2026 - 16:50:58 EST
On Fri, Sep 18, 2026 at 6:14 PM Will Deacon <will@xxxxxxxxxx> wrote:
> Checking for kernel stack overflow on entry from EL0 is largely
> pointless and gets in the way of using SPSel to switch to the overflow
> stack. If the kernel stack overflows on entry from userspace, that
> implies that it was unbalanced on the last exception return which means
> we can't sensibly reason about the state of the system given that we
> could've returned to an arbitrary virtual address in an arbitrary mode.
>
> Remove the stack overflow check from the EL0 exception entry path.
>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Signed-off-by: Will Deacon <will@xxxxxxxxxx>
I agree with this reasoning, and it confirms my own understanding
of the futility of checking this at entry from EL0.
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>
Yours,
Linus Walleij