android_kernel_xiaomi_sm8450/include
Tomislav Novak 020ecfa7b6 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:01:05 +02:00
..
acpi ACPI: APEI: explicit init of HEST and GHES in apci_init() 2023-09-19 12:20:28 +02:00
asm-generic word-at-a-time: use the same return type for has_zero regardless of endianness 2023-08-11 11:57:47 +02:00
clocksource clocksource/drivers/timer-ti-dm: Save and restore timer TIOCP_CFG 2021-07-14 16:56:12 +02:00
crypto crypto: api - Use work queue in crypto_destroy_instance 2023-09-19 12:20:08 +02:00
drm drm/display/dp: Fix the DP DSC Receiver cap size 2023-08-30 16:23:16 +02:00
dt-bindings dt-bindings: iio: add AD74413R 2023-08-26 15:26:47 +02:00
keys certs: Add EFI_CERT_X509_GUID support for dbx entries 2021-06-30 08:47:30 -04:00
kunit kunit: fix display of failed expectations for strings 2020-11-10 13:45:15 -07:00
kvm
linux hw_breakpoint: fix single-stepping when using bpf_overflow_handler 2023-09-23 11:01:05 +02:00
math-emu
media media: v4l2-mem2mem: add lock to protect parameter num_rdy 2023-08-26 15:26:44 +02:00
memory memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual Mode 2022-05-09 09:05:02 +02:00
misc
net ipv6: fix ip6_sock_set_addr_preferences() typo 2023-09-19 12:20:30 +02:00
pcmcia
ras
rdma RDMA/cma: Always set static rate to 0 for RoCE 2023-06-21 15:45:39 +02:00
scsi scsi: core: Use 32-bit hostnum in scsi_host_lookup() 2023-09-19 12:20:19 +02:00
soc firmware: raspberrypi: Introduce devm_rpi_firmware_get() 2023-05-17 11:48:02 +02:00
sound ASoC: soc-pcm: test if a BE can be prepared 2023-06-21 15:45:36 +02:00
target scsi: target: Fix multiple LUN_RESET handling 2023-05-17 11:47:48 +02:00
trace tracing: Show real address for trace event arguments 2023-08-11 11:57:33 +02:00
uapi dma-buf/sync_file: Fix docs syntax 2023-09-19 12:20:18 +02:00
vdso
video video: of_display_timing.h: include errno.h 2022-07-12 16:32:19 +02:00
xen ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-17 11:47:42 +02:00