]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/cpu/topology: Define AMD64_CPUID_EXT_FEAT MSR
authorK Prateek Nayak <kprateek.nayak@amd.com>
Mon, 1 Sep 2025 17:04:17 +0000 (17:04 +0000)
committerIngo Molnar <mingo@kernel.org>
Wed, 17 Sep 2025 09:24:33 +0000 (11:24 +0200)
Add defines for the 0xc001_1005 MSR (Core::X86::Msr::CPUID_ExtFeatures) used
to toggle the extended CPUID features, instead of using literal numbers. Also
define and use the bits necessary for an old TOPOEXT fixup on AMD Family 0x15
processors.

No functional changes intended.

  [ bp: Massage, rename MSR to adhere to the documentation name. ]

Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/20250901170418.4314-1-kprateek.nayak@amd.com
arch/x86/include/asm/msr-index.h
arch/x86/kernel/cpu/topology_amd.c

index b65c3ba5fa1410bb7a9a3774fd964d0d7ea9ab5d..a734b5602149677f3e2001bd637f46bd0a75b243 100644 (file)
 #define MSR_AMD_PPIN                   0xc00102f1
 #define MSR_AMD64_CPUID_FN_7           0xc0011002
 #define MSR_AMD64_CPUID_FN_1           0xc0011004
+
+#define MSR_AMD64_CPUID_EXT_FEAT       0xc0011005
+#define MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT_BIT   54
+#define MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT       BIT_ULL(MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT_BIT)
+
 #define MSR_AMD64_LS_CFG               0xc0011020
 #define MSR_AMD64_DC_CFG               0xc0011022
 #define MSR_AMD64_TW_CFG               0xc0011023
index 7ebd4a15c5618443bd718e22e12abebd8a46a8d8..6ac097e1310659e223ceecc37f07712ea469a790 100644 (file)
@@ -163,11 +163,12 @@ static void topoext_fixup(struct topo_scan *tscan)
            c->x86 != 0x15 || c->x86_model < 0x10 || c->x86_model > 0x6f)
                return;
 
-       if (msr_set_bit(0xc0011005, 54) <= 0)
+       if (msr_set_bit(MSR_AMD64_CPUID_EXT_FEAT,
+                       MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT_BIT) <= 0)
                return;
 
-       rdmsrq(0xc0011005, msrval);
-       if (msrval & BIT_64(54)) {
+       rdmsrq(MSR_AMD64_CPUID_EXT_FEAT, msrval);
+       if (msrval & MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT) {
                set_cpu_cap(c, X86_FEATURE_TOPOEXT);
                pr_info_once(FW_INFO "CPU: Re-enabling disabled Topology Extensions Support.\n");
        }