[PATCH v7 069/120] x86/cpuid: Parse CPUID(0x6), CPUID(0x9), and CPUID(0x15)
From: Ahmed S. Darwish
Date: Thu May 28 2026 - 12:26:41 EST
Parse CPUID(0x6), CPUID(0x9), and CPUID(0x15). Their call sites will be
converted next.
For HFI CPUID(0x6), do not add an Intel vendor tag. It is architecturally
defined for AMD, even though the kernel only uses it on Intel boxes so far.
For DCA CPUID(0x9), per the hardware manuals, check the CPUID(0x1).ECX.DCA
bit before declaring the leaf as valid.
Signed-off-by: Ahmed S. Darwish <darwi@xxxxxxxxxxxxx>
---
arch/x86/include/asm/cpuid/types.h | 3 +++
arch/x86/kernel/cpu/cpuid_parser.c | 12 ++++++++++++
arch/x86/kernel/cpu/cpuid_parser.h | 4 ++++
3 files changed, 19 insertions(+)
diff --git a/arch/x86/include/asm/cpuid/types.h b/arch/x86/include/asm/cpuid/types.h
index 50156e9883a3..2949584e85cc 100644
--- a/arch/x86/include/asm/cpuid/types.h
+++ b/arch/x86/include/asm/cpuid/types.h
@@ -213,6 +213,9 @@ struct cpuid_leaves {
CPUID_LEAF ( 0x2, 0 );
CPUID_LEAF_N ( 0x4, 8 );
CPUID_LEAF ( 0x5, 0 );
+ CPUID_LEAF ( 0x6, 0 );
+ CPUID_LEAF ( 0x9, 0 );
+ CPUID_LEAF ( 0x15, 0 );
CPUID_LEAF ( 0x16, 0 );
CPUID_LEAF ( 0x80000000, 0 );
CPUID_LEAF ( 0x80000002, 0 );
diff --git a/arch/x86/kernel/cpu/cpuid_parser.c b/arch/x86/kernel/cpu/cpuid_parser.c
index ee34894c79ef..f563834a082e 100644
--- a/arch/x86/kernel/cpu/cpuid_parser.c
+++ b/arch/x86/kernel/cpu/cpuid_parser.c
@@ -103,6 +103,18 @@ cpuid_read_0x2(const struct cpuid_parse_entry *e, const struct cpuid_read_output
*/
define_cpuid_read_function(deterministic_cache, leaf_0x4_n, l, l->cache_type == 0);
+static void
+cpuid_read_0x9(const struct cpuid_parse_entry *e, const struct cpuid_read_output *output)
+{
+ struct leaf_0x1_0 l1;
+
+ cpuid_read(0x1, &l1);
+ if (!l1.dca)
+ return;
+
+ cpuid_read_generic(e, output);
+}
+
/*
* Define an extended range CPUID read function
*
diff --git a/arch/x86/kernel/cpu/cpuid_parser.h b/arch/x86/kernel/cpu/cpuid_parser.h
index 3a60dad4e861..800a7bd6dca2 100644
--- a/arch/x86/kernel/cpu/cpuid_parser.h
+++ b/arch/x86/kernel/cpu/cpuid_parser.h
@@ -147,6 +147,9 @@ struct cpuid_parse_entry {
CPUID_PARSE_ENTRY ( 0x2, 0, 0x2 ), \
CPUID_PARSE_ENTRY_N ( 0x4, deterministic_cache ), \
CPUID_PARSE_ENTRY ( 0x5, 0, generic ), \
+ CPUID_PARSE_ENTRY ( 0x6, 0, generic ), \
+ CPUID_PARSE_ENTRY ( 0x9, 0, 0x9 ), \
+ CPUID_PARSE_ENTRY ( 0x15, 0, generic ), \
CPUID_PARSE_ENTRY ( 0x16, 0, generic ), \
CPUID_PARSE_ENTRY ( 0x80000000, 0, 0x80000000 ), \
CPUID_PARSE_ENTRY ( 0x80000002, 0, generic ), \
@@ -199,6 +202,7 @@ struct cpuid_vendor_entry {
/* Leaf Vendor list */ \
CPUID_VENDOR_ENTRY(0x2, X86_VENDOR_INTEL, X86_VENDOR_CENTAUR, X86_VENDOR_ZHAOXIN),\
CPUID_VENDOR_ENTRY(0x4, X86_VENDOR_INTEL, X86_VENDOR_CENTAUR, X86_VENDOR_ZHAOXIN),\
+ CPUID_VENDOR_ENTRY(0x15, X86_VENDOR_INTEL, X86_VENDOR_CENTAUR, X86_VENDOR_ZHAOXIN),\
CPUID_VENDOR_ENTRY(0x16, X86_VENDOR_INTEL), \
CPUID_VENDOR_ENTRY(0x8000001d, X86_VENDOR_AMD, X86_VENDOR_HYGON), \
CPUID_VENDOR_ENTRY(0x80860000, X86_VENDOR_TRANSMETA), \
--
2.54.0