[PATCH] powerpc: Add arch dependent basic infrastructure for Kdump.
Implementing the machine_crash_shutdown which will be called by crash_kexec (called in case of a panic, sysrq etc.). Disable the interrupts, shootdown cpus using debugger IPI and collect regs for all CPUs. elfcorehdr= specifies the location of elf core header stored by the crashed kernel. This command line option will be passed by the kexec-tools to capture kernel. savemaxmem= specifies the actual memory size that the first kernel has and this value will be used for dumping in the capture kernel. This command line option will be passed by the kexec-tools to capture kernel. Signed-off-by: Haren Myneni <haren@us.ibm.com> Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
committed by
Paul Mackerras
parent
758438a7b8
commit
cc53291521
@@ -31,6 +31,7 @@
|
||||
#include <linux/prctl.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/kprobes.h>
|
||||
#include <linux/kexec.h>
|
||||
|
||||
#include <asm/kdebug.h>
|
||||
#include <asm/pgtable.h>
|
||||
@@ -95,7 +96,7 @@ static DEFINE_SPINLOCK(die_lock);
|
||||
|
||||
int die(const char *str, struct pt_regs *regs, long err)
|
||||
{
|
||||
static int die_counter;
|
||||
static int die_counter, crash_dump_start = 0;
|
||||
int nl = 0;
|
||||
|
||||
if (debugger(regs))
|
||||
@@ -156,7 +157,21 @@ int die(const char *str, struct pt_regs *regs, long err)
|
||||
print_modules();
|
||||
show_regs(regs);
|
||||
bust_spinlocks(0);
|
||||
|
||||
if (!crash_dump_start && kexec_should_crash(current)) {
|
||||
crash_dump_start = 1;
|
||||
spin_unlock_irq(&die_lock);
|
||||
crash_kexec(regs);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
spin_unlock_irq(&die_lock);
|
||||
if (crash_dump_start)
|
||||
/*
|
||||
* Only for soft-reset: Other CPUs will be responded to an IPI
|
||||
* sent by first kexec CPU.
|
||||
*/
|
||||
for(;;)
|
||||
;
|
||||
|
||||
if (in_interrupt())
|
||||
panic("Fatal exception in interrupt");
|
||||
|
Reference in New Issue
Block a user