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

x86: clean up max_pfn_mapped usage - 64-bit

on 64-bit we only get valid max_pfn_mapped after init_memory_mapping().
Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 6af61a76
...@@ -55,16 +55,12 @@ unsigned long __init e820_end_of_ram(void) ...@@ -55,16 +55,12 @@ unsigned long __init e820_end_of_ram(void)
last_pfn = find_max_pfn_with_active_regions(); last_pfn = find_max_pfn_with_active_regions();
if (last_pfn > max_pfn_mapped) if (last_pfn > MAXMEM>>PAGE_SHIFT)
max_pfn_mapped = last_pfn; last_pfn = MAXMEM>>PAGE_SHIFT;
if (max_pfn_mapped > MAXMEM>>PAGE_SHIFT)
max_pfn_mapped = MAXMEM>>PAGE_SHIFT;
if (last_pfn > end_user_pfn) if (last_pfn > end_user_pfn)
last_pfn = end_user_pfn; last_pfn = end_user_pfn;
if (last_pfn > max_pfn_mapped)
last_pfn = max_pfn_mapped;
printk(KERN_INFO "max_pfn_mapped = %lu\n", max_pfn_mapped); printk(KERN_INFO "last_pfn = %lu\n", last_pfn);
return last_pfn; return last_pfn;
} }
...@@ -109,10 +105,6 @@ static int __init e820_find_active_region(const struct e820entry *ei, ...@@ -109,10 +105,6 @@ static int __init e820_find_active_region(const struct e820entry *ei,
if (*ei_startpfn >= *ei_endpfn) if (*ei_startpfn >= *ei_endpfn)
return 0; return 0;
/* Check if max_pfn_mapped should be updated */
if (ei->type != E820_RAM && *ei_endpfn > max_pfn_mapped)
max_pfn_mapped = *ei_endpfn;
/* Skip if map is outside the node */ /* Skip if map is outside the node */
if (ei->type != E820_RAM || *ei_endpfn <= start_pfn || if (ei->type != E820_RAM || *ei_endpfn <= start_pfn ||
*ei_startpfn >= last_pfn) *ei_startpfn >= last_pfn)
...@@ -229,7 +221,6 @@ static int __init parse_memmap_opt(char *p) ...@@ -229,7 +221,6 @@ static int __init parse_memmap_opt(char *p)
saved_max_pfn = e820_end_of_ram(); saved_max_pfn = e820_end_of_ram();
remove_all_active_ranges(); remove_all_active_ranges();
#endif #endif
max_pfn_mapped = 0;
e820.nr_map = 0; e820.nr_map = 0;
userdef = 1; userdef = 1;
return 0; return 0;
......
...@@ -396,7 +396,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -396,7 +396,7 @@ void __init setup_arch(char **cmdline_p)
check_efer(); check_efer();
max_pfn_mapped = init_memory_mapping(0, (max_pfn_mapped << PAGE_SHIFT)); max_pfn_mapped = init_memory_mapping(0, (end_pfn << PAGE_SHIFT));
if (efi_enabled) if (efi_enabled)
efi_init(); efi_init();
......
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