From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>
Cc: bpf@vger.kernel.org, Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH bpf-next v5 05/10] libbpf: Fix riscv register names
Date: Wed, 9 Feb 2022 03:17:40 +0100 [thread overview]
Message-ID: <20220209021745.2215452-6-iii@linux.ibm.com> (raw)
In-Reply-To: <20220209021745.2215452-1-iii@linux.ibm.com>
riscv registers are accessed via struct user_regs_struct, not struct
pt_regs. The program counter member in this struct is called pc, not
epc. The frame pointer is called s0, not fp.
Fixes: 3cc31d794097 ("libbpf: Normalize PT_REGS_xxx() macro definitions")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
tools/lib/bpf/bpf_tracing.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index 20bc63770c9f..03e501ac8f60 100644
--- a/tools/lib/bpf/bpf_tracing.h
+++ b/tools/lib/bpf/bpf_tracing.h
@@ -210,10 +210,10 @@
#define __PT_PARM4_REG a3
#define __PT_PARM5_REG a4
#define __PT_RET_REG ra
-#define __PT_FP_REG fp
+#define __PT_FP_REG s0
#define __PT_RC_REG a5
#define __PT_SP_REG sp
-#define __PT_IP_REG epc
+#define __PT_IP_REG pc
#endif
--
2.34.1
next prev parent reply other threads:[~2022-02-09 2:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 2:17 [PATCH bpf-next v5 00/10] Fix accessing syscall arguments Ilya Leoshkevich
2022-02-09 2:17 ` [PATCH bpf-next v5 01/10] selftests/bpf: Fix an endianness issue in bpf_syscall_macro test Ilya Leoshkevich
2022-02-09 2:17 ` [PATCH bpf-next v5 02/10] libbpf: Add PT_REGS_SYSCALL_REGS macro Ilya Leoshkevich
2022-02-09 2:17 ` [PATCH bpf-next v5 03/10] selftests/bpf: Use PT_REGS_SYSCALL_REGS in bpf_syscall_macro Ilya Leoshkevich
2022-02-09 2:17 ` [PATCH bpf-next v5 04/10] libbpf: Fix accessing syscall arguments on powerpc Ilya Leoshkevich
2022-02-09 2:17 ` Ilya Leoshkevich [this message]
2022-02-09 2:17 ` [PATCH bpf-next v5 06/10] libbpf: Fix accessing syscall arguments on riscv Ilya Leoshkevich
2022-02-09 2:17 ` [PATCH bpf-next v5 07/10] selftests/bpf: Skip test_bpf_syscall_macro:syscall_arg1 on arm64 and s390 Ilya Leoshkevich
2022-02-09 2:17 ` [PATCH bpf-next v5 08/10] libbpf: Allow overriding PT_REGS_PARM1{_CORE}_SYSCALL Ilya Leoshkevich
2022-02-09 5:39 ` Andrii Nakryiko
2022-02-09 2:17 ` [PATCH bpf-next v5 09/10] libbpf: Fix accessing the first syscall argument on arm64 Ilya Leoshkevich
2022-02-09 5:39 ` Andrii Nakryiko
2022-02-09 2:17 ` [PATCH bpf-next v5 10/10] libbpf: Fix accessing the first syscall argument on s390 Ilya Leoshkevich
2022-02-09 5:39 ` Andrii Nakryiko
2022-02-09 5:39 ` [PATCH bpf-next v5 00/10] Fix accessing syscall arguments Andrii Nakryiko
2022-02-09 5:40 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220209021745.2215452-6-iii@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=borntraeger@linux.ibm.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).