summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/hw_breakpoint.c
diff options
context:
space:
mode:
authorBenjamin Gray <bgray@linux.ibm.com>2023-08-01 11:17:41 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2023-08-16 23:54:50 +1000
commit5a2d8b9c06712b52b2f0f2fc9a144242277fda74 (patch)
tree0e4a79b367b9f6ab2ac3592d75da9dfc7bf5e8bb /arch/powerpc/kernel/hw_breakpoint.c
parent1e60f3564bad09962646bf8c2af588ecf518d337 (diff)
powerpc/watchpoints: Simplify watchpoint reinsertion
We only remove watchpoints when they have the perf_single_step flag set, so we can reinsert them during the first iteration. Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230801011744.153973-5-bgray@linux.ibm.com
Diffstat (limited to 'arch/powerpc/kernel/hw_breakpoint.c')
-rw-r--r--arch/powerpc/kernel/hw_breakpoint.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 624375c18882..bf8dda1a7e04 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -772,16 +772,6 @@ static int single_step_dabr_instruction(struct die_args *args)
perf_bp_event(bp, regs);
info->perf_single_step = false;
- }
-
- if (!found)
- return NOTIFY_DONE;
-
- for (int i = 0; i < nr_wp_slots(); i++) {
- struct perf_event *bp = __this_cpu_read(bp_per_reg[i]);
- if (!bp)
- continue;
-
__set_breakpoint(i, counter_arch_bp(bp));
}
@@ -789,7 +779,7 @@ static int single_step_dabr_instruction(struct die_args *args)
* If the process was being single-stepped by ptrace, let the
* other single-step actions occur (e.g. generate SIGTRAP).
*/
- if (test_thread_flag(TIF_SINGLESTEP))
+ if (!found || test_thread_flag(TIF_SINGLESTEP))
return NOTIFY_DONE;
return NOTIFY_STOP;