x86/cpu: Add legacy topology parser
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Feb 2024 21:04:03 +0000 (22:04 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 15 Feb 2024 21:07:37 +0000 (22:07 +0100)
commitbda74aae20086c044b31ca0dcdab7deaaf23d0e8
treeb52e4369d23cc3e8da3f945ddcbaacca515f5e16
parentebdb20361059b3c4fd7b23cfa10c28e798b7a3d2
x86/cpu: Add legacy topology parser

The legacy topology detection via CPUID leaf 4, which provides the number
of cores in the package and CPUID leaf 1 which provides the number of
logical CPUs in case that FEATURE_HT is enabled and the CMP_LEGACY feature
is not set, is shared for Intel, Centaur and Zhaoxin CPUs.

Lift the code from common.c without the early detection hack and provide it
as common fallback mechanism.

Will be utilized in later changes.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Juergen Gross <jgross@suse.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Wang Wendy <wendy.wang@intel.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20240212153624.644448852@linutronix.de
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/topology.h
arch/x86/kernel/cpu/topology_common.c