From: H. Peter Anvin Date: Fri, 15 Feb 2013 17:25:08 +0000 (-0800) Subject: Merge branch 'x86/mm2' into x86/mm X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0da3e7f526fde7a6522a3038b7ce609fc50f6707;p=linux-beck.git Merge branch 'x86/mm2' into x86/mm x86/mm2 is testing out fine, but has developed conflicts with x86/mm due to patches in adjacent code. Merge them so we can drop x86/mm2 and have a unified branch. Resolved Conflicts: arch/x86/kernel/setup.c --- 0da3e7f526fde7a6522a3038b7ce609fc50f6707 diff --cc arch/x86/kernel/setup.c index 0aebd776018e,be6e435cfc05..878cf1d326e5 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@@ -708,8 -747,27 +744,29 @@@ static void __init trim_bios_range(void sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); } + /* called before trim_bios_range() to spare extra sanitize */ + static void __init e820_add_kernel_range(void) + { + u64 start = __pa_symbol(_text); + u64 size = __pa_symbol(_end) - start; + + /* + * Complain if .text .data and .bss are not marked as E820_RAM and + * attempt to fix it by adding the range. We may have a confused BIOS, + * or the user may have used memmap=exactmap or memmap=xxM$yyM to + * exclude kernel range. If we really are running on top non-RAM, + * we will crash later anyways. + */ + if (e820_all_mapped(start, start + size, E820_RAM)) + return; + + pr_warn(".text .data .bss are not marked as E820_RAM!\n"); + e820_remove_range(start, size, E820_RAM, 0); + e820_add_region(start, size, E820_RAM); + } + +static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10; + static int __init parse_reservelow(char *p) { unsigned long long size; @@@ -985,42 -1052,21 +1056,22 @@@ void __init setup_arch(char **cmdline_p setup_bios_corruption_check(); #endif + #ifdef CONFIG_X86_32 printk(KERN_DEBUG "initial memory mapped: [mem 0x00000000-%#010lx]\n", (max_pfn_mapped< max_low_pfn) { - int i; - unsigned long start, end; - unsigned long start_pfn, end_pfn; - - for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, - NULL) { + init_mem_mapping(); - end = PFN_PHYS(end_pfn); - if (end <= (1UL<<32)) - continue; + early_trap_pf_init(); - start = PFN_PHYS(start_pfn); - max_pfn_mapped = init_memory_mapping( - max((1UL<<32), start), end); - } + setup_real_mode(); - /* can we preseve max_low_pfn ?*/ - max_low_pfn = max_pfn; - } - #endif memblock.current_limit = get_max_mapped(); dma_contiguous_reserve(0);