On 26.01.2026 18:53, Andrew Cooper wrote:
> @@ -433,6 +437,19 @@ void __init early_cpu_init(bool verbose)
>               paddr_bits -= (ebx >> 6) & 0x3f;
>       }
>  
> +     if (c->extended_cpuid_level >= 0x80000021)
> +             c->x86_capability[FEATURESET_e21a] = cpuid_eax(0x80000021);
> +
> +     /*
> +      * Abuse 'verbose' to signal the first pass thought this function.
> +      *
> +      * Besides basic vendor, family and model information, the hooks need
> +      * certain words of x86_capability[] already scanned, as they may take
> +      * action to cause features to reappear.
> +      */
> +     if (verbose && actual_cpu.c_early_init)
> +             actual_cpu.c_early_init();

There's one slight issue with this tying to the "first pass" only: 
early_init_intel() right now calls check_memory_type_self_snoop_errata(),
which in turn uses boot_cpu_has(X86_FEATURE_SS). The comment at the 2nd
pass call site is

        /* Rescan CPUID/MSR features, which may have changed after a load. */

That, in principle, can affect any features, i.e. also SS. While for the
particular feature it may be pretty unlikely that microcode might make it
change, the mere fact that such a feature check is okay to do there may
later lead to more such getting added, not realizing that ucode loads then
may break things.

At the same time I understand that everything else in the *_early_init()
really doesn't want doing twice.

Jan

Reply via email to