Re: [PATCH] x86/fred: Fix early boot failures on SEV-ES/SNP guests

From: Sohil Mehta

Date: Thu Feb 19 2026 - 14:27:30 EST


On 2/15/2026 9:16 PM, Nikunj A. Dadhania wrote:

> @@ -502,7 +517,7 @@ void cr4_init(void)
>
> if (boot_cpu_has(X86_FEATURE_PCID))
> cr4 |= X86_CR4_PCIDE;
> - if (static_branch_likely(&cr_pinning))
> + if (cr_pinning_enabled())
> cr4 = (cr4 & ~cr4_pinned_mask) | cr4_pinned_bits;
>

Maybe I am missing something, but is there a reason to keep this check
anymore?

AFAIU, cr_pinning_enabled() will always be false during cr4_init().
cr4_init() always happens during early bringup when the cpu is marked
offline.

> __write_cr4(cr4);