Re: Kernel Shadow Stacks Versus XFEATURE_MASK_GUEST_SUPERVISOR
From: Dave Hansen
Date: Tue Oct 27 2026 - 10:29:05 EST
On 10/27/26 07:18, Chao Gao wrote:
> We then switched to the guest-only approach to avoid allocating CET_KERNEL
> space in non-KVM fpstates. The optimization could still be applied on top
> of that, but it was dropped after its benefit was questioned off-list:
>
> """
> 1. It hacks in an optimization with conditionals around the edges,
> instead of integrating with the way the rest of the FPU works.
> 2. There is no proven benefit of this narrow optimization and x86
> maintainers are already skeptical.
> """
>
> This optimization can be added back if it benefits kernel shadow stacks.
> But os_xrstor_supervisor() and os_xrstor_safe() would need the same
> handling.
That makes it more functional and less of an optimization. But, no less
of a hack.