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: 9872 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AE0AB23E2F for ; Thu, 5 Jul 2012 23:15:05 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 794DAA182F4 for ; Thu, 5 Jul 2012 23:15:05 +0000 (UTC) Received: by ggnf1 with SMTP id f1so8655056ggn.11 for ; Thu, 05 Jul 2012 16:15:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=uXDLbyJyKGVXQOO5BJpu1fQk8t0diORBvMYXV0AzNKQ=; b=Uil0n7LTBszlo5bqR0+BF5KeA+MnnzKfttoM84soUlM7bg/8h9qV9YCrlVdkJNIh3M 0upFRplDPPxHxkOtjUvfrL6su27sIDqvsBdT4cvIyK+uLddAzbs+QQhKsT8fgN71fzRU IWpgFWT5I7pc+C4GwKprf2s/DlgRHnSgPPGqfhMiYw5h6zb55TBL7gtyaZQmMXOk2+l0 798t9HIRSPArmxD2VECIhTb3WKPZY0+F7kRJsFYHeS9vmRdGlzJ9Qhhuw/NBUGsQOfgH UPAp2WRXTQaeQyVDK9Vz5DRmjqa26LmOQre1WnKisWx3GSlR40cwAgINRtvnt/w+/ic+ pE+A== Received: by 10.42.89.72 with SMTP id f8mr14671787icm.33.1341530104792; Thu, 05 Jul 2012 16:15:04 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp1900ibb; Thu, 5 Jul 2012 16:15:04 -0700 (PDT) Received: by 10.68.136.229 with SMTP id qd5mr31863583pbb.2.1341530104152; Thu, 05 Jul 2012 16:15:04 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id wt7si40242066pbc.172.2012.07.05.16.15.03 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Jul 2012 16:15:04 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by pbbrr4 with SMTP id rr4so15920100pbb.37 for ; Thu, 05 Jul 2012 16:15:03 -0700 (PDT) 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 Cc: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Colin Cross , John Stultz , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com, kgdb-bugreport@lists.sourceforge.net 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: ALoCoQnUJYyYm0yfAHKu9XUaiN7VTDqqceXtX0AHqePNTlCJwtA4awl+495xa++dcUMZS/+tQYAV 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;