]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/bpf: Enable test_bpf_syscall_macro: Syscall_arg1 on s390 and arm64
authorPu Lehui <pulehui@huawei.com>
Sat, 31 Aug 2024 04:19:33 +0000 (04:19 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 5 Sep 2024 00:06:09 +0000 (17:06 -0700)
Considering that CO-RE direct read access to the first system call
argument is already available on s390 and arm64, let's enable
test_bpf_syscall_macro:syscall_arg1 on these architectures.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240831041934.1629216-4-pulehui@huaweicloud.com
tools/testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c
tools/testing/selftests/bpf/progs/bpf_syscall_macro.c

index 2900c5e9a016fc343774d1988444f91f97a74408..1750c29b94f82741ef47e73bb695521a571be80d 100644 (file)
@@ -38,11 +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__)
-       ASSERT_NEQ(skel->bss->arg1, exp_arg1, "syscall_arg1");
-#else
        ASSERT_EQ(skel->bss->arg1, exp_arg1, "syscall_arg1");
-#endif
        ASSERT_EQ(skel->bss->arg2, exp_arg2, "syscall_arg2");
        ASSERT_EQ(skel->bss->arg3, exp_arg3, "syscall_arg3");
        /* it cannot copy arg4 when uses PT_REGS_PARM4 on x86_64 */
index 1a476d8ed35421298bf52cd4699d2490fc0dfe3d..9e7d9674ce2a4cfbc7528f758c1ffc4e9dcd0d5f 100644 (file)
@@ -43,9 +43,7 @@ int BPF_KPROBE(handle_sys_prctl)
 
        /* test for PT_REGS_PARM */
 
-#if !defined(bpf_target_arm64) && !defined(bpf_target_s390)
        bpf_probe_read_kernel(&tmp, sizeof(tmp), &PT_REGS_PARM1_SYSCALL(real_regs));
-#endif
        arg1 = tmp;
        bpf_probe_read_kernel(&arg2, sizeof(arg2), &PT_REGS_PARM2_SYSCALL(real_regs));
        bpf_probe_read_kernel(&arg3, sizeof(arg3), &PT_REGS_PARM3_SYSCALL(real_regs));