From: Thomas Gleixner Date: Thu, 30 Mar 2023 07:52:16 +0000 (+0200) Subject: x86/topology: Store extended topology leaf information X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0b8fbd5b976b43a87c50983a343fc02f738b5f8c;p=users%2Fdwmw2%2Flinux.git x86/topology: Store extended topology leaf information Save the extended topology leaf number if it exists and is valid in preparation of parallel CPU bringup. Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 2ba57588e937f..0226565ec6320 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -121,6 +121,7 @@ extern unsigned int __max_die_per_package; #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) +extern unsigned int topology_extended_leaf; extern unsigned int __max_logical_packages; #define topology_max_packages() (__max_logical_packages) diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c index 5e868b62a7c4e..bd72368cdce06 100644 --- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -29,6 +29,8 @@ unsigned int __max_die_per_package __read_mostly = 1; EXPORT_SYMBOL(__max_die_per_package); #ifdef CONFIG_SMP +unsigned int topology_extended_leaf __ro_after_init; + /* * Check if given CPUID extended topology "leaf" is implemented */ @@ -72,6 +74,7 @@ int detect_extended_topology_early(struct cpuinfo_x86 *c) if (leaf < 0) return -1; + topology_extended_leaf = leaf; set_cpu_cap(c, X86_FEATURE_XTOPOLOGY); cpuid_count(leaf, SMT_LEVEL, &eax, &ebx, &ecx, &edx);