aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/topology.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2024-02-13 22:06:14 +0100
committerThomas Gleixner <tglx@linutronix.de>2024-02-15 22:07:45 +0100
commitfd43b8ae76e903c76f14d06eb939449bcc3f614f (patch)
tree512c9bfce5133df3cc07fb4a77cdfd012e0ee93a /arch/x86/include/asm/topology.h
parentbd745d1c41e7fa56242889eb5dc6df2d7dd5df32 (diff)
x86/cpu/topology: Provide __num_[cores|threads]_per_package
Expose properly accounted information and accessors so the fiddling with other topology variables can be replaced. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Michael Kelley <mhklinux@outlook.com> Tested-by: Sohil Mehta <sohil.mehta@intel.com> Link: https://lore.kernel.org/r/20240213210253.120958987@linutronix.de
Diffstat (limited to 'arch/x86/include/asm/topology.h')
-rw-r--r--arch/x86/include/asm/topology.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 6a71794bd4e2..76b1d87f1531 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -146,6 +146,8 @@ extern const struct cpumask *cpu_clustergroup_mask(int cpu);
extern unsigned int __max_dies_per_package;
extern unsigned int __max_logical_packages;
extern unsigned int __max_threads_per_core;
+extern unsigned int __num_threads_per_package;
+extern unsigned int __num_cores_per_package;
static inline unsigned int topology_max_packages(void)
{
@@ -157,6 +159,16 @@ static inline unsigned int topology_max_dies_per_package(void)
return __max_dies_per_package;
}
+static inline unsigned int topology_num_cores_per_package(void)
+{
+ return __num_cores_per_package;
+}
+
+static inline unsigned int topology_num_threads_per_package(void)
+{
+ return __num_threads_per_package;
+}
+
#ifdef CONFIG_X86_LOCAL_APIC
int topology_get_logical_id(u32 apicid, enum x86_topology_domains at_level);
#else