From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
To: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org
Subject: [PATCH -rt 4/4] wait for finish show_regs() before panic
Date: Mon, 28 Apr 2008 11:19:21 -0700 [thread overview]
Message-ID: <48161529.2000109@ct.jp.nec.com> (raw)
In-Reply-To: <48161325.1080508@ct.jp.nec.com>
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
It might cause kdump failure that the kernel doesn't wait for finish
show_regs(). The nmi_show_regs variable for show_regs() flag is cleared
before show_regs() is really called. This flag should be cleared after
show_regs().
kdump stops all CPUs other than crashing CPU by NMI handler, but if
show_regs() takes a bit time, kdump cannot wait and will continue process.
It means that the 2nd kernel and the old kernel run simultaneously and it
might cause unexpected behavior, such as randomly reboot.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Maxim Uvarov <muvarov@ru.mvista.com>
---
arch/x86/kernel/nmi_32.c | 2 +-
arch/x86/kernel/nmi_64.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c
index d1f92ca..f46bb6e 100644
--- a/arch/x86/kernel/nmi_32.c
+++ b/arch/x86/kernel/nmi_32.c
@@ -355,13 +355,13 @@ notrace int irq_show_regs_callback(int cpu, struct pt_regs *regs)
if (!nmi_show_regs[cpu])
return 0;
- nmi_show_regs[cpu] = 0;
spin_lock(&nmi_print_lock);
printk(KERN_WARNING "NMI show regs on CPU#%d:\n", cpu);
printk(KERN_WARNING "apic_timer_irqs: %d\n",
per_cpu(irq_stat, cpu).apic_timer_irqs);
show_regs(regs);
spin_unlock(&nmi_print_lock);
+ nmi_show_regs[cpu] = 0;
return 1;
}
diff --git a/arch/x86/kernel/nmi_64.c b/arch/x86/kernel/nmi_64.c
index afc0317..8bc2328 100644
--- a/arch/x86/kernel/nmi_64.c
+++ b/arch/x86/kernel/nmi_64.c
@@ -345,12 +345,12 @@ notrace int irq_show_regs_callback(int cpu, struct pt_regs *regs)
if (!nmi_show_regs[cpu])
return 0;
- nmi_show_regs[cpu] = 0;
spin_lock(&nmi_print_lock);
printk(KERN_WARNING "NMI show regs on CPU#%d:\n", cpu);
printk(KERN_WARNING "apic_timer_irqs: %d\n", read_pda(apic_timer_irqs));
show_regs(regs);
spin_unlock(&nmi_print_lock);
+ nmi_show_regs[cpu] = 0;
return 1;
}
--
1.5.4.1
next prev parent reply other threads:[~2008-04-28 18:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-28 18:10 [PATCH -rt 0/4] nmi_watchdog fixes for -rt Hiroshi Shimamoto
2008-04-28 18:14 ` [PATCH -rt 1/4] x86_64: send NMI after nmi_show_regs on Hiroshi Shimamoto
2008-04-28 19:00 ` Steven Rostedt
2008-04-28 21:34 ` Hiroshi Shimamoto
2008-04-28 18:16 ` [PATCH -rt 2/4] x86: return true for NMI handled Hiroshi Shimamoto
2008-04-28 18:17 ` [PATCH -rt 3/4] x86: nmi_watchdog NMI needed for irq_show_regs_callback() Hiroshi Shimamoto
2008-04-28 18:19 ` Hiroshi Shimamoto [this message]
2008-04-28 19:03 ` [PATCH -rt 0/4] nmi_watchdog fixes for -rt Steven Rostedt
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=48161529.2000109@ct.jp.nec.com \
--to=h-shimamoto@ct.jp.nec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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).