Skip to content

[PW_SID:1147007] bpf, riscv: Add support for signed arena loads - #2481

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1147007
Closed

[PW_SID:1147007] bpf, riscv: Add support for signed arena loads#2481
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1147007

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1147007 applied to workflow__riscv__fixes

Name: bpf, riscv: Add support for signed arena loads
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1147007
Version: 1

cp0613 added 2 commits August 17, 2026 07:52
Signed loads from arena memory are currently rejected on riscv64, as
bpf_jit_supports_insn() refuses BPF_MEMSX loads when in_arena is set,
while x86 and arm64 gained support for them in v6.18. Compilers such
as GCC-14 are free to generate signed loads into arena memory, which
breaks loading of otherwise valid BPF programs on riscv64.

Implement BPF_PROBE_MEM32SX support in the RV64 JIT by reusing the
existing arena handling: the arena base (RV_REG_ARENA) is added to
the source register and the load is emitted with sign extension
(lb/lh/lw). Add BPF_PROBE_MEM32SX to the add_exception_handler()
mode gate so that faulting loads get an exception table entry which
clears the destination register and resumes execution.

Verified by running the arena LDSX selftests (arena_ldsx_disasm,
arena_ldsx_exception, arena_ldsx_s8/s16/s32) on riscv64 QEMU, all
passing.

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Now that the riscv64 JIT supports signed arena loads
(BPF_PROBE_MEM32SX), enable the arena LDSX tests on riscv64:
add JIT disassembly assertions for arena_ldsx_disasm (arena base in
s7, add into t2, sign-extending lw/lh/lb loads) and run
arena_ldsx_exception and arena_ldsx_s8/s16/s32 on riscv64.

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 143.40 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1459.75 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1737.37 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 29.34 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 29.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.39 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 88.11 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.34 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
kdoc
Desc: Detects for kdoc errors
Duration: 1.57 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
module-param
Desc: Detect module_param changes
Duration: 1.87 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 1.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,1/2] bpf, riscv: Add support for signed arena loads"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.38 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 143.72 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1135.77 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1416.01 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 27.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 30.59 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.36 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 87.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
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 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,2/2] selftests/bpf: Enable arena LDSX tests for riscv64"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.40 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot deleted the pw1147007 branch August 19, 2026 09:31
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.

2 participants