Recover 1MB of kernel memory Noticed by Jan Beulich. When the kernel was moved from 1MB to 2MB in 2.6.17 the kernel reservation code wasn't adjusted and it still reserved starting with 1MB. This means 1MB always were lost. This patch fixes this by reserving only starting with _text. Signed-off-by: Andi Kleen --- arch/x86_64/kernel/e820.c | 2 +- arch/x86_64/kernel/setup.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) Index: linux/arch/x86_64/kernel/e820.c =================================================================== --- linux.orig/arch/x86_64/kernel/e820.c +++ linux/arch/x86_64/kernel/e820.c @@ -72,7 +72,7 @@ static inline int bad_addr(unsigned long } #endif /* kernel code */ - if (last >= HIGH_MEMORY && addr < __pa_symbol(&_end)) { + if (last >= __pa_symbol(&_text) && addr < __pa_symbol(&_end)) { *addrp = __pa_symbol(&_end); return 1; } Index: linux/arch/x86_64/kernel/setup.c =================================================================== --- linux.orig/arch/x86_64/kernel/setup.c +++ linux/arch/x86_64/kernel/setup.c @@ -347,8 +347,6 @@ static void discover_ebda(void) void __init setup_arch(char **cmdline_p) { - unsigned long kernel_end; - printk(KERN_INFO "Command line: %s\n", saved_command_line); ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); @@ -434,8 +432,8 @@ void __init setup_arch(char **cmdline_p) (table_end - table_start) << PAGE_SHIFT); /* reserve kernel */ - kernel_end = round_up(__pa_symbol(&_end),PAGE_SIZE); - reserve_bootmem_generic(HIGH_MEMORY, kernel_end - HIGH_MEMORY); + reserve_bootmem_generic(__pa_symbol(&_text), + __pa_symbol(&_end) - __pa_symbol(&_text)); /* * reserve physical page 0 - it's a special BIOS page on many boxes,