Skip to content

Commit

Permalink
kgdb, x86: Avoid invoking kgdb_nmicallback twice per NMI
Browse files Browse the repository at this point in the history
Stress-testing KVM's latest NMI support with kgdbts inside an SMP guest,
I came across spurious unhandled NMIs while running the singlestep test.
Looking closer at the code path each NMI takes when KGDB is enabled, I
noticed that kgdb_nmicallback is called twice per event: One time via
DIE_NMI_IPI notification, the second time on DIE_NMI. Removing the first
invocation cures the unhandled NMIs here.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
  • Loading branch information
jan-kiszka authored and jwessel committed Oct 6, 2008
1 parent fec6ed1 commit e85ceae
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions arch/x86/kernel/kgdb.c
Expand Up @@ -455,12 +455,7 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd)
return NOTIFY_DONE;

case DIE_NMI_IPI:
if (atomic_read(&kgdb_active) != -1) {
/* KGDB CPU roundup */
kgdb_nmicallback(raw_smp_processor_id(), regs);
was_in_debug_nmi[raw_smp_processor_id()] = 1;
touch_nmi_watchdog();
}
/* Just ignore, we will handle the roundup on DIE_NMI. */
return NOTIFY_DONE;

case DIE_NMIUNKNOWN:
Expand Down

0 comments on commit e85ceae

Please sign in to comment.