diff options
author | Will Deacon <will.deacon@arm.com> | 2019-02-26 16:37:09 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2019-04-09 12:21:13 +0200 |
commit | fb610f2a2006322bebeb30408fefce6a01df09ea (patch) | |
tree | f9e6531415ddea6b10f2cb1c665291a5fabc70db /arch/arm64/kernel/probes/uprobes.c | |
parent | arm64: kprobes: Avoid calling kprobes debug handlers explicitly (diff) | |
download | linux-fb610f2a2006322bebeb30408fefce6a01df09ea.tar.xz linux-fb610f2a2006322bebeb30408fefce6a01df09ea.zip |
arm64: debug: Remove redundant user_mode(regs) checks from debug handlers
Now that the debug hook dispatching code takes the triggering exception
level into account, there's no need for the hooks themselves to poke
around with user_mode(regs).
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/probes/uprobes.c')
-rw-r--r-- | arch/arm64/kernel/probes/uprobes.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/arm64/kernel/probes/uprobes.c b/arch/arm64/kernel/probes/uprobes.c index 7d6ea88796a6..f37ab9567676 100644 --- a/arch/arm64/kernel/probes/uprobes.c +++ b/arch/arm64/kernel/probes/uprobes.c @@ -171,7 +171,7 @@ int arch_uprobe_exception_notify(struct notifier_block *self, static int uprobe_breakpoint_handler(struct pt_regs *regs, unsigned int esr) { - if (user_mode(regs) && uprobe_pre_sstep_notifier(regs)) + if (uprobe_pre_sstep_notifier(regs)) return DBG_HOOK_HANDLED; return DBG_HOOK_ERROR; @@ -182,13 +182,9 @@ static int uprobe_single_step_handler(struct pt_regs *regs, { struct uprobe_task *utask = current->utask; - if (user_mode(regs)) { - WARN_ON(utask && - (instruction_pointer(regs) != utask->xol_vaddr + 4)); - - if (uprobe_post_sstep_notifier(regs)) - return DBG_HOOK_HANDLED; - } + WARN_ON(utask && (instruction_pointer(regs) != utask->xol_vaddr + 4)); + if (uprobe_post_sstep_notifier(regs)) + return DBG_HOOK_HANDLED; return DBG_HOOK_ERROR; } |