riscv: kprobes: simulate nop and c.nop instructions
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | riscv: kprobes: simulate nop and c.nop instructionsarch/ arch/ arch/ +1 more | +33 | 1 reply | |
| 2/2 | riscv: kprobes: add nop and c.nop to the KUnit testarch/ | +27 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] riscv: kprobes: simulate nop and c.nop instructions
nop and c.nop have no architectural effect, so handling them through an out-of-line instruction slot and single-stepping is pure overhead. This series simulates them directly in the breakpoint handler by advancing the program counter, following the approach already used on arm64, and extends the RISC-V kprobes KUnit test to cover both paths.
Patch 1 adds the simulation. Patch 2 extends the KUnit test with test_kprobes_nop and test_kprobes_c_nop.
Verified by cross-compiling for RISC-V and running the kprobes KUnit test in QEMU (ok 1 kprobes_riscv).
Xiaofeng Yuan (2):
riscv: kprobes: simulate nop and c.nop instructions
riscv: kprobes: add nop and c.nop to the KUnit test
arch/riscv/include/asm/insn.h | 11 ++++++++ arch/riscv/kernel/probes/decode-insn.c | 6 +++++ arch/riscv/kernel/probes/simulate-insn.c | 14 ++++++++++ arch/riscv/kernel/probes/simulate-insn.h | 2 ++ .../kernel/tests/kprobes/test-kprobes-asm.S | 27 +++++++++++++++++++ 5 files changed, 60 insertions(+)
Signature · 7 lines
2.43.0 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv