[PATCH] x86: fix duplicate calls of the nmi handler

From: Robert Richter
Date: Fri Aug 06 2010 - 14:45:51 EST


The commit:

e40b172 x86: Move notify_die from nmi.c to traps.c

moved the nmi handler call to default_do_nmi(). DIE_NMI_IPI and
DIE_NMI are called subsequently now. If the return code is
!NOTIFY_STOP, then the handlers are called twice. This patch fixes
this.

Signed-off-by: Robert Richter <robert.richter@xxxxxxx>
---
arch/x86/kernel/apic/hw_nmi.c | 1 -
arch/x86/kernel/cpu/perf_event.c | 1 -
arch/x86/oprofile/nmi_int.c | 1 -
3 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/hw_nmi.c b/arch/x86/kernel/apic/hw_nmi.c
index cefd694..61a3ad7 100644
--- a/arch/x86/kernel/apic/hw_nmi.c
+++ b/arch/x86/kernel/apic/hw_nmi.c
@@ -52,7 +52,6 @@ arch_trigger_all_cpu_backtrace_handler(struct notifier_block *self,
int cpu = smp_processor_id();

switch (cmd) {
- case DIE_NMI:
case DIE_NMI_IPI:
break;

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 3efdf28..87dc9e2 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1219,7 +1219,6 @@ perf_event_nmi_handler(struct notifier_block *self,
return NOTIFY_DONE;

switch (cmd) {
- case DIE_NMI:
case DIE_NMI_IPI:
break;
case DIE_NMIUNKNOWN:
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index cfe4faa..e0132bf 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -64,7 +64,6 @@ static int profile_exceptions_notify(struct notifier_block *self,
int ret = NOTIFY_DONE;

switch (val) {
- case DIE_NMI:
case DIE_NMI_IPI:
if (ctr_running)
model->check_ctrs(args->regs, &__get_cpu_var(cpu_msrs));
--
1.7.1.1



> >
> > What are you running to create the problem? I can try and duplicate
> > it here.
>
> It happens easily here - just running something like:
>
> perf record -g ./hackbench 10
>
> a couple of times triggers it. Note, unlike with the earlier bug, the
> NMIs are not permanently 'stuck' - and everything continues working.
> Obviously the messages are nasty looking so this is a regression we need
> to fix.
>
> Thanks,
>
> Ingo
>

--
Advanced Micro Devices, Inc.
Operating System Research Center

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/