diff options
-rw-r--r-- | arch/x86/include/asm/acpi.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 5 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 4 | ||||
-rw-r--r-- | arch/x86/mm/srat_64.c | 28 | ||||
-rw-r--r-- | drivers/acpi/numa.c | 10 |
5 files changed, 33 insertions, 15 deletions
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index 4518dc500903..e3d4a0daff57 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h | |||
@@ -158,6 +158,7 @@ struct bootnode; | |||
158 | 158 | ||
159 | #ifdef CONFIG_ACPI_NUMA | 159 | #ifdef CONFIG_ACPI_NUMA |
160 | extern int acpi_numa; | 160 | extern int acpi_numa; |
161 | extern int acpi_get_nodes(struct bootnode *physnodes); | ||
161 | extern int acpi_scan_nodes(unsigned long start, unsigned long end); | 162 | extern int acpi_scan_nodes(unsigned long start, unsigned long end); |
162 | #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) | 163 | #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) |
163 | extern void acpi_fake_nodes(const struct bootnode *fake_nodes, | 164 | extern void acpi_fake_nodes(const struct bootnode *fake_nodes, |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index fda0032c25c6..f89141982702 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -938,11 +938,12 @@ void __init setup_arch(char **cmdline_p) | |||
938 | /* | 938 | /* |
939 | * Parse SRAT to discover nodes. | 939 | * Parse SRAT to discover nodes. |
940 | */ | 940 | */ |
941 | acpi_numa_init(); | 941 | acpi = acpi_numa_init(); |
942 | #endif | 942 | #endif |
943 | 943 | ||
944 | #ifdef CONFIG_K8_NUMA | 944 | #ifdef CONFIG_K8_NUMA |
945 | k8 = !k8_numa_init(0, max_pfn); | 945 | if (!acpi) |
946 | k8 = !k8_numa_init(0, max_pfn); | ||
946 | #endif | 947 | #endif |
947 | 948 | ||
948 | initmem_init(0, max_pfn, acpi, k8); | 949 | initmem_init(0, max_pfn, acpi, k8); |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index dad5f42dd359..d1a3d94efc8e 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -540,8 +540,8 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn, | |||
540 | #endif | 540 | #endif |
541 | 541 | ||
542 | #ifdef CONFIG_ACPI_NUMA | 542 | #ifdef CONFIG_ACPI_NUMA |
543 | if (!numa_off && !acpi_scan_nodes(start_pfn << PAGE_SHIFT, | 543 | if (!numa_off && acpi && !acpi_scan_nodes(start_pfn << PAGE_SHIFT, |
544 | last_pfn << PAGE_SHIFT)) | 544 | last_pfn << PAGE_SHIFT)) |
545 | return; | 545 | return; |
546 | nodes_clear(node_possible_map); | 546 | nodes_clear(node_possible_map); |
547 | nodes_clear(node_online_map); | 547 | nodes_clear(node_online_map); |
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index dbb5381f7b3b..891cbe65b2d5 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
@@ -290,8 +290,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) | |||
290 | 290 | ||
291 | printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm, | 291 | printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm, |
292 | start, end); | 292 | start, end); |
293 | e820_register_active_regions(node, start >> PAGE_SHIFT, | ||
294 | end >> PAGE_SHIFT); | ||
295 | 293 | ||
296 | if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) { | 294 | if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) { |
297 | update_nodes_add(node, start, end); | 295 | update_nodes_add(node, start, end); |
@@ -338,6 +336,19 @@ static int __init nodes_cover_memory(const struct bootnode *nodes) | |||
338 | 336 | ||
339 | void __init acpi_numa_arch_fixup(void) {} | 337 | void __init acpi_numa_arch_fixup(void) {} |
340 | 338 | ||
339 | int __init acpi_get_nodes(struct bootnode *physnodes) | ||
340 | { | ||
341 | int i; | ||
342 | int ret = 0; | ||
343 | |||
344 | for_each_node_mask(i, nodes_parsed) { | ||
345 | physnodes[ret].start = nodes[i].start; | ||
346 | physnodes[ret].end = nodes[i].end; | ||
347 | ret++; | ||
348 | } | ||
349 | return ret; | ||
350 | } | ||
351 | |||
341 | /* Use the information discovered above to actually set up the nodes. */ | 352 | /* Use the information discovered above to actually set up the nodes. */ |
342 | int __init acpi_scan_nodes(unsigned long start, unsigned long end) | 353 | int __init acpi_scan_nodes(unsigned long start, unsigned long end) |
343 | { | 354 | { |
@@ -350,11 +361,6 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
350 | for (i = 0; i < MAX_NUMNODES; i++) | 361 | for (i = 0; i < MAX_NUMNODES; i++) |
351 | cutoff_node(i, start, end); | 362 | cutoff_node(i, start, end); |
352 | 363 | ||
353 | if (!nodes_cover_memory(nodes)) { | ||
354 | bad_srat(); | ||
355 | return -1; | ||
356 | } | ||
357 | |||
358 | memnode_shift = compute_hash_shift(node_memblk_range, num_node_memblks, | 364 | memnode_shift = compute_hash_shift(node_memblk_range, num_node_memblks, |
359 | memblk_nodeid); | 365 | memblk_nodeid); |
360 | if (memnode_shift < 0) { | 366 | if (memnode_shift < 0) { |
@@ -364,6 +370,14 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
364 | return -1; | 370 | return -1; |
365 | } | 371 | } |
366 | 372 | ||
373 | for_each_node_mask(i, nodes_parsed) | ||
374 | e820_register_active_regions(i, nodes[i].start >> PAGE_SHIFT, | ||
375 | nodes[i].end >> PAGE_SHIFT); | ||
376 | if (!nodes_cover_memory(nodes)) { | ||
377 | bad_srat(); | ||
378 | return -1; | ||
379 | } | ||
380 | |||
367 | /* Account for nodes with cpus and no memory */ | 381 | /* Account for nodes with cpus and no memory */ |
368 | nodes_or(node_possible_map, nodes_parsed, cpu_nodes_parsed); | 382 | nodes_or(node_possible_map, nodes_parsed, cpu_nodes_parsed); |
369 | 383 | ||
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index 202dd0c976a3..2be2fb66204e 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c | |||
@@ -283,22 +283,24 @@ acpi_table_parse_srat(enum acpi_srat_type id, | |||
283 | 283 | ||
284 | int __init acpi_numa_init(void) | 284 | int __init acpi_numa_init(void) |
285 | { | 285 | { |
286 | int ret = 0; | ||
287 | |||
286 | /* SRAT: Static Resource Affinity Table */ | 288 | /* SRAT: Static Resource Affinity Table */ |
287 | if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { | 289 | if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { |
288 | acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY, | 290 | acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY, |
289 | acpi_parse_x2apic_affinity, NR_CPUS); | 291 | acpi_parse_x2apic_affinity, NR_CPUS); |
290 | acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, | 292 | acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, |
291 | acpi_parse_processor_affinity, NR_CPUS); | 293 | acpi_parse_processor_affinity, NR_CPUS); |
292 | acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY, | 294 | ret = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY, |
293 | acpi_parse_memory_affinity, | 295 | acpi_parse_memory_affinity, |
294 | NR_NODE_MEMBLKS); | 296 | NR_NODE_MEMBLKS); |
295 | } | 297 | } |
296 | 298 | ||
297 | /* SLIT: System Locality Information Table */ | 299 | /* SLIT: System Locality Information Table */ |
298 | acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); | 300 | acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); |
299 | 301 | ||
300 | acpi_numa_arch_fixup(); | 302 | acpi_numa_arch_fixup(); |
301 | return 0; | 303 | return ret; |
302 | } | 304 | } |
303 | 305 | ||
304 | int acpi_get_pxm(acpi_handle h) | 306 | int acpi_get_pxm(acpi_handle h) |