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

From: Charlie Jenkins

Date: Sat Jun 27 2026 - 00:21:58 EST


On Sat, 27 Jun 2026 00:19:39 +0000, Xiaofeng Yuan <xiaofengmian@xxxxxxx> 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