Skip to content

Commit 85900d0

Browse files
Saurabh SengarIngo Molnar
authored andcommitted
x86/of: Map NUMA node to CPUs as per DeviceTree
Currently for DeviceTree bootup, x86 code does the default mapping of CPUs to NUMA, which is wrong. This can cause incorrect mapping and WARNs on SMT enabled systems: CPU #1's smt-sibling CPU #0 is not on the same node! [node: 1 != 0]. Ignoring dependency. WARNING: CPU: 1 PID: 0 at topology_sane.isra.0+0x5c/0x6d match_smt+0xf6/0xfc set_cpu_sibling_map.cold+0x24f/0x512 start_secondary+0x5c/0x110 Call the set_apicid_to_node() function in dtb_cpu_setup() for setting the NUMA to CPU mapping for DeviceTree platforms. Signed-off-by: Saurabh Sengar <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 222408c commit 85900d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/kernel/devicetree.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <asm/pci_x86.h>
2525
#include <asm/setup.h>
2626
#include <asm/i8259.h>
27+
#include <asm/numa.h>
2728
#include <asm/prom.h>
2829

2930
__initdata u64 initial_dtb;
@@ -137,6 +138,7 @@ static void __init dtb_cpu_setup(void)
137138
continue;
138139
}
139140
topology_register_apic(apic_id, CPU_ACPIID_INVALID, true);
141+
set_apicid_to_node(apic_id, of_node_to_nid(dn));
140142
}
141143
}
142144

0 commit comments

Comments
 (0)