From patchwork Thu Jul 5 23:12:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 1162411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 6220CDFB7C for ; Thu, 5 Jul 2012 23:20:25 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SmvGq-0003HE-4t; Thu, 05 Jul 2012 23:15:36 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SmvGL-0003GD-2S for linux-arm-kernel@lists.infradead.org; Thu, 05 Jul 2012 23:15:06 +0000 Received: by pbbrq13 with SMTP id rq13so15061646pbb.36 for ; Thu, 05 Jul 2012 16:15:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=uXDLbyJyKGVXQOO5BJpu1fQk8t0diORBvMYXV0AzNKQ=; b=WExosb6ZT7j8ON3MCWEdaXlJSVUqciuDHVMjs5gPFmuHhGJVDe7bphz3T+ttoowWWM KQVCYOaOzDKyhhnZrZ0Nf9mUiI9eAN9LElRolKMtylhy/60B4GULb4jUXDbFSL4gLkJ1 5Wy9CzyZE89lNP88RXdgoYmzg/9kXEqVAebnLpjLwh5SO85Wj/L5FK9wSoSG0ZY7QzXs vtXP44sUHhzp3JDvKMdA1NAAMRlHkPjlIhjCvK4/bPJulJoPO73vlaJ8Ay4c6NVTxJrD VVGIBovvMOH2A+vKm+ezAz4rYqJ+/Ti7bFwysLxXcwzJ4Y3rq2xwcfcAVYn/eJamabK/ i9wg== Received: by 10.68.239.9 with SMTP id vo9mr31933157pbc.41.1341530103573; Thu, 05 Jul 2012 16:15:03 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id sk5sm20596463pbc.7.2012.07.05.16.15.02 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Jul 2012 16:15:02 -0700 (PDT) From: Anton Vorontsov To: Russell King , Jason Wessel Subject: [PATCH 1/6] kernel/debug: Make use of KGDB_REASON_NMI Date: Thu, 5 Jul 2012 16:12:35 -0700 Message-Id: <1341529960-18370-1-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <20120705231034.GA16931@lizard> References: <20120705231034.GA16931@lizard> X-Gm-Message-State: ALoCoQkaforxmw+FiNce6QQcY0701LdOS6QNmheTp8YW+7DGWg9iytKGK1duh5LCmCUXiHQPsGxf X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , John Stultz , Colin Cross , kernel-team@android.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- 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 #include #include +#include #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;