Skip to content

Commit

Permalink
kernel/debug: Make use of KGDB_REASON_NMI
Browse files Browse the repository at this point in the history
Currently kernel never set KGDB_REASON_NMI. We do now, when we enter
KGDB/KDB from an NMI.

This is not to be confused with kgdb_nmicallback(), NMI callback is
an entry for the slave CPUs during CPUs roundup, but REASON_NMI is the
entry for the master CPU.

Signed-off-by: Anton Vorontsov <[email protected]>
Signed-off-by: Jason Wessel <[email protected]>
  • Loading branch information
Anton Vorontsov authored and jwessel committed Jul 31, 2012
1 parent 07cd27b commit b10d22d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/debug/kdb/kdb_debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/kdb.h>
#include <linux/kdebug.h>
#include <linux/export.h>
#include <linux/hardirq.h>
#include "kdb_private.h"
#include "../debug_core.h"

Expand Down Expand Up @@ -52,6 +53,9 @@ int kdb_stub(struct kgdb_state *ks)
if (atomic_read(&kgdb_setting_breakpoint))
reason = KDB_REASON_KEYBOARD;

if (in_nmi())
reason = KDB_REASON_NMI;

for (i = 0, bp = kdb_breakpoints; i < KDB_MAXBPT; i++, bp++) {
if ((bp->bp_enabled) && (bp->bp_addr == addr)) {
reason = KDB_REASON_BREAK;
Expand Down

0 comments on commit b10d22d

Please sign in to comment.