Re: [PATCH][4/4] kexec based dump: Minor cleanups

From: Hariprasad Nellitheertha
Date: Thu Oct 21 2004 - 06:02:55 EST


This patch moves some crashdump related calls out of machine_kexec so that we leave the core kexec code untouched.

Regards, Hari
Signed-off-by: Vivek Goyal <vgoyal@xxxxxxxxxx>
Signed-off-by: Hariprasad Nellitheertha <hari@xxxxxxxxxx>
---

linux-2.6.9-rc4-hari/arch/i386/kernel/machine_kexec.c | 10 ----------
linux-2.6.9-rc4-hari/kernel/crash.c | 9 +++++++++
2 files changed, 9 insertions(+), 10 deletions(-)

diff -puN arch/i386/kernel/machine_kexec.c~kd-cleanup arch/i386/kernel/machine_kexec.c
--- linux-2.6.9-rc4/arch/i386/kernel/machine_kexec.c~kd-cleanup 2004-10-21 15:11:05.000000000 +0530
+++ linux-2.6.9-rc4-hari/arch/i386/kernel/machine_kexec.c 2004-10-21 15:11:05.000000000 +0530
@@ -195,9 +195,6 @@ void machine_kexec(struct kimage *image)
unsigned long reboot_code_buffer;
relocate_new_kernel_t rnk;

- crash_dump_stop_cpus();
- crash_dump_save_registers();
-
/* Interrupts aren't acceptable while we reboot */
local_irq_disable();

@@ -208,13 +205,6 @@ void machine_kexec(struct kimage *image)
/* Set up an identity mapping for the reboot_code_buffer */
identity_map_page(reboot_code_buffer);

- /*
- * If we are here to do a crash dump, save the memory from
- * 0-640k before we copy over the kexec kernel image. Otherwise
- * our dump will show the wrong kernel entirely.
- */
- crash_relocate_mem();
-
/* copy it out */
memcpy((void *)reboot_code_buffer, relocate_new_kernel, relocate_new_kernel_size);

diff -puN kernel/crash.c~kd-cleanup kernel/crash.c
--- linux-2.6.9-rc4/kernel/crash.c~kd-cleanup 2004-10-21 15:11:05.000000000 +0530
+++ linux-2.6.9-rc4-hari/kernel/crash.c 2004-10-21 15:11:05.000000000 +0530
@@ -71,6 +71,15 @@ void __crash_machine_kexec(void)
if (image) {
crashed = 1;
printk(KERN_EMERG "kexec: opening parachute\n");
+ crash_dump_stop_cpus();
+ crash_dump_save_registers();
+
+ /* If we are here to do a crash dump, save the memory from
+ * 0-640k before we copy over the kexec kernel image. Otherwise
+ * our dump will show the wrong kernel entirely.
+ */
+ crash_relocate_mem();
+
machine_kexec(image);
} else {
printk(KERN_EMERG "kexec: No kernel image loaded!\n");
_