diff options
author | Benjamin Gray <bgray@linux.ibm.com> | 2023-08-01 11:17:38 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-08-16 23:54:50 +1000 |
commit | 8f8f1cd67aa026c9dab8eb4e087e4a2d8fa9d5bc (patch) | |
tree | e8ae25bfe8ca3ce1bacab5cd24de6bf375349f5d | |
parent | 8df99066940b6c82a0851f13adf653827dc524f7 (diff) |
powerpc/watchpoints: Explain thread_change_pc() more
The behaviour of the thread_change_pc() function is a bit cryptic
without being more familiar with how the watchpoint logic handles
perf's after-execute semantics.
Expand the comment to explain why we can re-insert the breakpoint and
unset the perf_single_step flag.
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230801011744.153973-2-bgray@linux.ibm.com
-rw-r--r-- | arch/powerpc/kernel/hw_breakpoint.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index e1b4e70c8fd0..bad2991f906b 100644 --- a/arch/powerpc/kernel/hw_breakpoint.c +++ b/arch/powerpc/kernel/hw_breakpoint.c @@ -499,6 +499,10 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, * Restores the breakpoint on the debug registers. * Invoke this function if it is known that the execution context is * about to change to cause loss of MSR_SE settings. + * + * The perf watchpoint will simply re-trigger once the thread is started again, + * and the watchpoint handler will set up MSR_SE and perf_single_step as + * needed. */ void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs) { |