Commit 03fa6bea authored by Thomas Gleixner's avatar Thomas Gleixner

x86/cpu: Make topology_amd_node_id() use the actual node info

Now that everything is converted switch it over and remove the intermediate
operation.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarJuergen Gross <jgross@suse.com>
Tested-by: default avatarSohil Mehta <sohil.mehta@intel.com>
Tested-by: default avatarMichael Kelley <mhklinux@outlook.com>
Tested-by: default avatarZhang Rui <rui.zhang@intel.com>
Tested-by: default avatarWang Wendy <wendy.wang@intel.com>
Tested-by: default avatarK Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20240212153625.334185785@linutronix.de


parent d805a691
...@@ -136,7 +136,7 @@ extern const struct cpumask *cpu_clustergroup_mask(int cpu); ...@@ -136,7 +136,7 @@ extern const struct cpumask *cpu_clustergroup_mask(int cpu);
#define topology_core_id(cpu) (cpu_data(cpu).topo.core_id) #define topology_core_id(cpu) (cpu_data(cpu).topo.core_id)
#define topology_ppin(cpu) (cpu_data(cpu).ppin) #define topology_ppin(cpu) (cpu_data(cpu).ppin)
#define topology_amd_node_id(cpu) (cpu_data(cpu).topo.die_id) #define topology_amd_node_id(cpu) (cpu_data(cpu).topo.amd_node_id)
extern unsigned int __max_die_per_package; extern unsigned int __max_die_per_package;
...@@ -172,7 +172,7 @@ extern unsigned int __amd_nodes_per_pkg; ...@@ -172,7 +172,7 @@ extern unsigned int __amd_nodes_per_pkg;
static inline unsigned int topology_amd_nodes_per_pkg(void) static inline unsigned int topology_amd_nodes_per_pkg(void)
{ {
return __max_die_per_package; return __amd_nodes_per_pkg;
} }
extern struct cpumask __cpu_primary_thread_mask; extern struct cpumask __cpu_primary_thread_mask;
......
...@@ -151,9 +151,7 @@ static void topo_set_ids(struct topo_scan *tscan) ...@@ -151,9 +151,7 @@ static void topo_set_ids(struct topo_scan *tscan)
c->topo.core_id = (apicid & topo_domain_mask(TOPO_PKG_DOMAIN)) >> c->topo.core_id = (apicid & topo_domain_mask(TOPO_PKG_DOMAIN)) >>
x86_topo_system.dom_shifts[TOPO_SMT_DOMAIN]; x86_topo_system.dom_shifts[TOPO_SMT_DOMAIN];
/* Temporary workaround */ c->topo.amd_node_id = tscan->amd_node_id;
if (tscan->amd_nodes_per_pkg)
c->topo.amd_node_id = c->topo.die_id = tscan->amd_node_id;
if (c->x86_vendor == X86_VENDOR_AMD) if (c->x86_vendor == X86_VENDOR_AMD)
cpu_topology_fixup_amd(tscan); cpu_topology_fixup_amd(tscan);
...@@ -239,6 +237,5 @@ void __init cpu_init_topology(struct cpuinfo_x86 *c) ...@@ -239,6 +237,5 @@ void __init cpu_init_topology(struct cpuinfo_x86 *c)
* AMD systems have Nodes per package which cannot be mapped to * AMD systems have Nodes per package which cannot be mapped to
* APIC ID. * APIC ID.
*/ */
if (c->x86_vendor == X86_VENDOR_AMD || c->x86_vendor == X86_VENDOR_HYGON) __amd_nodes_per_pkg = tscan.amd_nodes_per_pkg;
__amd_nodes_per_pkg = __max_die_per_package = tscan.amd_nodes_per_pkg;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment