diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2020-02-28 01:14:49 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-04-01 05:30:49 +0200 |
commit | ccbed90b8207851fa759e81cc9ab083f9b6496c1 (patch) | |
tree | ac8b5e2255c1c7c4d791c0443a3ef061ede06c60 /arch/powerpc | |
parent | powerpc/ptrace: create ppc_gethwdinfo() (diff) | |
download | linux-ccbed90b8207851fa759e81cc9ab083f9b6496c1.tar.xz linux-ccbed90b8207851fa759e81cc9ab083f9b6496c1.zip |
powerpc/ptrace: move ptrace_triggered() into hw_breakpoint.c
ptrace_triggered() is declared in asm/hw_breakpoint.h and
only needed when CONFIG_HW_BREAKPOINT is set, so move it
into hw_breakpoint.c
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/8402c516023da1371953a65af7df2008758ea0c4.1582848567.git.christophe.leroy@c-s.fr
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/hw_breakpoint.c | 16 | ||||
-rw-r--r-- | arch/powerpc/kernel/ptrace/ptrace.c | 19 |
2 files changed, 16 insertions, 19 deletions
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index d0854320bb50..72f461bd70fb 100644 --- a/arch/powerpc/kernel/hw_breakpoint.c +++ b/arch/powerpc/kernel/hw_breakpoint.c @@ -429,3 +429,19 @@ void hw_breakpoint_pmu_read(struct perf_event *bp) { /* TODO */ } + +void ptrace_triggered(struct perf_event *bp, + struct perf_sample_data *data, struct pt_regs *regs) +{ + struct perf_event_attr attr; + + /* + * Disable the breakpoint request here since ptrace has defined a + * one-shot behaviour for breakpoint exceptions in PPC64. + * The SIGTRAP signal is generated automatically for us in do_dabr(). + * We don't have to do anything about that here + */ + attr = bp->attr; + attr.disabled = true; + modify_user_hw_breakpoint(bp, &attr); +} diff --git a/arch/powerpc/kernel/ptrace/ptrace.c b/arch/powerpc/kernel/ptrace/ptrace.c index a44f6e5e05ff..f6e51be47c6e 100644 --- a/arch/powerpc/kernel/ptrace/ptrace.c +++ b/arch/powerpc/kernel/ptrace/ptrace.c @@ -18,7 +18,6 @@ #include <linux/regset.h> #include <linux/tracehook.h> #include <linux/audit.h> -#include <linux/hw_breakpoint.h> #include <linux/context_tracking.h> #include <linux/syscalls.h> @@ -31,24 +30,6 @@ #include "ptrace-decl.h" -#ifdef CONFIG_HAVE_HW_BREAKPOINT -void ptrace_triggered(struct perf_event *bp, - struct perf_sample_data *data, struct pt_regs *regs) -{ - struct perf_event_attr attr; - - /* - * Disable the breakpoint request here since ptrace has defined a - * one-shot behaviour for breakpoint exceptions in PPC64. - * The SIGTRAP signal is generated automatically for us in do_dabr(). - * We don't have to do anything about that here - */ - attr = bp->attr; - attr.disabled = true; - modify_user_hw_breakpoint(bp, &attr); -} -#endif /* CONFIG_HAVE_HW_BREAKPOINT */ - /* * Called by kernel/ptrace.c when detaching.. * |