Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Enable test_bpf_syscall_macro: Syscall_arg1 on s390 and arm64

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

authored by

Pu Lehui and committed by
Andrii Nakryiko
4a4c4c0d 9ab94078

-6
-4
tools/testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c
··· 38 38 /* check whether args of syscall are copied correctly */ 39 39 prctl(exp_arg1, exp_arg2, exp_arg3, exp_arg4, exp_arg5); 40 40 41 - #if defined(__aarch64__) || defined(__s390__) 42 - ASSERT_NEQ(skel->bss->arg1, exp_arg1, "syscall_arg1"); 43 - #else 44 41 ASSERT_EQ(skel->bss->arg1, exp_arg1, "syscall_arg1"); 45 - #endif 46 42 ASSERT_EQ(skel->bss->arg2, exp_arg2, "syscall_arg2"); 47 43 ASSERT_EQ(skel->bss->arg3, exp_arg3, "syscall_arg3"); 48 44 /* it cannot copy arg4 when uses PT_REGS_PARM4 on x86_64 */
-2
tools/testing/selftests/bpf/progs/bpf_syscall_macro.c
··· 43 43 44 44 /* test for PT_REGS_PARM */ 45 45 46 - #if !defined(bpf_target_arm64) && !defined(bpf_target_s390) 47 46 bpf_probe_read_kernel(&tmp, sizeof(tmp), &PT_REGS_PARM1_SYSCALL(real_regs)); 48 - #endif 49 47 arg1 = tmp; 50 48 bpf_probe_read_kernel(&arg2, sizeof(arg2), &PT_REGS_PARM2_SYSCALL(real_regs)); 51 49 bpf_probe_read_kernel(&arg3, sizeof(arg3), &PT_REGS_PARM3_SYSCALL(real_regs));