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

From: H. Peter Anvin
Date: Thu May 08 2025 - 18:38:44 EST


On May 8, 2025 1:58:11 PM PDT, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>On 08/05/2025 9:40 pm, H. Peter Anvin wrote:
>> On May 7, 2025 1:50:48 AM PDT, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> 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.
>>>
>>> ~Andrew
>> All 64-bit machines require CPUID leaf 0x80000000.
>
>Yes, but why's that relevant?
>
>What I'm querying is the claim that all 32-bit machines behaved as Intel
>did, and returned rubble for out-of-range leaves.
>
>~Andrew

They did not. Non-Intel CPUs did, and do, report 0 for undefined levels.

I believe even today Intel CPUs report the "last level" value for up to 0x7fffffff...