>From 3f060a5da7498cd725ef41cb67f8ced362a81729 Mon Sep 17 00:00:00 2001 From: H. Peter Anvin Date: Thu, 16 Dec 2010 19:20:41 -0800 Subject: [PATCH] x86, kexec: Limit the crashkernel address to 512 MiB We used to only map a maximum of 512 MiB of low memory for the kernel initialization; this was enforced by the bzImage decompressor. To make sure we do not run afoul of this limitation, keep the crash kernel below the 512 MiB mark. This also adds a comfortable margin in case the user is running with a nonstandard vmalloc= setting. Signed-off-by: H. Peter Anvin Cc: Vivek Goyal Cc: Stanislaw Gruszka Cc: Yinghai Lu LKML-Reference: <4D09958D.2040907@kernel.org> --- arch/x86/kernel/setup.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 21c6746..7fb9abb 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -501,7 +501,12 @@ static inline unsigned long long get_total_mem(void) return total << PAGE_SHIFT; } -#define DEFAULT_BZIMAGE_ADDR_MAX 0x37FFFFFF +/* + * Keep the crash kernel below this limit. Not all bzImage kernels + * can be loaded above this address. + */ +#define CRASH_KERNEL_ADDR_MAX (512 << 20) + static void __init reserve_crashkernel(void) { unsigned long long total_mem; @@ -520,10 +525,10 @@ static void __init reserve_crashkernel(void) const unsigned long long alignment = 16<<20; /* 16M */ /* - * kexec want bzImage is below DEFAULT_BZIMAGE_ADDR_MAX + * kexec want bzImage is below CRASH_KERNEL_ADDR_MAX */ crash_base = memblock_find_in_range(alignment, - DEFAULT_BZIMAGE_ADDR_MAX, crash_size, alignment); + CRASH_KERNEL_ADDR_MAX, crash_size, alignment); if (crash_base == MEMBLOCK_ERROR) { pr_info("crashkernel reservation failed - No suitable area found.\n"); -- 1.7.2.3