Skip to content

Commit bc6397c

Browse files
kudureranganathingomolnar
authored andcommitted
x86/cpu/topology: Define AMD64_CPUID_EXT_FEAT MSR
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
1 parent d691c5f commit bc6397c

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

arch/x86/include/asm/msr-index.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,11 @@
631631
#define MSR_AMD_PPIN 0xc00102f1
632632
#define MSR_AMD64_CPUID_FN_7 0xc0011002
633633
#define MSR_AMD64_CPUID_FN_1 0xc0011004
634+
635+
#define MSR_AMD64_CPUID_EXT_FEAT 0xc0011005
636+
#define MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT_BIT 54
637+
#define MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT BIT_ULL(MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT_BIT)
638+
634639
#define MSR_AMD64_LS_CFG 0xc0011020
635640
#define MSR_AMD64_DC_CFG 0xc0011022
636641
#define MSR_AMD64_TW_CFG 0xc0011023

arch/x86/kernel/cpu/topology_amd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,12 @@ static void topoext_fixup(struct topo_scan *tscan)
163163
c->x86 != 0x15 || c->x86_model < 0x10 || c->x86_model > 0x6f)
164164
return;
165165

166-
if (msr_set_bit(0xc0011005, 54) <= 0)
166+
if (msr_set_bit(MSR_AMD64_CPUID_EXT_FEAT,
167+
MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT_BIT) <= 0)
167168
return;
168169

169-
rdmsrq(0xc0011005, msrval);
170-
if (msrval & BIT_64(54)) {
170+
rdmsrq(MSR_AMD64_CPUID_EXT_FEAT, msrval);
171+
if (msrval & MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT) {
171172
set_cpu_cap(c, X86_FEATURE_TOPOEXT);
172173
pr_info_once(FW_INFO "CPU: Re-enabling disabled Topology Extensions Support.\n");
173174
}

0 commit comments

Comments
 (0)