Skip to content

Commit ace278e

Browse files
committed
x86/smpboot: Teach it about topo.amd_node_id
When switching AMD over to the new topology parser then the match functions need to look for AMD systems with the extended topology feature at the new topo.amd_node_id member which is then holding the node id information. 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/20240212153625.082979150@linutronix.de
1 parent f7fb3b2 commit ace278e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

arch/x86/kernel/smpboot.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
488488

489489
if (c->topo.pkg_id == o->topo.pkg_id &&
490490
c->topo.die_id == o->topo.die_id &&
491+
c->topo.amd_node_id == o->topo.amd_node_id &&
491492
per_cpu_llc_id(cpu1) == per_cpu_llc_id(cpu2)) {
492493
if (c->topo.core_id == o->topo.core_id)
493494
return topology_sane(c, o, "smt");
@@ -509,10 +510,13 @@ static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
509510

510511
static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
511512
{
512-
if (c->topo.pkg_id == o->topo.pkg_id &&
513-
c->topo.die_id == o->topo.die_id)
514-
return true;
515-
return false;
513+
if (c->topo.pkg_id != o->topo.pkg_id || c->topo.die_id != o->topo.die_id)
514+
return false;
515+
516+
if (cpu_feature_enabled(X86_FEATURE_TOPOEXT) && topology_amd_nodes_per_pkg() > 1)
517+
return c->topo.amd_node_id == o->topo.amd_node_id;
518+
519+
return true;
516520
}
517521

518522
static bool match_l2c(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)

0 commit comments

Comments
 (0)