* [PATCH] powerpc: Invoke kdump for system reset exception
@ 2009-08-24 3:12 M. Mohan Kumar
2009-08-27 3:54 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 2+ messages in thread
From: M. Mohan Kumar @ 2009-08-24 3:12 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev, kamalesh
Invoke kdump for system reset exception
Dump restart operation from HMC raises system reset exception
(0x100) and xmon is invoked(even if kdump kernel is loaded). User has to
exit from xmon by saying 'Don't recover' to invoke kdump. Modify this
behaviour so that xmon will return immediately for system reset
exception and kdump kernel will be invoked (if its loaded). If kdump
kernel is not loaded, proceed with xmon
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
---
arch/powerpc/xmon/xmon.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index e1f33a8..6847334 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -23,6 +23,7 @@
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/bug.h>
+#include <linux/kexec.h>
#include <asm/ptrace.h>
#include <asm/string.h>
@@ -348,6 +349,14 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
unsigned long timeout;
#endif
+ /*
+ * If the exception is 0x100 and if kexec crash image is loaded,
+ * continue with kexec_crash
+ */
+ if (kexec_should_crash(current) && kexec_crash_image &&
+ regs->trap == 0x100)
+ return 0;
+
local_irq_save(flags);
bp = in_breakpoint_table(regs->nip, &offset);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc: Invoke kdump for system reset exception
2009-08-24 3:12 [PATCH] powerpc: Invoke kdump for system reset exception M. Mohan Kumar
@ 2009-08-27 3:54 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2009-08-27 3:54 UTC (permalink / raw)
To: mohan; +Cc: linuxppc-dev, kamalesh
On Mon, 2009-08-24 at 08:42 +0530, M. Mohan Kumar wrote:
> Invoke kdump for system reset exception
>
> Dump restart operation from HMC raises system reset exception
> (0x100) and xmon is invoked(even if kdump kernel is loaded). User has to
> exit from xmon by saying 'Don't recover' to invoke kdump. Modify this
> behaviour so that xmon will return immediately for system reset
> exception and kdump kernel will be invoked (if its loaded). If kdump
> kernel is not loaded, proceed with xmon
Hi Mohan !
This is not right. The way things -should- already work is that xmon
will only kick in if it's been enabled (aka initialized). This happens
normally if either:
- CONFIG_XMON_DEFAULT is set, which forces enable it at boot. This
should not be set on distro kernels
- The command line says xmon=early or xmon=on, in which case xmon will
be enabled during early boot (and in the case of xmon=early, you'll drop
into it early during boot, for example to get a chance to set some
breakpoints).
So on a normal distro kernel, where CONFIG_XMON_DEFAULT should not be
set (if it is, they need to fix it), xmon will not be initialized, and a
System Reset exception should trigger a kdump. If it doesn't, then
there's a bug elsewhere, but the fix isn't to modify xmon.
Cheers,
Ben.
> Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
> ---
> arch/powerpc/xmon/xmon.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index e1f33a8..6847334 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -23,6 +23,7 @@
> #include <linux/interrupt.h>
> #include <linux/irq.h>
> #include <linux/bug.h>
> +#include <linux/kexec.h>
>
> #include <asm/ptrace.h>
> #include <asm/string.h>
> @@ -348,6 +349,14 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
> unsigned long timeout;
> #endif
>
> + /*
> + * If the exception is 0x100 and if kexec crash image is loaded,
> + * continue with kexec_crash
> + */
> + if (kexec_should_crash(current) && kexec_crash_image &&
> + regs->trap == 0x100)
> + return 0;
> +
> local_irq_save(flags);
>
> bp = in_breakpoint_table(regs->nip, &offset);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-27 3:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-24 3:12 [PATCH] powerpc: Invoke kdump for system reset exception M. Mohan Kumar
2009-08-27 3:54 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).