Commit b10d22d6e8f76b9e94871aebe0fc62aab2748200

Authored by Anton Vorontsov
Committed by Jason Wessel
1 parent 07cd27bbd4

kernel/debug: Make use of KGDB_REASON_NMI

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 <anton.vorontsov@linaro.org>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff

kernel/debug/kdb/kdb_debugger.c
... ... @@ -12,6 +12,7 @@
12 12 #include <linux/kdb.h>
13 13 #include <linux/kdebug.h>
14 14 #include <linux/export.h>
  15 +#include <linux/hardirq.h>
15 16 #include "kdb_private.h"
16 17 #include "../debug_core.h"
17 18  
... ... @@ -51,6 +52,9 @@
51 52 ks->pass_exception = 0;
52 53 if (atomic_read(&kgdb_setting_breakpoint))
53 54 reason = KDB_REASON_KEYBOARD;
  55 +
  56 + if (in_nmi())
  57 + reason = KDB_REASON_NMI;
54 58  
55 59 for (i = 0, bp = kdb_breakpoints; i < KDB_MAXBPT; i++, bp++) {
56 60 if ((bp->bp_enabled) && (bp->bp_addr == addr)) {