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: 9979 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 263CA23E1B for ; Fri, 13 Jul 2012 10:19:11 +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 E9A4FA18223 for ; Fri, 13 Jul 2012 10:19:10 +0000 (UTC) Received: by ggnf1 with SMTP id f1so3679369ggn.11 for ; Fri, 13 Jul 2012 03:19:10 -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=VX8FEjw/gBeWJL2J1QRhwqJJUG5r709jkMe376bJx2mS6UH3crzemc+MpeqNo7MzYl WYHx95P/g+nNjOySA960znV1JBDSbx+0vNishs9aEDvST83WXrVptLzWzB88mt2Y0flA UKw7X4wr5OZWhRv15jTz+levVfzT+LSbz7DBr2r3bxsJe6ZYYG3BzogyLHF1tSoSWgIo 6IQm1pUL/+GocSQGh9Bkw6jsJ3xqTWhcZc3+L1feurZhchZYIf3UkTutuFUuHU8JF8Yc I6saykRL5UR+dZ4gN+D25/1gJEfrksYLVkX3ofUQdeBAdRQYdOKnsDwADhj419/ZMfAD tuIw== Received: by 10.50.203.39 with SMTP id kn7mr375772igc.53.1342174750135; Fri, 13 Jul 2012 03:19:10 -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.241.2 with SMTP id lc2csp13690ibb; Fri, 13 Jul 2012 03:19:09 -0700 (PDT) Received: by 10.66.74.69 with SMTP id r5mr1036495pav.56.1342174749399; Fri, 13 Jul 2012 03:19:09 -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 ni6si11918446pbc.183.2012.07.13.03.19.09 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Jul 2012 03:19:09 -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 rr4so6369802pbb.37 for ; Fri, 13 Jul 2012 03:19:09 -0700 (PDT) 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 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/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: ALoCoQlIfH5Y0erdO7Zd29OIJjwtXPIhYM3Wn9QRJug2JKLQNkUN1R/qm1PkNOBWKkNuP9TSbJdi 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;