From patchwork Fri Jul 13 10:16:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 1194931 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 A9B6BDFFFD for ; Fri, 13 Jul 2012 10:28:16 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Spd0y-0003J7-BY; Fri, 13 Jul 2012 10:22:24 +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 1Spcxy-0002wG-6L for linux-arm-kernel@lists.infradead.org; Fri, 13 Jul 2012 10:19:21 +0000 Received: by pbbrq13 with SMTP id rq13so5962037pbb.36 for ; Fri, 13 Jul 2012 03:19:09 -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=JolV0AoIG9TwcbaL/wTrxlPY65z5I1TSp2bD8CknDGclRSnT3YIE0gT1Lq1NYTVq6n VeyBMukQ9TavnrRZgXUPkDSRqAlo7/eZbkXgUoNPOcDfD9+CBDu8XjcP6dXBL8SYPK2I HwYZncDm7V5/yPK0H54F7+Aug4a6zQX9ZPPMWZj8Gujzijic0jW5GUbvvPG5kpAunBiC NLtCWrDEyqV1lTlf92kwdN4ADQAaBF45lgXx5MP7em4y9p/dAcmZKz/wH3GxnvBmrVXy 7LcbSoMlETEljTrpqOqdekvHYcfjL3YbmQ7Ijb/uYrLlK0usXFm4iTr7fi2Wf6X5Bihc I1dQ== Received: by 10.68.200.138 with SMTP id js10mr2903700pbc.23.1342174749077; Fri, 13 Jul 2012 03:19:09 -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 os3sm5751845pbb.41.2012.07.13.03.19.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Jul 2012 03:19:08 -0700 (PDT) From: Anton Vorontsov To: Russell King , Jason Wessel Subject: [PATCH 1/8] kernel/debug: Make use of KGDB_REASON_NMI Date: Fri, 13 Jul 2012 03:16:41 -0700 Message-Id: <1342174608-22407-1-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <20120713101605.GA16139@lizard> References: <20120713101605.GA16139@lizard> X-Gm-Message-State: ALoCoQkfxn1Wwz1r1EGTz0hHdHBybYeJfSvpTvsq8KxRDfikQGKzkTUuiRdhvYeyS6TuonpM5rEv 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;