All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Anand <panand@redhat.com>
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 <panand@redhat.com>,
	Adam Buchbinder <adam.buchbinder@gmail.com>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: [PATCH 2/5] arm64: kgdb_step_brk_fn: ignore other's exception
Date: Tue,  2 Aug 2016 11:00:06 +0530	[thread overview]
Message-ID: <3c3c8088926c1e50520f817a7e266b0cafb52966.1470114993.git.panand@redhat.com> (raw)
In-Reply-To: <cover.1470114993.git.panand@redhat.com>
In-Reply-To: <cover.1470114993.git.panand@redhat.com>

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 <panand@redhat.com>
---
 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 8c57f6496e56..e126f2b15002 100644
--- a/arch/arm64/kernel/kgdb.c
+++ b/arch/arm64/kernel/kgdb.c
@@ -244,6 +244,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;
 }
-- 
2.5.5

WARNING: multiple messages have this Message-ID (diff)
From: panand@redhat.com (Pratyush Anand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] arm64: kgdb_step_brk_fn: ignore other's exception
Date: Tue,  2 Aug 2016 11:00:06 +0530	[thread overview]
Message-ID: <3c3c8088926c1e50520f817a7e266b0cafb52966.1470114993.git.panand@redhat.com> (raw)
In-Reply-To: <cover.1470114993.git.panand@redhat.com>

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 <panand@redhat.com>
---
 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 8c57f6496e56..e126f2b15002 100644
--- a/arch/arm64/kernel/kgdb.c
+++ b/arch/arm64/kernel/kgdb.c
@@ -244,6 +244,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;
 }
-- 
2.5.5

  parent reply	other threads:[~2016-08-02  5:32 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02  5:30 [PATCH 0/5] ARM64: Uprobe support added Pratyush Anand
2016-08-02  5:30 ` Pratyush Anand
2016-08-02  5:30 ` [PATCH 1/5] arm64: kprobe: protect/rename few definitions to be reused by uprobe Pratyush Anand
2016-08-02  5:30   ` Pratyush Anand
2016-08-02  5:30 ` Pratyush Anand [this message]
2016-08-02  5:30   ` [PATCH 2/5] arm64: kgdb_step_brk_fn: ignore other's exception Pratyush Anand
2016-08-02  5:30 ` [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well Pratyush Anand
2016-08-02  5:30   ` Pratyush Anand
2016-09-06 16:11   ` Catalin Marinas
2016-09-06 16:11     ` Catalin Marinas
2016-09-06 21:36     ` David Long
2016-09-06 21:36       ` David Long
2016-09-07  4:47       ` Pratyush Anand
2016-09-07  4:47         ` Pratyush Anand
2016-09-07 13:41       ` Catalin Marinas
2016-09-07 13:41         ` Catalin Marinas
2016-08-02  5:30 ` [PATCH 4/5] arm64: Handle TRAP_BRKPT " Pratyush Anand
2016-08-02  5:30   ` Pratyush Anand
2016-09-06 16:34   ` Catalin Marinas
2016-09-06 16:34     ` Catalin Marinas
2016-08-02  5:30 ` [PATCH 5/5] arm64: Add uprobe support Pratyush Anand
2016-08-02  5:30   ` Pratyush Anand
2016-08-09 18:49   ` Oleg Nesterov
2016-08-09 18:49     ` Oleg Nesterov
2016-08-24  7:13     ` Pratyush Anand
2016-08-24  7:13       ` Pratyush Anand
2016-08-24 15:47       ` Oleg Nesterov
2016-08-24 15:47         ` Oleg Nesterov
2016-08-24 15:56         ` Will Deacon
2016-08-24 15:56           ` Will Deacon
2016-08-25 13:33           ` Oleg Nesterov
2016-08-25 13:33             ` Oleg Nesterov
2016-09-20 16:59   ` Catalin Marinas
2016-09-20 16:59     ` Catalin Marinas
2016-09-21 11:00     ` Pratyush Anand
2016-09-21 11:00       ` Pratyush Anand
2016-09-21 17:04       ` Catalin Marinas
2016-09-21 17:04         ` Catalin Marinas
2016-09-22  3:23         ` Pratyush Anand
2016-09-22  3:23           ` Pratyush Anand
2016-09-22 16:50           ` Catalin Marinas
2016-09-22 16:50             ` Catalin Marinas
2016-09-23  4:12             ` Pratyush Anand
2016-09-23  4:12               ` Pratyush Anand
2016-09-23 13:05               ` Catalin Marinas
2016-09-23 13:05                 ` Catalin Marinas
2016-09-25 17:02                 ` Pratyush Anand
2016-09-25 17:02                   ` Pratyush Anand
2016-09-26 11:01                   ` Catalin Marinas
2016-09-26 11:01                     ` Catalin Marinas
2016-09-26 13:03                     ` Pratyush Anand
2016-09-26 13:03                       ` Pratyush Anand
2016-09-27 13:51                       ` Catalin Marinas
2016-09-27 13:51                         ` Catalin Marinas
2016-09-27 15:03                         ` Pratyush Anand
2016-09-27 15:03                           ` Pratyush Anand
2016-09-28 17:12                           ` Catalin Marinas
2016-09-28 17:12                             ` Catalin Marinas
2016-08-24  7:26 ` [PATCH 0/5] ARM64: Uprobe support added Pratyush Anand
2016-08-24  7:26   ` Pratyush Anand
2016-09-20  2:51   ` Pratyush Anand
2016-09-20  2:51     ` Pratyush Anand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c3c8088926c1e50520f817a7e266b0cafb52966.1470114993.git.panand@redhat.com \
    --to=panand@redhat.com \
    --cc=adam.buchbinder@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=daniel.thompson@linaro.org \
    --cc=dave.long@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mhiramat@kernel.org \
    --cc=oleg@redhat.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=steve.capper@linaro.org \
    --cc=vijaya.kumar@caviumnetworks.com \
    --cc=wcohen@redhat.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.