Re: [PATCH v2 12/13] x86: Add support for dynamic kernel stacks via FRED

From: Thomas Gleixner

Date: Mon Jun 29 2026 - 04:42:29 EST


On Sun, Jun 28 2026 at 13:33, H. Peter Anvin wrote:
> On June 28, 2026 9:46:32 AM PDT, Thomas Gleixner <tglx@xxxxxxxxxx> wrote:
>>> That sort of fault would probably end up either with a
>>> page_fault_oops() or risk a context switch with SL>0, but we shouldn't
>>> make debugging harder with UB.
>>
>>Definitely not :)
>>
>>You can avoid quite some of the problems right in the ASM entry code.
>>Instead of checking event type/vector and then going to the stack switch
>>logic, you can check the stack level on which the event happened
>>first. If it's not 0, then there is nothing to do.
>>
>>
>
> To be fair, for this *specific* case, memmove() does exist for a reason :)

It does, but why bother doing actual work, if you know upfront that it's
not required :)