Re: [RFC][PATCH 12/24] x86/cea: Map and use FRED exception shadow stacks

From: Dave Hansen

Date: Wed Oct 21 2026 - 19:00:05 EST


On 10/21/26 14:40, Peter Zijlstra wrote:
>> == Future Work ==
>>
>> The *_stack_guard[] elements could probably be removed now. When in
>> use, shadow stacks serve as guard pages for the regular stacks. When
>> not in use, the shadow stack region could remain unmapped and also act
>> as a guard area. But that would take some more fancy dynamic mapping
>> work. The existing CEA code is dirt simple and doing anything dynamic
>> would add complexity. KISS. The downside is wasting three pages per
>> CPU when shadow stacks support is compiled in but not used at runtime.
> People were trying to *shrink* stacks 😉

Heh. I'll leave this one as an exercise to the reader if folks really care.

They can either allocate the physical space in the percpu areas like it
is now and try to free it later. Or, they can treat the cea virtual
space like a hole that needs to have a mapping placed in it later.