From: "Ahmed S. Darwish" <darwi@linutronix.de>
To: Borislav Petkov <bp@alien8.de>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, x86-cpuid@lists.linux.dev
Cc: Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: [ANNOUNCE] x86-cpuid.org: A machine-readable CPUID repository
Date: Thu, 18 Jul 2024 15:45:52 +0200 [thread overview]
Message-ID: <ZpkckA2SHa1r3Bor@lx-t490> (raw)
On x86 CPUs, the "CPUID" instruction is used for runtime identification
of CPU features. It takes as input a leaf number in the EAX register
and an optional subleaf number in the ECX register. According to the
leaf and subleaf, certain information regarding CPU identification and
supported features will be returned as output through the EAX, EBX, ECX,
and EDX registers.
Due to the extensiveness and long history of the x86 architecture, the
amount of information that can be queried through CPUID is huge: now up
to 800+ bitfields, scattered over 52 CPUID leaves. The returned
bitfield descriptions can also differ according to the x86 CPU vendor.
We would like to announce the x86-cpuid.org project, which aims to:
1. Standardize a machine-readable language/syntax for describing the
CPUID instruction output.
2. Build an extensive database, in that machine-readable syntax,
describing all the publicly-known CPUID bitfields output.
Such a database will be properly maintained and act as the standard
information source for multiple open-source projects downstream.
3. Augment the CPUID database with usage hints for significant open
source projects like the Linux Kernel and the Xen hypervisor.
Usage hints for other projects can be easily added later.
4. Provide code and data generators utilizing that CPUID database.
In the project's machine-readable repository, we have covered:
- 52 CPUID leaves (and all their known subleaves.)
- 835 CPUID bitfields description, filtered by x86 CPU vendor.
Attached to the above CPUID bitfield descriptions are:
- 274 Linux kernel x86 feature flags (X86_FEATURE_* definitions)
- 230 Linux kernel /proc/cpuinfo flags
- 198 Xen hypervisor feature and attribute flags
We have developed multiple "code/data generators" utilizing the above
information for downstream projects.
The first generator produces a complete CSV bitfield file for the Linux
kernel's kcpuid utility under tools/arch/x86/kcpuid. This upgrades the
tool to complete CPUID coverage, and a kcpuid series will be sent as a
threaded reply to this announcement.
The second generator produces C data structures for all CPUID leaves,
with detailed C99 bitfield members included. We expect to use it to
standardize the CPUID registers representation across the Linux kernel's
x86 subsystem among other goals that are to be outlined in future
series, such as a dependency data model for the kernel's X86_FEATURE
flags.
The project's documentation is extensive, and can be found at:
- https://gitlab.com/x86-cpuid.org/x86-cpuid-db
At plumbers last year, I've discussed the origin story of this effort:
- https://lpc.events/event/17/contributions/1511/
At the x86 microconference this year, I should also provide an update on
future steps:
- https://lpc.events/event/18/contributions/1762/
Thanks a lot,
Ahmed
--
Linutronix GmbH
next reply other threads:[~2024-07-18 13:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 13:45 Ahmed S. Darwish [this message]
2024-07-18 13:47 ` [PATCH v1 0/9] tools/x86/kcpuid: Complete the CPUID database Ahmed S. Darwish
2024-07-18 13:47 ` [PATCH v1 1/9] tools/x86/kcpuid: Remove unused variable Ahmed S. Darwish
2024-08-02 7:28 ` [tip: x86/misc] " tip-bot2 for Ahmed S. Darwish
2024-07-18 13:47 ` [PATCH v1 2/9] tools/x86/kcpuid: Properly align long-description columns Ahmed S. Darwish
2024-08-02 7:28 ` [tip: x86/misc] " tip-bot2 for Ahmed S. Darwish
2024-07-18 13:47 ` [PATCH v1 3/9] tools/x86/kcpuid: Set max possible subleaves count to 64 Ahmed S. Darwish
2024-08-02 7:28 ` [tip: x86/misc] " tip-bot2 for Ahmed S. Darwish
2024-07-18 13:47 ` [PATCH v1 4/9] tools/x86/kcpuid: Protect against faulty "max subleaf" values Ahmed S. Darwish
2024-08-02 7:28 ` [tip: x86/misc] " tip-bot2 for Ahmed S. Darwish
2024-07-18 13:47 ` [PATCH v1 5/9] tools/x86/kcpuid: Strip bitfield names leading/trailing whitespace Ahmed S. Darwish
2024-08-02 7:28 ` [tip: x86/misc] " tip-bot2 for Ahmed S. Darwish
2024-07-18 13:47 ` [PATCH v1 6/9] tools/x86/kcpuid: Recognize all leaves with subleaves Ahmed S. Darwish
2024-08-02 7:28 ` [tip: x86/misc] " tip-bot2 for Ahmed S. Darwish
2024-07-18 13:47 ` [PATCH v1 7/9] tools/x86/kcpuid: Parse subleaf ranges if provided Ahmed S. Darwish
2024-08-02 7:28 ` [tip: x86/misc] " tip-bot2 for Ahmed S. Darwish
2024-07-18 13:47 ` [PATCH v1 8/9] tools/x86/kcpuid: Introduce a complete cpuid bitfields CSV file Ahmed S. Darwish
2024-08-02 7:28 ` [tip: x86/misc] " tip-bot2 for Ahmed S. Darwish
2024-07-18 13:47 ` [PATCH v1 9/9] MAINTAINERS: Add x86 cpuid database entry Ahmed S. Darwish
2024-08-02 7:28 ` [tip: x86/misc] " tip-bot2 for Ahmed S. Darwish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZpkckA2SHa1r3Bor@lx-t490 \
--to=darwi@linutronix.de \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86-cpuid@lists.linux.dev \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®