From: Dave Hansen Add a ton of e820 debug printks. Signed-off-by: Andrew Morton --- arch/i386/kernel/setup.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff -puN arch/i386/kernel/setup.c~x86-e820-debugging arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c~x86-e820-debugging +++ a/arch/i386/kernel/setup.c @@ -346,11 +346,13 @@ static void __init probe_roms(void) } } +static void __init print_memory_map(char *who); static void __init limit_regions(unsigned long long size) { unsigned long long current_addr = 0; int i; + print_memory_map("limit_regions start"); if (efi_enabled) { efi_memory_desc_t *md; void *p; @@ -387,8 +389,10 @@ static void __init limit_regions(unsigne e820.nr_map = i + 1; e820.map[i].size -= current_addr - size; } + print_memory_map("limit_regions endfor"); return; } + print_memory_map("limit_regions endfunc"); } void __init add_memory_region(unsigned long long start, @@ -501,17 +505,21 @@ int __init sanitize_e820_map(struct e820 ____________________33__ ______________________4_ */ - + printk("sanitize start\n"); /* if there's only one memory region, don't bother */ - if (*pnr_map < 2) + if (*pnr_map < 2) { + printk("sanitize bail 0\n"); return -1; + } old_nr = *pnr_map; /* bail out if we find any unreasonable addresses in bios map */ for (i=0; isize; unsigned long long end = start + size; unsigned long type = biosmap->type; + printk("copy_e820_map() start: %016Lx size: %016Lx end: %016Lx type: %ld\n", start, size, end, type); /* Overflow in 64 bits? Ignore the memory map. */ if (start > end) @@ -645,11 +655,17 @@ int __init copy_e820_map(struct e820entr * Not right. Fix it up. */ if (type == E820_RAM) { + printk("copy_e820_map() type is E820_RAM\n"); if (start < 0x100000ULL && end > 0xA0000ULL) { - if (start < 0xA0000ULL) + printk("copy_e820_map() lies in range...\n"); + if (start < 0xA0000ULL) { + printk("copy_e820_map() start < 0xA0000ULL\n"); add_memory_region(start, 0xA0000ULL-start, type); - if (end <= 0x100000ULL) + } + if (end <= 0x100000ULL) { + printk("copy_e820_map() end <= 0x100000ULL\n"); continue; + } start = 0x100000ULL; size = end - start; } _