BPF List
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii@kernel.org>
To: <bpf@vger.kernel.org>, <ast@kernel.org>, <daniel@iogearbox.net>
Cc: <andrii@kernel.org>, <kernel-team@fb.com>,
	Alan Maguire <alan.maguire@oracle.com>
Subject: [PATCH v2 bpf-next 03/25] libbpf: fix arm and arm64 specs in bpf_tracing.h
Date: Fri, 20 Jan 2023 12:08:52 -0800	[thread overview]
Message-ID: <20230120200914.3008030-4-andrii@kernel.org> (raw)
In-Reply-To: <20230120200914.3008030-1-andrii@kernel.org>

Remove invalid support for PARM5 on 32-bit arm, as per ABI. Add three
more argument registers for arm64. Also leave links to ABI specs for
future reference.

Tested-by: Alan Maguire <alan.maguire@oracle.com> # arm64
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
 tools/lib/bpf/bpf_tracing.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index a47504c2f3cb..a263f600e309 100644
--- a/tools/lib/bpf/bpf_tracing.h
+++ b/tools/lib/bpf/bpf_tracing.h
@@ -157,11 +157,14 @@ struct pt_regs___s390 {
 
 #elif defined(bpf_target_arm)
 
+/*
+ * https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#machine-registers
+ */
+
 #define __PT_PARM1_REG uregs[0]
 #define __PT_PARM2_REG uregs[1]
 #define __PT_PARM3_REG uregs[2]
 #define __PT_PARM4_REG uregs[3]
-#define __PT_PARM5_REG uregs[4]
 #define __PT_RET_REG uregs[14]
 #define __PT_FP_REG uregs[11]	/* Works only with CONFIG_FRAME_POINTER */
 #define __PT_RC_REG uregs[0]
@@ -170,6 +173,10 @@ struct pt_regs___s390 {
 
 #elif defined(bpf_target_arm64)
 
+/*
+ * https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#machine-registers
+ */
+
 struct pt_regs___arm64 {
 	unsigned long orig_x0;
 };
@@ -181,6 +188,9 @@ struct pt_regs___arm64 {
 #define __PT_PARM3_REG regs[2]
 #define __PT_PARM4_REG regs[3]
 #define __PT_PARM5_REG regs[4]
+#define __PT_PARM6_REG regs[5]
+#define __PT_PARM7_REG regs[6]
+#define __PT_PARM8_REG regs[7]
 #define __PT_RET_REG regs[30]
 #define __PT_FP_REG regs[29]	/* Works only with CONFIG_FRAME_POINTER */
 #define __PT_RC_REG regs[0]
-- 
2.30.2


  parent reply	other threads:[~2023-01-20 20:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 20:08 [PATCH v2 bpf-next 00/25] libbpf: extend [ku]probe and syscall argument tracing support Andrii Nakryiko
2023-01-20 20:08 ` [PATCH v2 bpf-next 01/25] libbpf: add support for fetching up to 8 arguments in kprobes Andrii Nakryiko
2023-01-20 20:08 ` [PATCH v2 bpf-next 02/25] libbpf: add 6th argument support for x86-64 in bpf_tracing.h Andrii Nakryiko
2023-01-20 20:08 ` Andrii Nakryiko [this message]
2023-01-20 20:08 ` [PATCH v2 bpf-next 04/25] libbpf: complete mips spec " Andrii Nakryiko
2023-01-20 20:08 ` [PATCH v2 bpf-next 05/25] libbpf: complete powerpc " Andrii Nakryiko
2023-01-20 20:08 ` [PATCH v2 bpf-next 06/25] libbpf: complete sparc " Andrii Nakryiko
2023-01-20 20:08 ` [PATCH v2 bpf-next 07/25] libbpf: complete riscv arch " Andrii Nakryiko
2023-01-20 20:08 ` [PATCH v2 bpf-next 08/25] libbpf: fix and complete ARC " Andrii Nakryiko
2023-01-20 20:08 ` [PATCH v2 bpf-next 09/25] libbpf: complete LoongArch (loongarch) " Andrii Nakryiko
2023-01-20 20:08 ` [PATCH v2 bpf-next 10/25] libbpf: add BPF_UPROBE and BPF_URETPROBE macro aliases Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 11/25] selftests/bpf: validate arch-specific argument registers limits Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 12/25] libbpf: improve syscall tracing support in bpf_tracing.h Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 13/25] libbpf: define x86-64 syscall regs spec " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 14/25] libbpf: define i386 " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 15/25] libbpf: define s390x " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 16/25] libbpf: define arm " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 17/25] libbpf: define arm64 " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 18/25] libbpf: define mips " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 19/25] libbpf: define powerpc " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 20/25] libbpf: define sparc " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 21/25] libbpf: define riscv " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 22/25] libbpf: define arc " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 23/25] libbpf: define loongarch " Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 24/25] selftests/bpf: add 6-argument syscall tracing test Andrii Nakryiko
2023-01-20 20:09 ` [PATCH v2 bpf-next 25/25] libbpf: clean up now not needed __PT_PARM{1-6}_SYSCALL_REG defaults Andrii Nakryiko
2023-01-23 20:10 ` [PATCH v2 bpf-next 00/25] libbpf: extend [ku]probe and syscall argument tracing support 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=20230120200914.3008030-4-andrii@kernel.org \
    --to=andrii@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.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