[PATCH] x86, kexec: Limit the crashkernel address to 768 MiB

From: H . Peter Anvin
Date: Thu Dec 16 2010 - 22:20:41 EST


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 <hpa@xxxxxxxxxxxxxxx>
Cc: Vivek Goyal <vgoyal@xxxxxxxxxx>
Cc: Stanislaw Gruszka <sgruszka@xxxxxxxxxx>
Cc: Yinghai Lu <yinghai@xxxxxxxxxx>
LKML-Reference: <20101217195035.GE14502@xxxxxxxxxx>
---
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


--------------060706070509000800080800--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/