diff options
Diffstat (limited to 'arch/x86_64/kernel/machine_kexec.c')
-rw-r--r-- | arch/x86_64/kernel/machine_kexec.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86_64/kernel/machine_kexec.c index 106076b370fc..2e94c072d84a 100644 --- a/arch/x86_64/kernel/machine_kexec.c +++ b/arch/x86_64/kernel/machine_kexec.c | |||
@@ -226,3 +226,31 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
226 | rnk = (relocate_new_kernel_t) control_code_buffer; | 226 | rnk = (relocate_new_kernel_t) control_code_buffer; |
227 | (*rnk)(page_list, control_code_buffer, image->start, start_pgtable); | 227 | (*rnk)(page_list, control_code_buffer, image->start, start_pgtable); |
228 | } | 228 | } |
229 | |||
230 | /* crashkernel=size@addr specifies the location to reserve for | ||
231 | * a crash kernel. By reserving this memory we guarantee | ||
232 | * that linux never set's it up as a DMA target. | ||
233 | * Useful for holding code to do something appropriate | ||
234 | * after a kernel panic. | ||
235 | */ | ||
236 | static int __init setup_crashkernel(char *arg) | ||
237 | { | ||
238 | unsigned long size, base; | ||
239 | char *p; | ||
240 | if (!arg) | ||
241 | return -EINVAL; | ||
242 | size = memparse(arg, &p); | ||
243 | if (arg == p) | ||
244 | return -EINVAL; | ||
245 | if (*p == '@') { | ||
246 | base = memparse(p+1, &p); | ||
247 | /* FIXME: Do I want a sanity check to validate the | ||
248 | * memory range? Yes you do, but it's too early for | ||
249 | * e820 -AK */ | ||
250 | crashk_res.start = base; | ||
251 | crashk_res.end = base + size - 1; | ||
252 | } | ||
253 | return 0; | ||
254 | } | ||
255 | early_param("crashkernel", setup_crashkernel); | ||
256 | |||