[PATCH v4] riscv: probes: simulate c.jal instruction

Charlie Jenkins thecharlesjenkins at gmail.com
Fri Jun 26 21:21:36 PDT 2026


On Sat, 27 Jun 2026 00:19:39 +0000, Xiaofeng Yuan <xiaofengmian at 163.com> wrote:
> 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.

I was looking at this recently trying to figure out why this hadn't been
implemented and couldn't determine why this one was special, it might be
because it is 32-bit only. Since it is 32-bit only, can you put ifdefs
around it for riscv32 (#if __riscv_xlen == 32) ?

Can you also add a test case to:
arch/riscv/kernel/tests/kprobes/test-kprobes-asm.S?

- Charlie

-- 
- Charlie




More information about the linux-riscv mailing list