Skip to content

Commit 76e2fc6

Browse files
yghannamsuryasaimadhu
authored andcommitted
x86/cpu/amd: Set __max_die_per_package on AMD
Set the maximum DIE per package variable on AMD using the NodesPerProcessor topology value. This will be used by RAPL, among others, to determine the maximum number of DIEs on the system in order to do per-DIE manipulations. [ bp: Productize into a proper patch. ] Fixes: 028c221 ("x86/CPU/AMD: Save AMD NodeId as cpu_die_id") Reported-by: Johnathan Smithinovic <[email protected]> Reported-by: Rafael Kitover <[email protected]> Signed-off-by: Yazen Ghannam <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Tested-by: Johnathan Smithinovic <[email protected]> Tested-by: Rafael Kitover <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=210939 Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 7024f60 commit 76e2fc6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/kernel/cpu/amd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,12 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
542542
u32 ecx;
543543

544544
ecx = cpuid_ecx(0x8000001e);
545-
nodes_per_socket = ((ecx >> 8) & 7) + 1;
545+
__max_die_per_package = nodes_per_socket = ((ecx >> 8) & 7) + 1;
546546
} else if (boot_cpu_has(X86_FEATURE_NODEID_MSR)) {
547547
u64 value;
548548

549549
rdmsrl(MSR_FAM10H_NODE_ID, value);
550-
nodes_per_socket = ((value >> 3) & 7) + 1;
550+
__max_die_per_package = nodes_per_socket = ((value >> 3) & 7) + 1;
551551
}
552552

553553
if (!boot_cpu_has(X86_FEATURE_AMD_SSBD) &&

0 commit comments

Comments
 (0)