Re: [PATCH v4 00/34] x86: Introduce a centralized CPUID data model

From: Ahmed S. Darwish
Date: Mon Aug 18 2025 - 12:38:12 EST


Hi!

On Sat, 16 Aug 2025, David Woodhouse wrote:
>
> Nice work.
>

Thanks a lot.

>
> Looks like you haven't attempted to address hypervisor CPUID yet.
>

Yeah, I plan to tackle the hypervisor stuff after the X86_FEATURE(s)
dependency graph mentioned in the Bhyve thread:

https://lore.kernel.org/lkml/aKL0WlA4wIU8l9RT@lx-t490

> I've attempted to document that in a section at the end of
> http://david.woodhou.se/ExtDestId.pdf — I wonder if we should find
> somewhere to publish it as canonical?

That PDF, and the text file it links to, is some of the best
documentation I ever saw in kernel land...

I would be more than happy to cover the last section of that PDF
('Hhypervisor Detection via CPUID') under the x86-cpuid-db umbrella.

There's some very basic hypervisor-related things:

https://gitlab.com/x86-cpuid.org/x86-cpuid-db/-/blob/tip/db/xml/hypervisors.xml
https://gitlab.com/x86-cpuid.org/x86-cpuid-db/-/blob/tip/db/xml/leaf_40000000.xml

But the idea of CPUID block "ranges", as in cpuid_base_hypervisor(), is
not yet covered. Also, the only thing these XMLs above actually do is
generating the 'struct leaf_0x40000000_0' data type:

Subject: [PATCH v4 06/34] x86/cpuid: Introduce <asm/cpuid/leaf_types.h>
https://lore.kernel.org/lkml/20250815070227.19981-7-darwi@xxxxxxxxxxxxx

>
> I suspect our loop in cpuid_base_hypervisor() should be 'fixed' to
> comply with the new rule I just made up, that it should only scan each
> block at 0x4000_0.00 until it finds an empty block, rather than going
> all the way up to 0x4001_0000?
>
> Are there any hypervisors which provide more than one block, that
> *aren't* just putting the Hyper-V leaves at 0x4000_0000 and their own
> native leaves at 0x4000_0100 ?
>

I think, no, but you and others at Cc are definitely the more experienced
folks regarding this :)

Thanks!

--
Ahmed S. Darwish
Linutronix GmbH