From patchwork Tue Sep 27 07:47:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Anand X-Patchwork-Id: 9351563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 046C06077A for ; Tue, 27 Sep 2016 07:51:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB4D628F8D for ; Tue, 27 Sep 2016 07:50:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFE4C290D0; Tue, 27 Sep 2016 07:50:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1F6AC2907E for ; Tue, 27 Sep 2016 07:50:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bon8k-0006hn-Az; Tue, 27 Sep 2016 07:49:22 +0000 Received: from mail-yw0-f172.google.com ([209.85.161.172]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bon7z-0006Ir-FJ for linux-arm-kernel@lists.infradead.org; Tue, 27 Sep 2016 07:48:37 +0000 Received: by mail-yw0-f172.google.com with SMTP id t67so3355919ywg.3 for ; Tue, 27 Sep 2016 00:48:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=7DTXmYGOiByOHPaJWh42aVrxajVS2FMLgfDnbSftDZc=; b=mRQLeOqtRlR854/505sVL0+uBsjeyf/dEB7evXKMLotKXjvikvztP2s5Z+MsUghzVl 7yRRxIShUV/ja2H8rjsY6XixAhbmK8oVam0+0pLrqdiEb6x+EJhbcP7uAAEaJmGVNgD4 GqrWC0GvEOIW6VJok3kYWNEDH+Y6kKLbRU5kQ4f235CMYiix86cnU6CH8v2PmpTIv+o9 WlReAuwagMO2K7FDMRheLVfwLasQSvSTRxjID/YDD3n+KhNKjwv27vNJKU8rTlt7IoFg qdj3dle3Kmb0SgD0qxfe5deSTGTL2vXagjphEjTQUJJaxlmrKwLhXjsMXsqsFYdJO3Sf kDaA== X-Gm-Message-State: AE9vXwN7OAUz3ur1Z/bSNMdAN1mPYwiOpHODdaX1YXjznj0/OU68Xr6m6W8s5FNUCCS5nRu6 X-Received: by 10.129.96.194 with SMTP id u185mr22678157ywb.330.1474962494311; Tue, 27 Sep 2016 00:48:14 -0700 (PDT) Received: from localhost ([182.68.8.143]) by smtp.gmail.com with ESMTPSA id w137sm534704ywd.2.2016.09.27.00.48.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Sep 2016 00:48:13 -0700 (PDT) From: Pratyush Anand To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com Subject: [PATCH V2 2/6] arm64: kgdb_step_brk_fn: ignore other's exception Date: Tue, 27 Sep 2016 13:17:56 +0530 Message-Id: <60aa43dad279e0f35b91def7fb7a60562f3ebb50.1474960629.git.panand@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160927_004835_669590_49FFEB90 X-CRM114-Status: GOOD ( 12.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: panand@redhat.com, linux@arm.linux.org.uk, srikar@linux.vnet.ibm.com, vijaya.kumar@caviumnetworks.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, oleg@redhat.com, dave.long@linaro.org, steve.capper@linaro.org, wcohen@redhat.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ARM64 step exception does not have any syndrome information. So, it is responsibility of exception handler to take care that they handle it only if exception was raised for them. Since kgdb_step_brk_fn() always returns 0, therefore we might have problem when we will have other step handler registered as well. This patch fixes kgdb_step_brk_fn() to return error in case of step handler was not meant for kgdb. Signed-off-by: Pratyush Anand --- arch/arm64/kernel/kgdb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/kernel/kgdb.c b/arch/arm64/kernel/kgdb.c index e017a9493b92..d217c9e95b06 100644 --- a/arch/arm64/kernel/kgdb.c +++ b/arch/arm64/kernel/kgdb.c @@ -247,6 +247,9 @@ NOKPROBE_SYMBOL(kgdb_compiled_brk_fn); static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int esr) { + if (!kgdb_single_step) + return DBG_HOOK_ERROR; + kgdb_handle_exception(1, SIGTRAP, 0, regs); return 0; }