[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240829133453.882259-3-pulehui@huaweicloud.com>
Date: Thu, 29 Aug 2024 13:34:53 +0000
From: Pu Lehui <pulehui@...weicloud.com>
To: bpf@...r.kernel.org,
linux-riscv@...ts.infradead.org,
netdev@...r.kernel.org
Cc: Björn Töpel <bjorn@...nel.org>,
Ilya Leoshkevich <iii@...ux.ibm.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Eduard Zingerman <eddyz87@...il.com>,
Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...gle.com>,
Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>,
Puranjay Mohan <puranjay@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>,
Pu Lehui <pulehui@...wei.com>
Subject: [PATCH bpf-next 2/2] selftests/bpf: Skip case involving first arg in bpf_syscall_macro on RV64
From: Pu Lehui <pulehui@...wei.com>
The RV64 architecture accesses the first system call argument only
through PT_REGS_PARM1_CORE_SYSCALL().
Signed-off-by: Pu Lehui <pulehui@...wei.com>
---
tools/testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c | 2 +-
tools/testing/selftests/bpf/progs/bpf_syscall_macro.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c b/tools/testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c
index 2900c5e9a016..5773ee4ef5ae 100644
--- a/tools/testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c
+++ b/tools/testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c
@@ -38,7 +38,7 @@ void test_bpf_syscall_macro(void)
/* check whether args of syscall are copied correctly */
prctl(exp_arg1, exp_arg2, exp_arg3, exp_arg4, exp_arg5);
-#if defined(__aarch64__) || defined(__s390__)
+#if defined(__aarch64__) || defined(__s390__) || (defined(__riscv) && __riscv_xlen == 64)
ASSERT_NEQ(skel->bss->arg1, exp_arg1, "syscall_arg1");
#else
ASSERT_EQ(skel->bss->arg1, exp_arg1, "syscall_arg1");
diff --git a/tools/testing/selftests/bpf/progs/bpf_syscall_macro.c b/tools/testing/selftests/bpf/progs/bpf_syscall_macro.c
index 1a476d8ed354..63232832c17a 100644
--- a/tools/testing/selftests/bpf/progs/bpf_syscall_macro.c
+++ b/tools/testing/selftests/bpf/progs/bpf_syscall_macro.c
@@ -43,7 +43,7 @@ int BPF_KPROBE(handle_sys_prctl)
/* test for PT_REGS_PARM */
-#if !defined(bpf_target_arm64) && !defined(bpf_target_s390)
+#if !defined(bpf_target_arm64) && !defined(bpf_target_s390) && !defined(bpf_target_riscv)
bpf_probe_read_kernel(&tmp, sizeof(tmp), &PT_REGS_PARM1_SYSCALL(real_regs));
#endif
arg1 = tmp;
--
2.34.1
Powered by blists - more mailing lists