Re: [PATCH v1 02/26] x86/cpu: Sanitize CPUID(0x80000000) output

From: Ahmed S. Darwish (dev)
Date: Fri May 09 2025 - 05:24:16 EST


Hi,

On Wed, 07 May 2025, Andrew Cooper wrote:
>
> On 06/05/2025 6:04 am, Ahmed S. Darwish wrote:
> >
> > CPUID(0x80000000).EAX returns the max extended CPUID leaf available. On
> > x86-32 machines
>
> How certain are you that it's all 32bit CPUs?  AIUI, it's an Intel
> specific behaviour, not shared by other x86 vendors of the same era.
>

Sorry, I missed responding to this earlier.

You're correct. I indeed assumed that for all invalid CPUID queries, the
CPU repeats the output of the last valid standard leaf on /all/ x86
machines — thus CPUID(0x80000000) behaves this way also on all x86-32
machines lacking an extended range.

I've done a quick check on some Intel vs. AMD machines, and indeed, this
is Intel-specific. AMD machines just return all-zero instead.

(The patch content is still valid, and I guess that's what HPA was just
hinting at further down the thread.)

Thanks!
~ Ahmed