linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Wilder <dwilder@us.ibm.com>
To: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
	haren@us.ibm.com
Subject: [PATCH] Xmon stops CPUs for kdump
Date: Thu, 29 Jun 2006 15:17:30 -0700	[thread overview]
Message-ID: <44A4517A.2050509@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

In the case of a system hang, the user will invoke soft-reset to 
initiate the kdump boot.  If xmon is enabled, the CPU(s) enter into the 
xmon debugger.   Unfortunately, the secondary CPU(s) will return to the 
hung state when they exit from the debugger (returned from die() -> 
system_reset_exception()).  This causes a problem in kdump since the 
hung CPU(s) will not respond to the IPI sent from kdump.  This patch 
fixes the issue by calling crash_kexec_secondary() directly from 
system_reset_exception() without returning to the previous state.  These 
secondary CPUs wait 5ms until the kdump boot is started by the primary 
CPU.   In the case we exited from the debugger to "recover" (command 'x' 
in xmon) the primary and the secondary CPUs will all return from die() 
-> system_reset_exception() ->crash_kexec_secondary() wait 5ms, then 
return to the previous state.  A kdump boot is not started in this case.

Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: David Wilder <dwilder@us.ibm.com>

-- 
David Wilder
IBM Linux Technology Center
Beaverton, Oregon, USA 
dwilder@us.ibm.com
(503)578-3789


[-- Attachment #2: ppc64-x-mon-stop-cpu.patch --]
[-- Type: text/x-patch, Size: 1059 bytes --]

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index fa6bd97..49679c3 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -216,6 +216,19 @@ void system_reset_exception(struct pt_re
 
 	die("System Reset", regs, SIGABRT);
 
+	/*
+	 * Some CPUs when released from the debugger will execute this path.
+	 * These CPUs entered the debugger via a soft-reset. If the CPU was 
+	 * hung before entering the debugger it will return to the hung 
+	 * state when exiting this function.  This causes a problem in
+	 * kdump since the hung CPU(s) will not respond to the IPI sent
+	 * from kdump. To prevent the problem we call crash_kexec_secondary()
+	 * here. If a kdump had not been initiated or we exit the debugger
+	 * with the "exit and recover" command (x) crash_kexec_secondary()
+	 * will return after 5ms and the CPU returns to its previous state.
+	 */
+	crash_kexec_secondary(regs);
+
 	/* Must die if the interrupt is not recoverable */
 	if (!(regs->msr & MSR_RI))
 		panic("Unrecoverable System Reset");

                 reply	other threads:[~2006-06-29 21:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44A4517A.2050509@us.ibm.com \
    --to=dwilder@us.ibm.com \
    --cc=haren@us.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).