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: 10359 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 267DA23E02 for ; Mon, 30 Jul 2012 12:01:43 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id D119DA18AD2 for ; Mon, 30 Jul 2012 12:01:42 +0000 (UTC) Received: by yhpp61 with SMTP id p61so4596899yhp.11 for ; Mon, 30 Jul 2012 05:01:42 -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=KdKiK28NxFtZwE07FCEq7kJnydSIYyzlnoZ/qZeAMvlKlrZl2JNqh6IaFIOLKIEDld uOcS4441qEakT0F3OlZRrrR3u7otbFEfIQWA+NHONhbJ1XfP5HEw/y1gHEpEbrxv+9Mv PPcQ2qyB3DILT9TGzs5agr7bPrlOeu0MABX70gbZNeJzZZapAWCIQG0ZTxCTJ2DU0YbD zWy2ZXRiXFUVuNqo4vwQHgFaJQ85h/7R6jtqgrBABIwRSvb14f2buR3X6x2e+dC0Lg6x G5eMIKV0oWYNE0cnqHehrjd2gxy7oq0cGVU4LHlSSWq9SE9bWFzxCyNPHdf2H38DTaWa 4Agw== Received: by 10.50.213.39 with SMTP id np7mr8064038igc.51.1343649701923; Mon, 30 Jul 2012 05:01:41 -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.50.87.40 with SMTP id u8csp84576igz; Mon, 30 Jul 2012 05:01:41 -0700 (PDT) Received: by 10.236.153.9 with SMTP id e9mr9904496yhk.32.1343649700838; Mon, 30 Jul 2012 05:01:40 -0700 (PDT) Received: from mail-yx0-f178.google.com (mail-yx0-f178.google.com [209.85.213.178]) by mx.google.com with ESMTPS id t10si3873654ank.198.2012.07.30.05.01.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jul 2012 05:01:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.213.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by yenl6 with SMTP id l6so5346203yen.37 for ; Mon, 30 Jul 2012 05:01:40 -0700 (PDT) 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 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 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: ALoCoQmD0ysHpKwvzSItcojPoo3VJlrfvaPJ/sRt3C7XThMc2CGjO/+7zhPgMkOav+IBxWkdsOtM 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;