summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPu Lehui <pulehui@huawei.com>2026-09-05 08:58:55 +0000
committerKumar Kartikeya Dwivedi <memxor@gmail.com>2026-09-06 16:25:52 +0200
commitf80a09c486e7c2a0e4ca43dbff7570df668484c5 (patch)
treee0917092c6688e4d9c7f682a9c82e650a7fc21db /tools
parent3ccdb07813829ba9487273e75d1cb238cfa774c1 (diff)
downloadlinux-next-f80a09c486e7c2a0e4ca43dbff7570df668484c5.tar.gz
linux-next-f80a09c486e7c2a0e4ca43dbff7570df668484c5.zip
riscv, bpf: Remap BPF_REG_0 and RV_REG_TCC
To prepare for supporting bpf stack arguments and unifying the calling convention between bpf2bpf calls and kfunc calls, remap BPF_REG_0 to t6 and RV_REG_TCC to t5. In the riscv abi, a0-a7 are designated for function argument passing. Freeing a5 and a6 allows bpf2bpf calls to pass extra arguments (6th to 8th) via a5-a7 consistently with kfuncs. Signed-off-by: Pu Lehui <pulehui@huawei.com> Acked-by: Björn Töpel <bjorn@kernel.org> Link: https://lore.kernel.org/bpf/20260905085857.14143-2-pulehui@huaweicloud.com Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/progs/verifier_jit_inline.c2
-rw-r--r--tools/testing/selftests/bpf/progs/verifier_ldsx.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/progs/verifier_jit_inline.c b/tools/testing/selftests/bpf/progs/verifier_jit_inline.c
index 02e562f56f9d..5b92da2ab75c 100644
--- a/tools/testing/selftests/bpf/progs/verifier_jit_inline.c
+++ b/tools/testing/selftests/bpf/progs/verifier_jit_inline.c
@@ -11,7 +11,7 @@ __jited(" addq %gs:{{.*}}, %rax")
__arch_arm64
__jited(" mrs x8, SP_EL0")
__arch_riscv64
-__jited(" mv a5, tp")
+__jited(" mv t6, tp")
__arch_loongarch
__jited(" move $a5, $tp")
int inline_bpf_get_current_task(void)
diff --git a/tools/testing/selftests/bpf/progs/verifier_ldsx.c b/tools/testing/selftests/bpf/progs/verifier_ldsx.c
index 7e25e1b8cd0b..49e8cd4bb4f9 100644
--- a/tools/testing/selftests/bpf/progs/verifier_ldsx.c
+++ b/tools/testing/selftests/bpf/progs/verifier_ldsx.c
@@ -289,11 +289,11 @@ __jited("ldrsh x22, [x11, #0x18]")
__jited("add x11, x0, x28")
__jited("ldrsb x22, [x11, #0x20]")
__arch_riscv64
-__jited("add t2, a5, s7")
+__jited("add t2, t6, s7")
__jited("lw s3, 0x10(t2)")
-__jited("add t2, a5, s7")
+__jited("add t2, t6, s7")
__jited("lh s3, 0x18(t2)")
-__jited("add t2, a5, s7")
+__jited("add t2, t6, s7")
__jited("lb s3, 0x20(t2)")
__jited("add t2, a0, s7")
__jited("lw s4, 0x10(t2)")