aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/kernel/setup.c29
-rw-r--r--arch/x86/kernel/setup_64.c36
2 files changed, 39 insertions, 26 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index af10db90a554..18a5baf2cbad 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -140,19 +140,26 @@ static void __init reserve_crashkernel(void)
140 ret = parse_crashkernel(boot_command_line, free_mem, 140 ret = parse_crashkernel(boot_command_line, free_mem,
141 &crash_size, &crash_base); 141 &crash_size, &crash_base);
142 if (ret == 0 && crash_size) { 142 if (ret == 0 && crash_size) {
143 if (crash_base > 0) { 143 if (crash_base <= 0) {
144 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
145 "for crashkernel (System RAM: %ldMB)\n",
146 (unsigned long)(crash_size >> 20),
147 (unsigned long)(crash_base >> 20),
148 (unsigned long)(free_mem >> 20));
149 crashk_res.start = crash_base;
150 crashk_res.end = crash_base + crash_size - 1;
151 reserve_bootmem(crash_base, crash_size,
152 BOOTMEM_DEFAULT);
153 } else
154 printk(KERN_INFO "crashkernel reservation failed - " 144 printk(KERN_INFO "crashkernel reservation failed - "
155 "you have to specify a base address\n"); 145 "you have to specify a base address\n");
146 return;
147 }
148
149 if (reserve_bootmem(crash_base, crash_size,
150 BOOTMEM_EXCLUSIVE) < 0) {
151 printk(KERN_INFO "crashkernel reservation failed - "
152 "memory is in use\n");
153 return;
154 }
155
156 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
157 "for crashkernel (System RAM: %ldMB)\n",
158 (unsigned long)(crash_size >> 20),
159 (unsigned long)(crash_base >> 20),
160 (unsigned long)(free_mem >> 20));
161 crashk_res.start = crash_base;
162 crashk_res.end = crash_base + crash_size - 1;
156 } 163 }
157} 164}
158#else 165#else
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