diff options
-rw-r--r-- | arch/x86_64/mm/srat.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c index 7ac8ff333e84..acdf03e19146 100644 --- a/arch/x86_64/mm/srat.c +++ b/arch/x86_64/mm/srat.c | |||
@@ -470,10 +470,13 @@ static int __init find_node_by_addr(unsigned long addr) | |||
470 | */ | 470 | */ |
471 | void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes) | 471 | void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes) |
472 | { | 472 | { |
473 | int i; | 473 | int i, j; |
474 | int fake_node_to_pxm_map[MAX_NUMNODES] = { | 474 | int fake_node_to_pxm_map[MAX_NUMNODES] = { |
475 | [0 ... MAX_NUMNODES-1] = PXM_INVAL | 475 | [0 ... MAX_NUMNODES-1] = PXM_INVAL |
476 | }; | 476 | }; |
477 | unsigned char fake_apicid_to_node[MAX_LOCAL_APIC] = { | ||
478 | [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE | ||
479 | }; | ||
477 | 480 | ||
478 | printk(KERN_INFO "Faking PXM affinity for fake nodes on real " | 481 | printk(KERN_INFO "Faking PXM affinity for fake nodes on real " |
479 | "topology.\n"); | 482 | "topology.\n"); |
@@ -487,9 +490,17 @@ void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes) | |||
487 | if (pxm == PXM_INVAL) | 490 | if (pxm == PXM_INVAL) |
488 | continue; | 491 | continue; |
489 | fake_node_to_pxm_map[i] = pxm; | 492 | fake_node_to_pxm_map[i] = pxm; |
493 | /* | ||
494 | * For each apicid_to_node mapping that exists for this real | ||
495 | * node, it must now point to the fake node ID. | ||
496 | */ | ||
497 | for (j = 0; j < MAX_LOCAL_APIC; j++) | ||
498 | if (apicid_to_node[j] == nid) | ||
499 | fake_apicid_to_node[j] = i; | ||
490 | } | 500 | } |
491 | for (i = 0; i < num_nodes; i++) | 501 | for (i = 0; i < num_nodes; i++) |
492 | __acpi_map_pxm_to_node(fake_node_to_pxm_map[i], i); | 502 | __acpi_map_pxm_to_node(fake_node_to_pxm_map[i], i); |
503 | memcpy(apicid_to_node, fake_apicid_to_node, sizeof(apicid_to_node)); | ||
493 | 504 | ||
494 | nodes_clear(nodes_parsed); | 505 | nodes_clear(nodes_parsed); |
495 | for (i = 0; i < num_nodes; i++) | 506 | for (i = 0; i < num_nodes; i++) |