mbox series

[bpf-next,0/2] Fix accessing first syscall argument on RV64

Message ID 20240829133253.882133-1-pulehui@huaweicloud.com (mailing list archive)
Headers show
Series Fix accessing first syscall argument on RV64 | expand

Message

Pu Lehui Aug. 29, 2024, 1:32 p.m. UTC
On RV64, as Ilya mentioned before [0], the first syscall parameter should be
accessed through orig_a0 (see arch/riscv64/include/asm/syscall.h),
otherwise it will cause selftests like bpf_syscall_macro, vmlinux,
test_lsm, etc. to fail on RV64.

Link: https://lore.kernel.org/bpf/20220209021745.2215452-1-iii@linux.ibm.com [0]

Pu Lehui (2):
  libbpf: Fix accessing first syscall argument on RV64
  selftests/bpf: Skip case involving first arg in bpf_syscall_macro on
    RV64

 tools/lib/bpf/bpf_tracing.h                              | 9 ++++++++-
 .../selftests/bpf/prog_tests/test_bpf_syscall_macro.c    | 2 +-
 tools/testing/selftests/bpf/progs/bpf_syscall_macro.c    | 2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

Comments

Pu Lehui Aug. 29, 2024, 1:35 p.m. UTC | #1
On 2024/8/29 21:32, Pu Lehui wrote:
> On RV64, as Ilya mentioned before [0], the first syscall parameter should be
> accessed through orig_a0 (see arch/riscv64/include/asm/syscall.h),
> otherwise it will cause selftests like bpf_syscall_macro, vmlinux,
> test_lsm, etc. to fail on RV64.
> 
> Link: https://lore.kernel.org/bpf/20220209021745.2215452-1-iii@linux.ibm.com [0]
> 
> Pu Lehui (2):
>    libbpf: Fix accessing first syscall argument on RV64
>    selftests/bpf: Skip case involving first arg in bpf_syscall_macro on
>      RV64
> 
>   tools/lib/bpf/bpf_tracing.h                              | 9 ++++++++-
>   .../selftests/bpf/prog_tests/test_bpf_syscall_macro.c    | 2 +-
>   tools/testing/selftests/bpf/progs/bpf_syscall_macro.c    | 2 +-
>   3 files changed, 10 insertions(+), 3 deletions(-)
> 

There was an error in sending this time. A new one has been sent. Sorry 
for the noise.