Commit 1eb8f690 authored by Borislav Petkov's avatar Borislav Petkov
Browse files

x86/topology: Make __max_die_per_package available unconditionally



Move it outside of CONFIG_SMP in order to avoid ifdeffery at the usage
sites.

Fixes: 76e2fc63 ("x86/cpu/amd: Set __max_die_per_package on AMD")
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210114111814.5346-1-bp@alien8.de
parent 66a42501
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -110,6 +110,8 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu);
#define topology_die_id(cpu)			(cpu_data(cpu).cpu_die_id)
#define topology_core_id(cpu)			(cpu_data(cpu).cpu_core_id)

extern unsigned int __max_die_per_package;

#ifdef CONFIG_SMP
#define topology_die_cpumask(cpu)		(per_cpu(cpu_die_map, cpu))
#define topology_core_cpumask(cpu)		(per_cpu(cpu_core_map, cpu))
@@ -118,8 +120,6 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu);
extern unsigned int __max_logical_packages;
#define topology_max_packages()			(__max_logical_packages)

extern unsigned int __max_die_per_package;

static inline int topology_max_die_per_package(void)
{
	return __max_die_per_package;
+1 −1
Original line number Diff line number Diff line
@@ -25,10 +25,10 @@
#define BITS_SHIFT_NEXT_LEVEL(eax)	((eax) & 0x1f)
#define LEVEL_MAX_SIBLINGS(ebx)		((ebx) & 0xffff)

#ifdef CONFIG_SMP
unsigned int __max_die_per_package __read_mostly = 1;
EXPORT_SYMBOL(__max_die_per_package);

#ifdef CONFIG_SMP
/*
 * Check if given CPUID extended toplogy "leaf" is implemented
 */