x86/cpu/hygon: Set __max_die_per_package on Hygon
authorPu Wen <puwen@hygon.cn>
Tue, 2 Mar 2021 02:02:17 +0000 (10:02 +0800)
committerIngo Molnar <mingo@kernel.org>
Sat, 6 Mar 2021 11:54:59 +0000 (12:54 +0100)
Set the maximum DIE per package variable on Hygon using the
nodes_per_socket value in order to do per-DIE manipulations for drivers
such as powercap.

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20210302020217.1827-1-puwen@hygon.cn
arch/x86/kernel/cpu/hygon.c

index ae59115d18f9987dc0232dfa04b41afd6763a838..0bd6c74e3ba15ef5e0e1f0b5a704bf16b3b9d9aa 100644 (file)
@@ -215,12 +215,12 @@ static void bsp_init_hygon(struct cpuinfo_x86 *c)
                u32 ecx;
 
                ecx = cpuid_ecx(0x8000001e);
-               nodes_per_socket = ((ecx >> 8) & 7) + 1;
+               __max_die_per_package = nodes_per_socket = ((ecx >> 8) & 7) + 1;
        } else if (boot_cpu_has(X86_FEATURE_NODEID_MSR)) {
                u64 value;
 
                rdmsrl(MSR_FAM10H_NODE_ID, value);
-               nodes_per_socket = ((value >> 3) & 7) + 1;
+               __max_die_per_package = nodes_per_socket = ((value >> 3) & 7) + 1;
        }
 
        if (!boot_cpu_has(X86_FEATURE_AMD_SSBD) &&