summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/setup.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-09-12 18:49:24 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-12 19:49:55 +0200
commit0b07e984fc7a51b1a7c75e1bfdcf59d1ad065353 (patch)
tree84477039c897553359694020e767638a830f4f15 /arch/x86_64/kernel/setup.c
parent[PATCH] x86-64: White space and comment fixes for smp_call_function_single (diff)
downloadlinux-0b07e984fc7a51b1a7c75e1bfdcf59d1ad065353.tar.xz
linux-0b07e984fc7a51b1a7c75e1bfdcf59d1ad065353.zip
[PATCH] x86-64: Don't assign CPU numbers in SRAT parsing
Do that later when the CPU boots. SRAT just stores the APIC<->Node mapping node. This fixes problems on systems where the order of SRAT entries does not match the MADT. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/setup.c')
-rw-r--r--arch/x86_64/kernel/setup.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 9aec524be3eb..976ebcf96f3e 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -765,6 +765,7 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
int cpu = smp_processor_id();
int node = 0;
unsigned bits;
+ unsigned apicid = phys_proc_id[cpu];
bits = 0;
while ((1 << bits) < c->x86_num_cores)
@@ -777,15 +778,19 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
#ifdef CONFIG_NUMA
/* When an ACPI SRAT table is available use the mappings from SRAT
- instead. */
- if (acpi_numa <= 0) {
- node = phys_proc_id[cpu];
- if (!node_online(node))
- node = first_node(node_online_map);
- cpu_to_node[cpu] = node;
- } else {
- node = cpu_to_node[cpu];
+ instead. */
+ node = phys_proc_id[cpu];
+ if (acpi_numa > 0) {
+ if (apicid_to_node[apicid] != NUMA_NO_NODE)
+ node = apicid_to_node[apicid];
+ else
+ printk(KERN_ERR
+ "SRAT: Didn't specify node for CPU %d(%d)\n",
+ cpu, apicid);
}
+ if (!node_online(node))
+ node = first_node(node_online_map);
+ cpu_to_node[cpu] = node;
#endif
printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n",