aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPratyush Anand <panand@redhat.com>2014-12-25 17:46:28 +0530
committerSteve Capper <steve.capper@linaro.org>2015-01-27 16:46:20 +0000
commit807ee93f2284c4dcb629e66717710b16b3fabb09 (patch)
treeedbdd2bb6a840076f4497403e272441fe5b93e35
parent5e4960f2fc4fae65c055ed96043440bdb6f21e4e (diff)
downloadlinux-807ee93f2284c4dcb629e66717710b16b3fabb09.tar.gz
ARM64: Handle TRAP_HWBRKPT for user mode as well
uprobe registers a handler at step_hook. So, single_step_handler now checks for user mode as well if there is a valid hook. Signed-off-by: Pratyush Anand <panand@redhat.com>
-rw-r--r--arch/arm64/kernel/debug-monitors.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index b056369fd47..2676b865524 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -236,6 +236,9 @@ static int single_step_handler(unsigned long addr, unsigned int esr,
if (!reinstall_suspended_bps(regs))
return 0;
+ if (call_step_hook(regs, esr) == DBG_HOOK_HANDLED)
+ return 0;
+
if (user_mode(regs)) {
info.si_signo = SIGTRAP;
info.si_errno = 0;
@@ -251,9 +254,6 @@ static int single_step_handler(unsigned long addr, unsigned int esr,
*/
user_rewind_single_step(current);
} else {
- if (call_step_hook(regs, esr) == DBG_HOOK_HANDLED)
- return 0;
-
pr_warning("Unexpected kernel single-step exception at EL1\n");
/*
* Re-enable stepping since we know that we will be