diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2024-02-13 22:06:10 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-02-15 22:07:45 +0100 |
commit | 3205c9833d69b97e8694efe3e193312dea4c571f (patch) | |
tree | 8d15d470f15dcf272831365b1844c0ad522b8daf /arch/x86/kernel/cpu/topology.h | |
parent | x86/cpu/topology: Use topology logical mapping mechanism (diff) | |
download | linux-3205c9833d69b97e8694efe3e193312dea4c571f.tar.xz linux-3205c9833d69b97e8694efe3e193312dea4c571f.zip |
x86/cpu/topology: Retrieve cores per package from topology bitmaps
Similar to other sizing information the number of cores per package can be
established from the topology bitmap.
Provide a function for retrieving that information and replace the buggy
hack in the CPUID evaluation with it.
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/20240213210252.956858282@linutronix.de
Diffstat (limited to 'arch/x86/kernel/cpu/topology.h')
-rw-r--r-- | arch/x86/kernel/cpu/topology.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/topology.h b/arch/x86/kernel/cpu/topology.h index 2a3c838b6044..37326297f80c 100644 --- a/arch/x86/kernel/cpu/topology.h +++ b/arch/x86/kernel/cpu/topology.h @@ -53,4 +53,15 @@ static inline void topology_update_dom(struct topo_scan *tscan, enum x86_topolog tscan->dom_ncpus[dom] = ncpus; } +#ifdef CONFIG_X86_LOCAL_APIC +unsigned int topology_unit_count(u32 apicid, enum x86_topology_domains which_units, + enum x86_topology_domains at_level); +#else +static inline unsigned int topology_unit_count(u32 apicid, enum x86_topology_domains which_units, + enum x86_topology_domains at_level) +{ + return 1; +} +#endif + #endif /* ARCH_X86_TOPOLOGY_H */ |