Skip to content

[PW_SID:1118353] Mixing bpf2bpf and tailcalls for RV64#2163

Closed
linux-riscv-bot wants to merge 7 commits into
workflow__riscv__fixesfrom
pw1118353
Closed

[PW_SID:1118353] Mixing bpf2bpf and tailcalls for RV64#2163
linux-riscv-bot wants to merge 7 commits into
workflow__riscv__fixesfrom
pw1118353

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1118353 applied to workflow__riscv__fixes

Name: Mixing bpf2bpf and tailcalls for RV64
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1118353
Version: 4

Linux RISC-V bot and others added 7 commits June 25, 2026 20:36
Extract the is_struct_ops_tramp helper, and use it in riscv and loongarch
as the current checks are somewhat hacky.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
There is no gain in initializing ctx->offset and prev_insns, and
ctx->offset is already zero-initialized. Let's remove this code.

Acked-by: Björn Töpel <bjorn@kernel.org>
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
It is unnecessary to allocate continuous physical memory for cache
buffer, and when ebpf program is too large, it may cause memory
allocation failure.

Acked-by: Björn Töpel <bjorn@kernel.org>
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add RV_TAILCALL_OFFSET macro to format tailcall offset, and correct the
relevant comments.

Acked-by: Björn Töpel <bjorn@kernel.org>
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
In the current RV64 JIT, if we just don't initialize the TCC in subprog,
the TCC can be propagated from the parent process to the subprocess, but
the updated TCC of the parent process cannot be restored when the
subprocess exits. Since the RV64 TCC is initialized before saving the
callee saved registers into the stack, we cannot use the callee saved
register to pass the TCC, otherwise the original value of the callee
saved register will be destroyed. So we implemented mixing bpf2bpf and
tailcalls similar to x86_64, i.e. using a non-callee saved register to
transfer the TCC between functions, and saving that register to the
stack to protect the TCC value. As for the tailcall hierarchy issue,
inspired by the s390's low-overhead approach, we store TCC from
RV_REG_TCC back to stack after calling bpf2bpf call or calling orig bpf
func in bpf trampoline.

Tests test_bpf.ko and test_verifier have passed, as well as the relative
testcases of test_progs*.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Remove tailcalls tests from DENYLIST.riscv64.

Signed-off-by: Pu Lehui <pulehui@huawei.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,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 154.17 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1805.81 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2233.98 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 30.01 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 31.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.58 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 89.00 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.53 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
kdoc
Desc: Detects for kdoc errors
Duration: 1.11 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
module-param
Desc: Detect module_param changes
Duration: 0.54 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.42 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.45 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 152.44 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1471.84 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1798.00 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 60.25 seconds
Result: PENDING

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 50.45 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 21.65 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 89.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 1.16 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
kdoc
Desc: Detects for kdoc errors
Duration: 1.62 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
module-param
Desc: Detect module_param changes
Duration: 1.09 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 1.04 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[bpf-next,v4,4/6] riscv, bpf: Add RV_TAILCALL_OFFSET macro to format tailcall offset"
module-param
Desc: Detect module_param changes
Duration: 0.97 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[bpf-next,v4,4/6] riscv, bpf: Add RV_TAILCALL_OFFSET macro to format tailcall offset"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.76 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[bpf-next,v4,4/6] riscv, bpf: Add RV_TAILCALL_OFFSET macro to format tailcall offset"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.66 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 152.17 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1466.79 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1760.70 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 29.79 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 30.70 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 88.73 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.52 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
kdoc
Desc: Detects for kdoc errors
Duration: 1.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
module-param
Desc: Detect module_param changes
Duration: 0.51 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.47 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.62 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 151.92 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1173.49 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1456.47 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 29.73 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 31.59 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 87.13 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.54 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
kdoc
Desc: Detects for kdoc errors
Duration: 1.53 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
module-param
Desc: Detect module_param changes
Duration: 0.45 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.35 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.46 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow__riscv__fixes branch from 4d827ba to 89be0ce Compare July 1, 2026 03:48
@linux-riscv-bot
linux-riscv-bot deleted the pw1118353 branch July 7, 2026 00:07
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.

1 participant