summaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2022-02-09 05:17:41 +0300
committerAndrii Nakryiko <andrii@kernel.org>2022-02-09 08:16:14 +0300
commitcf0b5b2769233b026cfa41206109dea77b0d17e3 (patch)
tree4c3c7c2bc38e6b654c7dfb4efe2cb58701add523 /tools/lib
parent5c101153bfd67387ba159b7864176217a40757da (diff)
downloadlinux-cf0b5b2769233b026cfa41206109dea77b0d17e3.tar.xz
libbpf: Fix accessing syscall arguments on riscv
riscv does not select ARCH_HAS_SYSCALL_WRAPPER, so its syscall handlers take "unpacked" syscall arguments. Indicate this to libbpf using PT_REGS_SYSCALL_REGS macro. Reported-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220209021745.2215452-7-iii@linux.ibm.com
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/bpf/bpf_tracing.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index 03e501ac8f60..41a015ee6bfb 100644
--- a/tools/lib/bpf/bpf_tracing.h
+++ b/tools/lib/bpf/bpf_tracing.h
@@ -214,6 +214,8 @@
#define __PT_RC_REG a5
#define __PT_SP_REG sp
#define __PT_IP_REG pc
+/* riscv does not select ARCH_HAS_SYSCALL_WRAPPER. */
+#define PT_REGS_SYSCALL_REGS(ctx) ctx
#endif