Skip to content

[PW_SID:1119531] riscv: add c.jal instruction simulation for kprobes#2184

Closed
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1119531
Closed

[PW_SID:1119531] riscv: add c.jal instruction simulation for kprobes#2184
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1119531

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1119531 applied to workflow__riscv__fixes

Name: riscv: add c.jal instruction simulation for kprobes
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1119531
Version: 6

Linux RISC-V bot and others added 3 commits July 1, 2026 03:48
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>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add a test case validating that kprobes correctly simulates the
c.jal instruction on RV32.

The test uses two probe points: a forward c.jal and a backward
c.jal, and verifies that the containing function returns the
expected magic value KPROBE_TEST_MAGIC after kprobe interception.

Co-developed-by: Xiaofeng Yuan <xiaofengmian@163.com>
Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Xiaofeng Yuan <xiaofengmian@163.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 120.91 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1418.11 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1707.42 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 22.56 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 24.13 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.08 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 79.85 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
kdoc
Desc: Detects for kdoc errors
Duration: 0.72 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
module-param
Desc: Detect module_param changes
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] riscv: probes: simulate c.jal instruction"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 119.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1168.63 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1433.94 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 22.04 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.59 seconds
Result: WARNING
Output:

WARNING: Co-developed-by and Signed-off-by: name/email do not match
#14: 
Co-developed-by: Xiaofeng Yuan <xiaofengmian@163.com>
Signed-off-by: Nam Cao <namcao@linutronix.de>

total: 0 errors, 1 warnings, 0 checks, 42 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit db3a26b5861d ("riscv: kprobes: add test case for c.jal instruction simulation") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 0 checks, 42 lines checked
WARNING: Co-developed-by and Signed-off-by: name/email do not match


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 81.68 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
kdoc
Desc: Detects for kdoc errors
Duration: 0.72 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
module-param
Desc: Detect module_param changes
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] riscv: kprobes: add test case for c.jal instruction simulation"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow__riscv__fixes branch from 89be0ce to dc5ff20 Compare July 7, 2026 03:25
@linux-riscv-bot
linux-riscv-bot deleted the pw1119531 branch July 8, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants