Re: [PATCH v2] x86/fpu: Disable shstk if no CET_USER state
From: Dave Hansen
Date: Thu Apr 09 2026 - 16:30:54 EST
On 4/8/26 07:30, David Kaplan wrote:
> + if (boot_cpu_has(X86_FEATURE_USER_SHSTK) &&
> + !(fpu_kernel_cfg.max_features & XFEATURE_MASK_CET_USER)) {
> + /*
> + * The kernel relies on XSAVES/XRSTORS to context switch shadow
> + * stack state. If this isn't present, disable user shadow
> + * stacks.
> + */
> + pr_err("x86/fpu: CET_USER not supported in xstate when CET is supported. Disabling shadow stacks.\n");
> + setup_clear_cpu_cap(X86_FEATURE_USER_SHSTK);
> + }
Are there any more of these? I'm wondering if we want a table that's
effectively the reverse of xsave_cpuid_features[].
Maybe X86_FEATURE_ENQCMD at least?