Files
kernel_nothing_sm7325/include/linux
Tomislav Novak aadb178c51 hw_breakpoint: fix single-stepping when using bpf_overflow_handler
[ Upstream commit d11a69873d9a7435fe6a48531e165ab80a8b1221 ]

Arm platforms use is_default_overflow_handler() to determine if the
hw_breakpoint code should single-step over the breakpoint trigger or
let the custom handler deal with it.

Since bpf_overflow_handler() currently isn't recognized as a default
handler, attaching a BPF program to a PERF_TYPE_BREAKPOINT event causes
it to keep firing (the instruction triggering the data abort exception
is never skipped). For example:

  # bpftrace -e 'watchpoint:0x10000:4:w { print("hit") }' -c ./test
  Attaching 1 probe...
  hit
  hit
  [...]
  ^C

(./test performs a single 4-byte store to 0x10000)

This patch replaces the check with uses_default_overflow_handler(),
which accounts for the bpf_overflow_handler() case by also testing
if one of the perf_event_output functions gets invoked indirectly,
via orig_default_handler.

Signed-off-by: Tomislav Novak <tnovak@meta.com>
Tested-by: Samuel Gosselin <sgosselin@google.com> # arm64
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/linux-arm-kernel/20220923203644.2731604-1-tnovak@fb.com/
Link: https://lore.kernel.org/r/20230605191923.1219974-1-tnovak@meta.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 11:00:03 +02:00
..
2020-02-19 19:53:09 +01:00
2022-10-26 13:22:39 +02:00
2023-08-08 19:56:33 +02:00
2020-03-25 08:25:58 +01:00
2022-10-26 13:22:46 +02:00
2022-04-15 14:18:32 +02:00
2023-08-11 11:53:43 +02:00
2021-03-04 10:26:29 +01:00
2022-08-25 11:18:04 +02:00
2021-02-07 15:35:49 +01:00
2022-10-07 09:16:54 +02:00
2021-11-17 09:48:17 +01:00
2023-09-23 10:59:40 +02:00
2023-06-21 15:44:10 +02:00
2023-03-17 08:32:52 +01:00
2020-03-18 07:17:46 +01:00
2020-04-02 15:11:00 +02:00
2021-03-07 12:20:49 +01:00
2020-04-02 15:11:00 +02:00
2021-06-10 13:37:14 +02:00