summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/kgdb.c
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2019-02-26 16:37:09 +0100
committerWill Deacon <will.deacon@arm.com>2019-04-09 12:21:13 +0200
commitfb610f2a2006322bebeb30408fefce6a01df09ea (patch)
treef9e6531415ddea6b10f2cb1c665291a5fabc70db /arch/arm64/kernel/kgdb.c
parentarm64: kprobes: Avoid calling kprobes debug handlers explicitly (diff)
downloadlinux-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/kgdb.c')
-rw-r--r--arch/arm64/kernel/kgdb.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/arm64/kernel/kgdb.c b/arch/arm64/kernel/kgdb.c
index 4c01f299aeb2..30853d5b7859 100644
--- a/arch/arm64/kernel/kgdb.c
+++ b/arch/arm64/kernel/kgdb.c
@@ -244,9 +244,6 @@ int kgdb_arch_handle_exception(int exception_vector, int signo,
static int kgdb_brk_fn(struct pt_regs *regs, unsigned int esr)
{
- if (user_mode(regs))
- return DBG_HOOK_ERROR;
-
kgdb_handle_exception(1, SIGTRAP, 0, regs);
return DBG_HOOK_HANDLED;
}
@@ -254,9 +251,6 @@ NOKPROBE_SYMBOL(kgdb_brk_fn)
static int kgdb_compiled_brk_fn(struct pt_regs *regs, unsigned int esr)
{
- if (user_mode(regs))
- return DBG_HOOK_ERROR;
-
compiled_break = 1;
kgdb_handle_exception(1, SIGTRAP, 0, regs);
@@ -266,7 +260,7 @@ NOKPROBE_SYMBOL(kgdb_compiled_brk_fn);
static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int esr)
{
- if (user_mode(regs) || !kgdb_single_step)
+ if (!kgdb_single_step)
return DBG_HOOK_ERROR;
kgdb_handle_exception(1, SIGTRAP, 0, regs);