diff options
| author | Pu Lehui <pulehui@huawei.com> | 2026-09-30 06:49:28 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-10-11 13:35:13 +0000 |
| commit | 530dfafc61075098046e5bb042d8366120f3cc32 (patch) | |
| tree | 4f8e6581a6736e7a3de402279b8e9780d3247940 /tools | |
| parent | 1cec0b70fdc678d6c0252f3f25e23df0b5a5e49c (diff) | |
selftests/bpf: Enable callx related testcases for RV64
Enable callx bpf selftests for RV64 now that the RV64 JIT supports
indirect calls to subprogs.
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260930064928.1909085-3-pulehui@huaweicloud.com
Diffstat (limited to 'tools')
4 files changed, 8 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c b/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c index 42b33d5876b1..cc63b84e4d94 100644 --- a/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c +++ b/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c @@ -8,7 +8,8 @@ #include <linux/filter.h> #include <bpf/btf.h> -#if defined(__x86_64__) || defined(__aarch64__) +#if defined(__x86_64__) || defined(__aarch64__) || \ + (defined(__riscv) && __riscv_xlen == 64) #define CALLEE_INSN 6 #define DATA 0x1234 diff --git a/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c b/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c index fc5181c5b5ba..f6ef67c3141e 100644 --- a/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c +++ b/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c @@ -3,7 +3,8 @@ #include "callx_rodata.lskel.h" -#if defined(__x86_64__) || defined(__aarch64__) +#if defined(__x86_64__) || defined(__aarch64__) || \ + (defined(__riscv) && __riscv_xlen == 64) static void run(int prog_fd, int expected, const char *name) { diff --git a/tools/testing/selftests/bpf/progs/verifier_callx.c b/tools/testing/selftests/bpf/progs/verifier_callx.c index bc31d0221f6a..7e59188d9fca 100644 --- a/tools/testing/selftests/bpf/progs/verifier_callx.c +++ b/tools/testing/selftests/bpf/progs/verifier_callx.c @@ -7,7 +7,8 @@ #include "../../../include/linux/filter.h" /* gcc doesn't support indirect calls */ -#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && defined(__clang__) +#if defined(__clang__) && (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \ + (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) #define CALLX_INSN(DST, SRC, OFF, IMM) \ BPF_RAW_INSN(BPF_JMP | BPF_CALL | BPF_X, DST, SRC, OFF, IMM) diff --git a/tools/testing/selftests/bpf/progs/verifier_callx_rodata.c b/tools/testing/selftests/bpf/progs/verifier_callx_rodata.c index 3e7a1c2c2a9a..6cf58ca9ac5b 100644 --- a/tools/testing/selftests/bpf/progs/verifier_callx_rodata.c +++ b/tools/testing/selftests/bpf/progs/verifier_callx_rodata.c @@ -7,7 +7,8 @@ #include "../../../include/linux/filter.h" /* gcc doesn't support indirect calls */ -#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && defined(__clang__) +#if defined(__clang__) && (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \ + (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) /* * Read-only data with pointers to functions, where the compiler puts tables |
