On architectures that are not using a syscall wrapper, syscall parameters can be accessed directly from the bpf prog ctx. Fix bpf_syscall_macro prog accordingly. Fixes: 77fc0330dfe5ab ("selftests/bpf: Add a test to confirm PT_REGS_PARM4_SYSCALL") Signed-off-by: Naveen N. Rao <naveen.n.rao@xxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/bpf/progs/bpf_syscall_macro.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/bpf_syscall_macro.c b/tools/testing/selftests/bpf/progs/bpf_syscall_macro.c index c8e60220cda855..12ec4b71f14aeb 100644 --- a/tools/testing/selftests/bpf/progs/bpf_syscall_macro.c +++ b/tools/testing/selftests/bpf/progs/bpf_syscall_macro.c @@ -32,7 +32,11 @@ int BPF_KPROBE(handle_sys_prctl) if (pid != filter_pid) return 0; +#if SYSCALL_WRAPPER == 1 real_regs = (struct pt_regs *)PT_REGS_PARM1(ctx); +#else + real_regs = (struct pt_regs *)ctx; +#endif /* test for PT_REGS_PARM */ bpf_probe_read_kernel(&arg1, sizeof(arg1), &PT_REGS_PARM1_SYSCALL(real_regs)); -- 2.34.1