aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/setup_64.c')
-rw-r--r--arch/x86/kernel/setup_64.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 8345c3b12f05..a49f5f734a5e 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -220,29 +220,35 @@ static inline void copy_edd(void)
220#ifdef CONFIG_KEXEC 220#ifdef CONFIG_KEXEC
221static void __init reserve_crashkernel(void) 221static void __init reserve_crashkernel(void)
222{ 222{
223 unsigned long long free_mem; 223 unsigned long long total_mem;
224 unsigned long long crash_size, crash_base; 224 unsigned long long crash_size, crash_base;
225 int ret; 225 int ret;
226 226
227 free_mem = 227 total_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT;
228 ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT;
229 228
230 ret = parse_crashkernel(boot_command_line, free_mem, 229 ret = parse_crashkernel(boot_command_line, total_mem,
231 &crash_size, &crash_base); 230 &crash_size, &crash_base);
232 if (ret == 0 && crash_size) { 231 if (ret == 0 && crash_size) {
233 if (crash_base > 0) { 232 if (crash_base <= 0) {
234 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
235 "for crashkernel (System RAM: %ldMB)\n",
236 (unsigned long)(crash_size >> 20),
237 (unsigned long)(crash_base >> 20),
238 (unsigned long)(free_mem >> 20));
239 crashk_res.start = crash_base;
240 crashk_res.end = crash_base + crash_size - 1;
241 reserve_bootmem(crash_base, crash_size,
242 BOOTMEM_DEFAULT);
243 } else
244 printk(KERN_INFO "crashkernel reservation failed - " 233 printk(KERN_INFO "crashkernel reservation failed - "
245 "you have to specify a base address\n"); 234 "you have to specify a base address\n");
235 return;
236 }
237
238 if (reserve_bootmem(crash_base, crash_size,
239 BOOTMEM_EXCLUSIVE) < 0) {
240 printk(KERN_INFO "crashkernel reservation failed - "
241 "memory is in use\n");
242 return;
243 }
244
245 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
246 "for crashkernel (System RAM: %ldMB)\n",
247 (unsigned long)(crash_size >> 20),
248 (unsigned long)(crash_base >> 20),
249 (unsigned long)(total_mem >> 20));
250 crashk_res.start = crash_base;
251 crashk_res.end = crash_base + crash_size - 1;
246 } 252 }
247} 253}
248#else 254#else