summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/topology_common.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2024-02-13 22:06:09 +0100
committerThomas Gleixner <tglx@linutronix.de>2024-02-15 22:07:44 +0100
commit380414be78bf8dbe1c3ed98feb75e2579c4a1bae (patch)
treef32f8bf04847d62e4312bd15dcf6b9b12217d70b /arch/x86/kernel/cpu/topology_common.c
parentb7065f4f844c7876ed071b67e2ba57838152bd63 (diff)
x86/cpu/topology: Use topology logical mapping mechanism
Replace the logical package and die management functionality and retrieve the logical IDs from the topology bitmaps. 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.901865302@linutronix.de
Diffstat (limited to 'arch/x86/kernel/cpu/topology_common.c')
-rw-r--r--arch/x86/kernel/cpu/topology_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/topology_common.c
index 0276978bc272..c21a3871a870 100644
--- a/arch/x86/kernel/cpu/topology_common.c
+++ b/arch/x86/kernel/cpu/topology_common.c
@@ -10,6 +10,7 @@
#include "cpu.h"
struct x86_topology_system x86_topo_system __ro_after_init;
+EXPORT_SYMBOL_GPL(x86_topo_system);
unsigned int __amd_nodes_per_pkg __ro_after_init;
EXPORT_SYMBOL_GPL(__amd_nodes_per_pkg);
@@ -147,6 +148,9 @@ static void topo_set_ids(struct topo_scan *tscan)
c->topo.pkg_id = topo_shift_apicid(apicid, TOPO_PKG_DOMAIN);
c->topo.die_id = topo_shift_apicid(apicid, TOPO_DIE_DOMAIN);
+ c->topo.logical_pkg_id = topology_get_logical_id(apicid, TOPO_PKG_DOMAIN);
+ c->topo.logical_die_id = topology_get_logical_id(apicid, TOPO_DIE_DOMAIN);
+
/* Package relative core ID */
c->topo.core_id = (apicid & topo_domain_mask(TOPO_PKG_DOMAIN)) >>
x86_topo_system.dom_shifts[TOPO_SMT_DOMAIN];