>From 1ec83ca8dcc85bc5810bf7407d470a7261be1372 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 768 MiB Keep the crash kernel address below 768 MiB. This makes it work on 32 bits even if the vmalloc= setting is adjusted slightly. For 64 bits, we should be able to increase this substantially once a hard-coded 896 MiB limit in kexec-tools is fixed. Signed-off-by: H. Peter Anvin Cc: Vivek Goyal Cc: Stanislaw Gruszka Cc: Yinghai Lu LKML-Reference: <20101217195035.GE14502@redhat.com> --- arch/x86/kernel/setup.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 21c6746..2b7f5ab 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -501,7 +501,14 @@ 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. This should be sufficient + * to load a 32-bit kernel even if the vmalloc limit is modified + * (within reason.) This can be increased on 64 bits once kexec-tools + * is fixed. + */ +#define CRASH_KERNEL_ADDR_MAX (768 << 20) + static void __init reserve_crashkernel(void) { unsigned long long total_mem; @@ -520,10 +527,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