linux/arch/riscv/kernel/probes
Xiaofeng Yuan 540ad5ad05 riscv: probes: simulate c.jal instruction
The c.jal instruction is currently marked REJECTED in kprobes
instruction decoding, but it should be SIMULATED like other
compressed jump instructions.

Add simulate_c_jal() which saves the return address to RA and
sets the program counter to the target offset, reusing
simulate_c_j for the common jump logic.

Although c.jal is RV32-only, the function compiles unconditionally.
On RV64, riscv_insn_is_c_jal() always returns 0, so the simulation
code is never invoked and the small overhead in kernel size is
acceptable.

Signed-off-by: Xiaofeng Yuan <xiaofengmian@163.com>
Reviewed-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Tested-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Tested-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/20260701081033.49871-2-xiaofengmian@163.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2026-08-07 19:24:29 -06:00
..
decode-insn.c riscv: probes: simulate c.jal instruction 2026-08-07 19:24:29 -06:00
decode-insn.h
kprobes.c riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
Makefile trace: riscv: Remove deprecated kprobe on ftrace support 2024-07-24 06:14:05 -07:00
rethook_trampoline.S riscv: probes: save original sp in rethook trampoline 2026-06-30 18:46:54 -06: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: probes: simulate c.jal instruction 2026-08-07 19:24:29 -06:00
simulate-insn.h riscv: probes: simulate c.jal instruction 2026-08-07 19:24:29 -06:00
uprobes.c riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00