diff options
author | Bob Picco <bob.picco@hp.com> | 2005-11-05 11:25:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-14 22:55:18 -0500 |
commit | d3ee871e63d0a0c70413dc0aa5534b8d6cd6ec37 (patch) | |
tree | 79114c735614c4811d02ac9ccc81f6c9798a73ec /arch/x86_64 | |
parent | 8893166ff8694f36655009aa9bf8e7f2e1c9339f (diff) |
[PATCH] x86_64: Fix sparse mem
Fix up booting with sparse mem enabled. Otherwise it would just
cause an early PANIC at boot.
Signed-off-by: Bob Picco <bob.picco@hp.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/setup.c | 3 | ||||
-rw-r--r-- | arch/x86_64/mm/numa.c | 18 |
2 files changed, 17 insertions, 4 deletions
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 40c77f6fe4b0..750e01dcbdf4 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -412,7 +412,6 @@ contig_initmem_init(unsigned long start_pfn, unsigned long end_pfn) | |||
412 | { | 412 | { |
413 | unsigned long bootmap_size, bootmap; | 413 | unsigned long bootmap_size, bootmap; |
414 | 414 | ||
415 | memory_present(0, start_pfn, end_pfn); | ||
416 | bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT; | 415 | bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT; |
417 | bootmap = find_e820_area(0, end_pfn<<PAGE_SHIFT, bootmap_size); | 416 | bootmap = find_e820_area(0, end_pfn<<PAGE_SHIFT, bootmap_size); |
418 | if (bootmap == -1L) | 417 | if (bootmap == -1L) |
@@ -659,8 +658,6 @@ void __init setup_arch(char **cmdline_p) | |||
659 | } | 658 | } |
660 | #endif | 659 | #endif |
661 | 660 | ||
662 | sparse_init(); | ||
663 | |||
664 | paging_init(); | 661 | paging_init(); |
665 | 662 | ||
666 | check_ioapic(); | 663 | check_ioapic(); |
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c index 629ff0621b3d..a828a01739cc 100644 --- a/arch/x86_64/mm/numa.c +++ b/arch/x86_64/mm/numa.c | |||
@@ -113,7 +113,6 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long en | |||
113 | start_pfn = start >> PAGE_SHIFT; | 113 | start_pfn = start >> PAGE_SHIFT; |
114 | end_pfn = end >> PAGE_SHIFT; | 114 | end_pfn = end >> PAGE_SHIFT; |
115 | 115 | ||
116 | memory_present(nodeid, start_pfn, end_pfn); | ||
117 | nodedata_phys = find_e820_area(start, end, pgdat_size); | 116 | nodedata_phys = find_e820_area(start, end, pgdat_size); |
118 | if (nodedata_phys == -1L) | 117 | if (nodedata_phys == -1L) |
119 | panic("Cannot find memory pgdat in node %d\n", nodeid); | 118 | panic("Cannot find memory pgdat in node %d\n", nodeid); |
@@ -285,9 +284,26 @@ unsigned long __init numa_free_all_bootmem(void) | |||
285 | return pages; | 284 | return pages; |
286 | } | 285 | } |
287 | 286 | ||
287 | #ifdef CONFIG_SPARSEMEM | ||
288 | static void __init arch_sparse_init(void) | ||
289 | { | ||
290 | int i; | ||
291 | |||
292 | for_each_online_node(i) | ||
293 | memory_present(i, node_start_pfn(i), node_end_pfn(i)); | ||
294 | |||
295 | sparse_init(); | ||
296 | } | ||
297 | #else | ||
298 | #define arch_sparse_init() do {} while (0) | ||
299 | #endif | ||
300 | |||
288 | void __init paging_init(void) | 301 | void __init paging_init(void) |
289 | { | 302 | { |
290 | int i; | 303 | int i; |
304 | |||
305 | arch_sparse_init(); | ||
306 | |||
291 | for_each_online_node(i) { | 307 | for_each_online_node(i) { |
292 | setup_node_zones(i); | 308 | setup_node_zones(i); |
293 | } | 309 | } |