Commit 05961523 authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar

x86, 32-bit: change propagate_e820_map() back to find_max_pfn()

we don't need to call memory_present that early.
numa and sparse will call memory_present later and might
even fail, it will call memory_present for the full range.

also for sparse it will call alloc_bootmem ... before we set up bootmem.
Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b66cd720
...@@ -210,7 +210,7 @@ void __init init_iomem_resources(struct resource *code_resource, ...@@ -210,7 +210,7 @@ void __init init_iomem_resources(struct resource *code_resource,
/* /*
* Find the highest page frame number we have available * Find the highest page frame number we have available
*/ */
void __init propagate_e820_map(void) void __init find_max_pfn(void)
{ {
int i; int i;
...@@ -227,7 +227,6 @@ void __init propagate_e820_map(void) ...@@ -227,7 +227,6 @@ void __init propagate_e820_map(void)
continue; continue;
if (end > max_pfn) if (end > max_pfn)
max_pfn = end; max_pfn = end;
memory_present(0, start, end);
} }
} }
...@@ -361,7 +360,7 @@ static int __init parse_memmap(char *arg) ...@@ -361,7 +360,7 @@ static int __init parse_memmap(char *arg)
* size before original memory map is * size before original memory map is
* reset. * reset.
*/ */
propagate_e820_map(); find_max_pfn();
saved_max_pfn = max_pfn; saved_max_pfn = max_pfn;
#endif #endif
e820.nr_map = 0; e820.nr_map = 0;
......
...@@ -730,10 +730,10 @@ void __init setup_arch(char **cmdline_p) ...@@ -730,10 +730,10 @@ void __init setup_arch(char **cmdline_p)
efi_init(); efi_init();
/* update e820 for memory not covered by WB MTRRs */ /* update e820 for memory not covered by WB MTRRs */
propagate_e820_map(); find_max_pfn();
mtrr_bp_init(); mtrr_bp_init();
if (mtrr_trim_uncached_memory(max_pfn)) if (mtrr_trim_uncached_memory(max_pfn))
propagate_e820_map(); find_max_pfn();
max_low_pfn = setup_memory(); max_low_pfn = setup_memory();
......
...@@ -120,7 +120,7 @@ int __init get_memcfg_numa_flat(void) ...@@ -120,7 +120,7 @@ int __init get_memcfg_numa_flat(void)
printk("NUMA - single node, flat memory mode\n"); printk("NUMA - single node, flat memory mode\n");
/* Run the memory configuration and find the top of memory. */ /* Run the memory configuration and find the top of memory. */
propagate_e820_map(); find_max_pfn();
node_start_pfn[0] = 0; node_start_pfn[0] = 0;
node_end_pfn[0] = max_pfn; node_end_pfn[0] = max_pfn;
memory_present(0, 0, max_pfn); memory_present(0, 0, max_pfn);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
extern void setup_memory_map(void); extern void setup_memory_map(void);
extern void finish_e820_parsing(void); extern void finish_e820_parsing(void);
extern void propagate_e820_map(void); extern void find_max_pfn(void);
extern void register_bootmem_low_pages(unsigned long max_low_pfn); extern void register_bootmem_low_pages(unsigned long max_low_pfn);
extern void limit_regions(unsigned long long size); extern void limit_regions(unsigned long long size);
extern void init_iomem_resources(struct resource *code_resource, extern void init_iomem_resources(struct resource *code_resource,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment