[PW_SID:1118353] Mixing bpf2bpf and tailcalls for RV64#2163
[PW_SID:1118353] Mixing bpf2bpf and tailcalls for RV64#2163linux-riscv-bot wants to merge 7 commits into
Conversation
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>
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 1: "[bpf-next,v4,1/6] bpf: Extract the is_struct_ops_tramp helper" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 2: "[bpf-next,v4,2/6] riscv, bpf: Remove redundant ctx->offset initialization" |
|
Patch 4: "[bpf-next,v4,4/6] riscv, bpf: Add RV_TAILCALL_OFFSET macro to format tailcall offset" |
|
Patch 4: "[bpf-next,v4,4/6] riscv, bpf: Add RV_TAILCALL_OFFSET macro to format tailcall offset" |
|
Patch 4: "[bpf-next,v4,4/6] riscv, bpf: Add RV_TAILCALL_OFFSET macro to format tailcall offset" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 5: "[bpf-next,v4,5/6] riscv, bpf: Mixing bpf2bpf and tailcalls" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
|
Patch 6: "[bpf-next,v4,6/6] selftests/bpf: Remove tailcalls tests from DENYLIST.riscv64" |
4d827ba to
89be0ce
Compare
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