Skip to contentSkip to conversation

kdump: x86_64 add crashdump trigger points

PATCH In review Vivek Goyal 2 participants 2 messages Apr 17, 2006 – Apr 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kdump: x86_64 add crashdump trigger points

Hi,

I am reposting this patch as there was no response after I modified the patch based on feedback. Is there a problem with the patch? If yes please let me know, I shall rectify that.

We need this patch to trigger the booting of capture kernel if system is hung and die_nmi() hits or some thread oopses and panic_on_oops is set.

System starts booting into capture kernel only if it is pre-loaded otherwise normal operation continues and existing functionality is not impacted.

o Start booting into the capture kernel after an Oops if system is in a unrecoverable state. System will boot into the capture kernel, if one is pre-loaded by the user, and capture the kernel core dump.

o One of the following conditions should be true to trigger the booting of capture kernel.
- panic_on_oops is set.
- pid of current thread is 0
- pid of current thread is 1
- Oops happened inside interrupt context.

---

 arch/x86_64/kernel/traps.c |    5 +++++
 1 file changed, 5 insertions(+)
arch/x86_64/kernel/traps.c renamed from arch/x86_64/kernel/traps.c~kdump-x86_64-add-crashdump-trigger-points +5 -0
diff -puN arch/x86_64/kernel/traps.c~kdump-x86_64-add-crashdump-trigger-points arch/x86_64/kernel/traps.c
@@ -30,6 +30,7 @@
 #include <linux/moduleparam.h>
 #include <linux/nmi.h>
 #include <linux/kprobes.h>
+#include <linux/kexec.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -433,6 +434,8 @@ void __kprobes __die(const char * str, s
 	printk(KERN_ALERT "RIP ");
 	printk_address(regs->rip); 
 	printk(" RSP <%016lx>\n", regs->rsp); 
+	if (kexec_should_crash(current))
+		crash_kexec(regs);
 }
 
 void die(const char * str, struct pt_regs * regs, long err)
@@ -455,6 +458,8 @@ void __kprobes die_nmi(char *str, struct
 	 */
 	printk(str, safe_smp_processor_id());
 	show_registers(regs);
+	if (kexec_should_crash(current))
+		crash_kexec(regs);
 	if (panic_on_timeout || panic_on_oops)
 		panic("nmi watchdog");
 	printk("console shuts up ...\n");

_

#1 lore raw
Quoted 5 lines · Vivek Goyal

Hi,

I am reposting this patch as there was no response after I modified the patch based on feedback. Is there a problem with the patch? If yes please let me know, I shall rectify that.

It's already queued for .18

See ftp://ftp.firstfloor.org/pub/ak/x86_64/quilt/patches/ for my current queue

-Andi