Merge branch 'x86/numa' into x86/urgent
authorIngo Molnar <mingo@elte.hu>
Mon, 10 Jan 2011 08:35:57 +0000 (09:35 +0100)
committerIngo Molnar <mingo@elte.hu>
Mon, 10 Jan 2011 08:36:07 +0000 (09:36 +0100)
Merge reason: Topic is ready for upstream.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
1  2 
arch/x86/mm/srat_64.c

diff --combined arch/x86/mm/srat_64.c
@@@ -134,10 -134,6 +134,10 @@@ acpi_numa_x2apic_affinity_init(struct a
        }
  
        apic_id = pa->apic_id;
 +      if (apic_id >= MAX_LOCAL_APIC) {
 +              printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node);
 +              return;
 +      }
        apicid_to_node[apic_id] = node;
        node_set(node, cpu_nodes_parsed);
        acpi_numa = 1;
@@@ -172,12 -168,6 +172,12 @@@ acpi_numa_processor_affinity_init(struc
                apic_id = (pa->apic_id << 8) | pa->local_sapic_eid;
        else
                apic_id = pa->apic_id;
 +
 +      if (apic_id >= MAX_LOCAL_APIC) {
 +              printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u skipped apicid that is too big\n", pxm, apic_id, node);
 +              return;
 +      }
 +
        apicid_to_node[apic_id] = node;
        node_set(node, cpu_nodes_parsed);
        acpi_numa = 1;
@@@ -349,18 -339,19 +349,19 @@@ static int __init nodes_cover_memory(co
  
  void __init acpi_numa_arch_fixup(void) {}
  
- int __init acpi_get_nodes(struct bootnode *physnodes)
+ #ifdef CONFIG_NUMA_EMU
+ void __init acpi_get_nodes(struct bootnode *physnodes, unsigned long start,
+                               unsigned long end)
  {
        int i;
-       int ret = 0;
  
        for_each_node_mask(i, nodes_parsed) {
-               physnodes[ret].start = nodes[i].start;
-               physnodes[ret].end = nodes[i].end;
-               ret++;
+               cutoff_node(i, start, end);
+               physnodes[i].start = nodes[i].start;
+               physnodes[i].end = nodes[i].end;
        }
-       return ret;
  }
+ #endif /* CONFIG_NUMA_EMU */
  
  /* Use the information discovered above to actually set up the nodes. */
  int __init acpi_scan_nodes(unsigned long start, unsigned long end)
@@@ -505,8 -496,6 +506,6 @@@ void __init acpi_fake_nodes(const struc
  {
        int i, j;
  
-       printk(KERN_INFO "Faking PXM affinity for fake nodes on real "
-                        "topology.\n");
        for (i = 0; i < num_nodes; i++) {
                int nid, pxm;
  
                            fake_apicid_to_node[j] == NUMA_NO_NODE)
                                fake_apicid_to_node[j] = i;
        }
+       /*
+        * If there are apicid-to-node mappings for physical nodes that do not
+        * have a corresponding emulated node, it should default to a guaranteed
+        * value.
+        */
+       for (i = 0; i < MAX_LOCAL_APIC; i++)
+               if (apicid_to_node[i] != NUMA_NO_NODE &&
+                   fake_apicid_to_node[i] == NUMA_NO_NODE)
+                       fake_apicid_to_node[i] = 0;
        for (i = 0; i < num_nodes; i++)
                __acpi_map_pxm_to_node(fake_node_to_pxm_map[i], i);
        memcpy(apicid_to_node, fake_apicid_to_node, sizeof(apicid_to_node));