linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: anton.vorontsov@linaro.org (Anton Vorontsov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] kernel/debug: Make use of KGDB_REASON_NMI
Date: Thu,  5 Jul 2012 16:12:35 -0700	[thread overview]
Message-ID: <1341529960-18370-1-git-send-email-anton.vorontsov@linaro.org> (raw)
In-Reply-To: <20120705231034.GA16931@lizard>

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>
---
 kernel/debug/kdb/kdb_debugger.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/debug/kdb/kdb_debugger.c b/kernel/debug/kdb/kdb_debugger.c
index 8b68ce7..be7b33b 100644
--- a/kernel/debug/kdb/kdb_debugger.c
+++ b/kernel/debug/kdb/kdb_debugger.c
@@ -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"
 
@@ -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;
-- 
1.7.10.4

  reply	other threads:[~2012-07-05 23:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-05 23:10 [PATCH 0/6] KGDB/KDB FIQ (NMI) debugger Anton Vorontsov
2012-07-05 23:12 ` Anton Vorontsov [this message]
2012-07-05 23:12 ` [PATCH 2/6] kernel/debug: Mask KGDB NMI upon entry Anton Vorontsov
2012-07-05 23:12 ` [PATCH 3/6] ARM: Move some macros from entry-armv to entry-header Anton Vorontsov
2012-07-05 23:12 ` [PATCH 4/6] ARM: Add KGDB/KDB FIQ debugger generic code Anton Vorontsov
2012-07-05 23:12 ` [PATCH 5/6] ARM: VIC: Add a couple of low-level FIQ management helpers Anton Vorontsov
2012-07-05 23:12 ` [PATCH 6/6] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger Anton Vorontsov
2012-07-06  0:02 ` [PATCH 0/6] KGDB/KDB FIQ (NMI) debugger Colin Cross
2012-07-13  9:49   ` Anton Vorontsov
2012-07-13 16:43     ` Colin Cross
2012-07-13 22:08       ` Anton Vorontsov

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=1341529960-18370-1-git-send-email-anton.vorontsov@linaro.org \
    --to=anton.vorontsov@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).