Commit 1dac40ac authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann

libbpf: Fix arm and arm64 specs in bpf_tracing.h

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.
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Tested-by: Alan Maguire <alan.maguire@oracle.com> # arm64
Link: https://lore.kernel.org/bpf/20230120200914.3008030-4-andrii@kernel.org
parent 01329032
...@@ -157,11 +157,14 @@ struct pt_regs___s390 { ...@@ -157,11 +157,14 @@ struct pt_regs___s390 {
#elif defined(bpf_target_arm) #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_PARM1_REG uregs[0]
#define __PT_PARM2_REG uregs[1] #define __PT_PARM2_REG uregs[1]
#define __PT_PARM3_REG uregs[2] #define __PT_PARM3_REG uregs[2]
#define __PT_PARM4_REG uregs[3] #define __PT_PARM4_REG uregs[3]
#define __PT_PARM5_REG uregs[4]
#define __PT_RET_REG uregs[14] #define __PT_RET_REG uregs[14]
#define __PT_FP_REG uregs[11] /* Works only with CONFIG_FRAME_POINTER */ #define __PT_FP_REG uregs[11] /* Works only with CONFIG_FRAME_POINTER */
#define __PT_RC_REG uregs[0] #define __PT_RC_REG uregs[0]
...@@ -170,6 +173,10 @@ struct pt_regs___s390 { ...@@ -170,6 +173,10 @@ struct pt_regs___s390 {
#elif defined(bpf_target_arm64) #elif defined(bpf_target_arm64)
/*
* https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#machine-registers
*/
struct pt_regs___arm64 { struct pt_regs___arm64 {
unsigned long orig_x0; unsigned long orig_x0;
}; };
...@@ -181,6 +188,9 @@ struct pt_regs___arm64 { ...@@ -181,6 +188,9 @@ struct pt_regs___arm64 {
#define __PT_PARM3_REG regs[2] #define __PT_PARM3_REG regs[2]
#define __PT_PARM4_REG regs[3] #define __PT_PARM4_REG regs[3]
#define __PT_PARM5_REG regs[4] #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_RET_REG regs[30]
#define __PT_FP_REG regs[29] /* Works only with CONFIG_FRAME_POINTER */ #define __PT_FP_REG regs[29] /* Works only with CONFIG_FRAME_POINTER */
#define __PT_RC_REG regs[0] #define __PT_RC_REG regs[0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment