Re: [PATCH v2 12/13] x86: Add support for dynamic kernel stacks via FRED
From: H. Peter Anvin
Date: Mon Jun 29 2026 - 11:14:53 EST
On June 29, 2026 1:41:13 AM PDT, Thomas Gleixner <tglx@xxxxxxxxxx> wrote:
>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 :)
Of course.
Then there is the very open question if this thing has legs at all. I'm still interested in using SL1 for the interrupt stack as I think that could be a performance boost.