Re: [PATCH v2 1/2] x86/cpu: Disable CR pinning during CPU bringup
From: Chang S. Bae
Date: Tue Mar 17 2026 - 13:10:00 EST
On 3/13/2026 1:35 AM, Nikunj A. Dadhania wrote:
+ /*
+ * CPUs that support FSGSBASE may use RDGSBASE/WRGSBASE in
+ * paranoid_entry(). Enable the feature before any exceptions
+ * occur.
+ */
To ensure this not bite back again, maybe better to document the detail on the way the entry code was shaped out here (or somewhere else):
To APs, the exception entry code was already patched when available,
which means those instructions will execute unconditionally there. So,
APs must set CR4.FSGSBASE as early as possible.
+ if (cpu_feature_enabled(X86_FEATURE_FSGSBASE)) {
+ cr4_set_bits(X86_CR4_FSGSBASE);
+ elf_hwcap2 |= HWCAP2_FSGSBASE;
+ }
+