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

"Ahmed S. Darwish" <[email protected]>
Newsgroups dev.linux.lists.x86-cpuid,org.kernel.vger.linux-kernel
Message-ID <aKNWuX6UHd_6wJoR@lx-t490>
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/[email protected]

>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.