Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Christophe Leroy and committed by
Michael Ellerman
ccbed90b da529d47

+16 -19
+16
arch/powerpc/kernel/hw_breakpoint.c
··· 429 429 { 430 430 /* TODO */ 431 431 } 432 + 433 + void ptrace_triggered(struct perf_event *bp, 434 + struct perf_sample_data *data, struct pt_regs *regs) 435 + { 436 + struct perf_event_attr attr; 437 + 438 + /* 439 + * Disable the breakpoint request here since ptrace has defined a 440 + * one-shot behaviour for breakpoint exceptions in PPC64. 441 + * The SIGTRAP signal is generated automatically for us in do_dabr(). 442 + * We don't have to do anything about that here 443 + */ 444 + attr = bp->attr; 445 + attr.disabled = true; 446 + modify_user_hw_breakpoint(bp, &attr); 447 + }
-19
arch/powerpc/kernel/ptrace/ptrace.c
··· 18 18 #include <linux/regset.h> 19 19 #include <linux/tracehook.h> 20 20 #include <linux/audit.h> 21 - #include <linux/hw_breakpoint.h> 22 21 #include <linux/context_tracking.h> 23 22 #include <linux/syscalls.h> 24 23 ··· 29 30 #include <trace/events/syscalls.h> 30 31 31 32 #include "ptrace-decl.h" 32 - 33 - #ifdef CONFIG_HAVE_HW_BREAKPOINT 34 - void ptrace_triggered(struct perf_event *bp, 35 - struct perf_sample_data *data, struct pt_regs *regs) 36 - { 37 - struct perf_event_attr attr; 38 - 39 - /* 40 - * Disable the breakpoint request here since ptrace has defined a 41 - * one-shot behaviour for breakpoint exceptions in PPC64. 42 - * The SIGTRAP signal is generated automatically for us in do_dabr(). 43 - * We don't have to do anything about that here 44 - */ 45 - attr = bp->attr; 46 - attr.disabled = true; 47 - modify_user_hw_breakpoint(bp, &attr); 48 - } 49 - #endif /* CONFIG_HAVE_HW_BREAKPOINT */ 50 33 51 34 /* 52 35 * Called by kernel/ptrace.c when detaching..