[PATCH v3 37/44] x86/cpuid: Parse CPUID(0x80000005) and CPUID(0x80000006)
From: Ahmed S. Darwish
Date: Thu Jun 12 2025 - 19:46:56 EST
Parse AMD cacheinfo CPUID(0x80000005) and CPUID(0x80000006), if available,
using the generic CPUID parser read function cpuid_read_generic().
The x86/cacheinfo AMD CPUID(0x4)-emulation logic will be swithced next to
the parsed CPUID table APIs instead of invoking direct CPUID queries.
Signed-off-by: Ahmed S. Darwish <darwi@xxxxxxxxxxxxx>
---
arch/x86/include/asm/cpuid/types.h | 2 ++
arch/x86/kernel/cpu/cpuid_parser.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/arch/x86/include/asm/cpuid/types.h b/arch/x86/include/asm/cpuid/types.h
index 89c399629e58..63d2569e2821 100644
--- a/arch/x86/include/asm/cpuid/types.h
+++ b/arch/x86/include/asm/cpuid/types.h
@@ -218,6 +218,8 @@ struct cpuid_leaves {
CPUID_LEAF(0x2, 0, 1);
CPUID_LEAF(0x4, 0, 8);
CPUID_LEAF(0x80000000, 0, 1);
+ CPUID_LEAF(0x80000005, 0, 1);
+ CPUID_LEAF(0x80000006, 0, 1);
CPUID_LEAF(0x8000001d, 0, 8);
};
diff --git a/arch/x86/kernel/cpu/cpuid_parser.h b/arch/x86/kernel/cpu/cpuid_parser.h
index be4ef64c48b6..e4b34f0946ec 100644
--- a/arch/x86/kernel/cpu/cpuid_parser.h
+++ b/arch/x86/kernel/cpu/cpuid_parser.h
@@ -99,6 +99,8 @@ struct cpuid_parse_entry {
CPUID_PARSE_ENTRY(0x2, 0, 0x2), \
CPUID_PARSE_ENTRY(0x4, 0, deterministic_cache), \
CPUID_PARSE_ENTRY(0x80000000, 0, 0x80000000), \
+ CPUID_PARSE_ENTRY(0x80000005, 0, generic), \
+ CPUID_PARSE_ENTRY(0x80000006, 0, generic), \
CPUID_PARSE_ENTRY(0x8000001d, 0, deterministic_cache),
extern const struct cpuid_parse_entry cpuid_common_parse_entries[];
--
2.49.0