linux-loongson/arch/riscv/kernel/probes
Björn Töpel 7d1d19a11c
riscv: uprobes: Add missing fence.i after building the XOL buffer
The XOL (execute out-of-line) buffer is used to single-step the
replaced instruction(s) for uprobes. The RISC-V port was missing a
proper fence.i (i$ flushing) after constructing the XOL buffer, which
can result in incorrect execution of stale/broken instructions.

This was found running the BPF selftests "test_progs:
uprobe_autoattach, attach_probe" on the Spacemit K1/X60, where the
uprobes tests randomly blew up.

Reviewed-by: Guo Ren <guoren@kernel.org>
Fixes: 74784081aa ("riscv: Add uprobes supported")
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Link: https://lore.kernel.org/r/20250419111402.1660267-2-bjorn@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2025-04-24 13:20:02 -07:00
..
decode-insn.c riscv: kprobes: simulate c.beqz and c.bnez 2023-08-16 07:48:40 -07:00
decode-insn.h
kprobes.c riscv: kprobes: Fix incorrect address calculation 2025-01-08 10:39:39 -08:00
Makefile trace: riscv: Remove deprecated kprobe on ftrace support 2024-07-24 06:14:05 -07:00
rethook_trampoline.S riscv: Use SYM_*() assembly macros instead of deprecated ones 2023-11-06 09:42:47 -08:00
rethook.c riscv: add riscv rethook implementation 2022-12-02 13:04:05 -08:00
rethook.h riscv: add riscv rethook implementation 2022-12-02 13:04:05 -08:00
simulate-insn.c riscv: kprobes: allow writing to x0 2023-11-05 14:12:47 -08:00
simulate-insn.h riscv: kprobes: simulate c.beqz and c.bnez 2023-08-16 07:48:40 -07:00
uprobes.c riscv: uprobes: Add missing fence.i after building the XOL buffer 2025-04-24 13:20:02 -07:00