]> git.hungrycats.org Git - linux/commit
libbpf: Fix accessing first syscall argument on RV64
authorPu Lehui <pulehui@huawei.com>
Sat, 31 Aug 2024 04:19:34 +0000 (04:19 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 5 Sep 2024 00:06:39 +0000 (17:06 -0700)
commit99857422338b67f0a2927cbc44fdaa8783717858
tree13dbe6c0a09c0a72703e1ca820e0c2bce3b62130
parent4a4c4c0d0a42079d2fa97a232895c56ac2f3f573
libbpf: Fix accessing first syscall argument on RV64

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. Let's fix it by using the struct pt_regs
style CO-RE direct access.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220209021745.2215452-1-iii@linux.ibm.com
Link: https://lore.kernel.org/bpf/20240831041934.1629216-5-pulehui@huaweicloud.com
tools/lib/bpf/bpf_tracing.h