[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250815070227.19981-34-darwi@linutronix.de>
Date: Fri, 15 Aug 2025 09:02:26 +0200
From: "Ahmed S. Darwish" <darwi@...utronix.de>
To: Borislav Petkov <bp@...en8.de>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Andrew Cooper <andrew.cooper3@...rix.com>,
"H. Peter Anvin" <hpa@...or.com>,
David Woodhouse <dwmw2@...radead.org>,
Sean Christopherson <seanjc@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Sohil Mehta <sohil.mehta@...el.com>,
John Ogness <john.ogness@...utronix.de>,
x86@...nel.org,
x86-cpuid@...ts.linux.dev,
LKML <linux-kernel@...r.kernel.org>,
"Ahmed S. Darwish" <darwi@...utronix.de>
Subject: [PATCH v4 33/34] x86/cpuid: Parse CPUID(0x16)
Add CPUID(0x16) support to the CPUID parser. It enumerates processor
frequency information. Query the leaf only for Intel machines, as this
is where it is supported.
This allows converting CPUID(0x16) call sites to the new CPUID parser
APIs next.
Signed-off-by: Ahmed S. Darwish <darwi@...utronix.de>
---
arch/x86/include/asm/cpuid/types.h | 1 +
arch/x86/kernel/cpu/cpuid_parser.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/arch/x86/include/asm/cpuid/types.h b/arch/x86/include/asm/cpuid/types.h
index 63d2569e2821..c044f7bc7137 100644
--- a/arch/x86/include/asm/cpuid/types.h
+++ b/arch/x86/include/asm/cpuid/types.h
@@ -217,6 +217,7 @@ struct cpuid_leaves {
CPUID_LEAF(0x1, 0, 1);
CPUID_LEAF(0x2, 0, 1);
CPUID_LEAF(0x4, 0, 8);
+ CPUID_LEAF(0x16, 0, 1);
CPUID_LEAF(0x80000000, 0, 1);
CPUID_LEAF(0x80000005, 0, 1);
CPUID_LEAF(0x80000006, 0, 1);
diff --git a/arch/x86/kernel/cpu/cpuid_parser.h b/arch/x86/kernel/cpu/cpuid_parser.h
index 1d0d1a3c2bb8..9ac66abeae81 100644
--- a/arch/x86/kernel/cpu/cpuid_parser.h
+++ b/arch/x86/kernel/cpu/cpuid_parser.h
@@ -129,6 +129,7 @@ struct cpuid_parse_entry {
/* Leaf Subleaf Reader function */ \
CPUID_PARSE_ENTRY(0x2, 0, 0x2), \
CPUID_PARSE_ENTRY(0x4, 0, deterministic_cache), \
+ CPUID_PARSE_ENTRY(0x16, 0, generic), \
CPUID_PARSE_ENTRY(0x80000000, 0, 0x80000000), \
CPUID_PARSE_ENTRY(0x80000005, 0, generic), \
CPUID_PARSE_ENTRY(0x80000006, 0, generic), \
@@ -167,6 +168,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(0x16, X86_VENDOR_INTEL), \
CPUID_VENDOR_ENTRY(0x8000001d, X86_VENDOR_AMD, X86_VENDOR_HYGON), \
#endif /* _ARCH_X86_CPUID_PARSER_H */
--
2.50.1
Powered by blists - more mailing lists