From patchwork Wed Nov 2 09:10:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Anand X-Patchwork-Id: 9408817 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 73B1960585 for ; Wed, 2 Nov 2016 09:13:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5964C29FA2 for ; Wed, 2 Nov 2016 09:13:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DE1429FA4; Wed, 2 Nov 2016 09:13:32 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 0120E29FA2 for ; Wed, 2 Nov 2016 09:13:32 +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 1c1raK-0002Oe-1h; Wed, 02 Nov 2016 09:11:52 +0000 Received: from mail-qk0-f180.google.com ([209.85.220.180]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1rZx-00029a-O2 for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2016 09:11:31 +0000 Received: by mail-qk0-f180.google.com with SMTP id o68so10434947qkf.3 for ; Wed, 02 Nov 2016 02:11:09 -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=CCy/jO7hwCwMVUuPNEilud3F/bznviDpUCMN73vQ+YbHSDFcaKq6sFtoP8T2Cm0t75 9mwexRUkNOO5z4XKOor4woNHp9qEjvQ+5rq+uozxHcG8VF7mTrjbfxnsV1r0XcIUvKhZ KfQ5h987afhKGCbovveSOpu5krUFitCOWtWnwrhsyaNodkvjJ02KGPV1+9SIv3tgHG9E N8pxnJXQ/abyZGRPnyGNQx2894GAbiYv/7GZsiz9J+g/RcwG5sPJhbqLTjLa8/CGxIHb /WcG3L2Lb4r1ozjG80UYB167lTKHHFnMeJ1ubSJcMrq69PAds7etS3vhI9PJaWWCKDH/ QSuw== X-Gm-Message-State: ABUngvcjmM5zCrZ6RZ1pKNoEmfUSiVxDxKCkBahy67XB5a5wRp2IOXEnCY3UOV6gwi3fpoYY X-Received: by 10.55.23.65 with SMTP id i62mr2009705qkh.238.1478077868440; Wed, 02 Nov 2016 02:11:08 -0700 (PDT) Received: from localhost ([122.180.204.166]) by smtp.gmail.com with ESMTPSA id c189sm611252qkg.21.2016.11.02.02.11.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 02:11:08 -0700 (PDT) From: Pratyush Anand To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com Subject: [PATCH V3 2/6] arm64: kgdb_step_brk_fn: ignore other's exception Date: Wed, 2 Nov 2016 14:40:42 +0530 Message-Id: <9d2c9444762f1623e75b7de9e5783a94a257a00d.1478068479.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-20161102_021130_077766_BE022C17 X-CRM114-Status: GOOD ( 12.41 ) 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, steve.capper@linaro.org, srikar@linux.vnet.ibm.com, vijaya.kumar@caviumnetworks.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, oleg@redhat.com, wcohen@redhat.com, dave.long@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; }