aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/setup.c
diff options
context:
space:
mode:
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)
765 int cpu = smp_processor_id(); 765 int cpu = smp_processor_id();
766 int node = 0; 766 int node = 0;
767 unsigned bits; 767 unsigned bits;
768 unsigned apicid = phys_proc_id[cpu];
768 769
769 bits = 0; 770 bits = 0;
770 while ((1 << bits) < c->x86_num_cores) 771 while ((1 << bits) < c->x86_num_cores)
@@ -777,15 +778,19 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
777 778
778#ifdef CONFIG_NUMA 779#ifdef CONFIG_NUMA
779 /* When an ACPI SRAT table is available use the mappings from SRAT 780 /* When an ACPI SRAT table is available use the mappings from SRAT
780 instead. */ 781 instead. */
781 if (acpi_numa <= 0) { 782 node = phys_proc_id[cpu];
782 node = phys_proc_id[cpu]; 783 if (acpi_numa > 0) {
783 if (!node_online(node)) 784 if (apicid_to_node[apicid] != NUMA_NO_NODE)
784 node = first_node(node_online_map); 785 node = apicid_to_node[apicid];
785 cpu_to_node[cpu] = node; 786 else
786 } else { 787 printk(KERN_ERR
787 node = cpu_to_node[cpu]; 788 "SRAT: Didn't specify node for CPU %d(%d)\n",
789 cpu, apicid);
788 } 790 }
791 if (!node_online(node))
792 node = first_node(node_online_map);
793 cpu_to_node[cpu] = node;
789#endif 794#endif
790 795
791 printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n", 796 printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n",