From patchwork Mon Jul 30 11:58:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 1254361 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 4FFC6DF24C for ; Mon, 30 Jul 2012 12:09:58 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Svogx-0006TZ-DP; Mon, 30 Jul 2012 12:03:30 +0000 Received: from mail-yw0-f49.google.com ([209.85.213.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SvofR-0006GJ-M4 for linux-arm-kernel@lists.infradead.org; Mon, 30 Jul 2012 12:01:45 +0000 Received: by yhjj52 with SMTP id j52so4806299yhj.36 for ; Mon, 30 Jul 2012 05:01:40 -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=IG/u3gWVHDIbVuUSYWqnZSxZI8vHFzVqQkTGBZR5X2ortL+vm1FehnHnLwLmmANG4W 39ze8A746c5uMMpKMz6Tm8x+BI/zGVneXpflbvRNau5fKz7/77LYMgc3cbA8sb7DFJRH TG8jyEYTkSlKlBpxWhVFUfGiNFt8VrR8ofoweHN9UeTT+ZtrOOCvfXvi5af8rQb/g0b1 qgaxkJgCwDaQG0TXjtUOEmw48b9C3UvkPtenAJvrlvKGInK1xbAZUjnX3X6xafkGlJ8r y7bZZidpRQl0PXR0FrmeZs020puFheBYaek6fGR6hJ8YwlNLID5UM9NpGGXwc9AYiNZU 8Luw== Received: by 10.66.73.133 with SMTP id l5mr23978756pav.74.1343649700138; Mon, 30 Jul 2012 05:01:40 -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 qb10sm2753883pbc.21.2012.07.30.05.01.38 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jul 2012 05:01:39 -0700 (PDT) From: Anton Vorontsov To: Russell King , Jason Wessel , Greg Kroah-Hartman , Alan Cox Subject: [PATCH 01/11] kernel/debug: Make use of KGDB_REASON_NMI Date: Mon, 30 Jul 2012 04:58:10 -0700 Message-Id: <1343649500-18491-1-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <20120730115719.GA5742@lizard> References: <20120730115719.GA5742@lizard> X-Gm-Message-State: ALoCoQn3HDp1jJp1e+eiFLQctYzmCfhp0wLU6yAlHBcxcd60E+fwnPiNU2i620j3CIMfJo2Qev9I X-Spam-Note: CRM114 invocation failed X-Spam-Note: SpamAssassin invocation failed 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;