Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752513AbbFREAF (ORCPT ); Thu, 18 Jun 2015 00:00:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48111 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751462AbbFRD7j (ORCPT ); Wed, 17 Jun 2015 23:59:39 -0400 From: Pratyush Anand To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com Cc: linux-kernel@vger.kernel.org, wcohen@redhat.com, oleg@redhat.com, dave.long@linaro.org, steve.capper@linaro.org, srikar@linux.vnet.ibm.com, vijaya.kumar@caviumnetworks.com, Pratyush Anand Subject: [RFC PATCH V2 02/10] arm64: fix kgdb_step_brk_fn to ignore other's exception Date: Thu, 18 Jun 2015 09:28:49 +0530 Message-Id: <203b320f540c4b348a289c57633fcc13684ac74e.1434598237.git.panand@redhat.com> In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1269 Lines: 35 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. After kprobe support, both kprobe and kgdb uses register_step_hook mechanism to register its step handler. So, if call_step_hook calls kgdb handler first, it was always returning 0 and in that case if an exception was raised for kprobe, it would never be handled. 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 a0d10c55f307..9469465a5e03 100644 --- a/arch/arm64/kernel/kgdb.c +++ b/arch/arm64/kernel/kgdb.c @@ -229,6 +229,9 @@ static int kgdb_compiled_brk_fn(struct pt_regs *regs, unsigned int esr) 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; } -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/