Re: [PATCH v7 007/120] x86/cpu: centaur/zhaoxin: Rescan CPUID(0xc0000001) after MSR writes
From: Ahmed S. Darwish
Date: Thu May 28 2026 - 13:40:50 EST
On Thu, 28 May 2026, Borislav Petkov wrote:
>
> On Thu, May 28, 2026 at 05:37:29PM +0200, Ahmed S. Darwish wrote:
> > Force-enabling Centaur/Zhaoxin CPU features through MSR writes leads to
> > the CPUID(0xc0000001) EDX feature flags getting changed.
> >
> > Rescan CPUID(0xc0000001) in that case.
>
> Where is the new pass - cpuid_scan_cpu() or so - scan that leaf so that
> you need to rescan it here?
>
Hmmm, at centar.c there is:
init_centaur() || early_init_centaur()
init_c3()
CPUID(0xc0000001) refresh
And inside common.c early_identify_cpu(), the CPUID parser is initialized
before both the ->c_early_init() and the ->c_init() hooks are called.
I agree that it is a bit confusing to have this before the code which
parses CPUID(0xc0000001).
The idea was to have these refresh hooks in place so that by the time
CPUID(0xc0000001) is parsed, everything is correct without an invalid
intermediate state.
I guess I could've merged it with:
20 x86/cpuid: Parse Transmeta and Centaur extended ranges
But that one was already too big for that.
This is your concern, right? If so, I can move the refresh there.
Thanks,
Ahmed