Skip to content

Commit 088d6aa

Browse files
iii-ianakryiko
authored andcommitted
libbpf: Fix accessing the first syscall argument on s390
On s390, the first syscall argument should be accessed via orig_gpr2 (see arch/s390/include/asm/syscall.h). Currently gpr[2] is used instead, leading to bpf_syscall_macro test failure. Reported-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220204145018.1983773-12-iii@linux.ibm.com
1 parent 5860b82 commit 088d6aa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/lib/bpf/bpf_tracing.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
/* s390 provides user_pt_regs instead of struct pt_regs to userspace */
118118
#define __PT_REGS_CAST(x) ((const user_pt_regs *)(x))
119119
#define __PT_PARM1_REG gprs[2]
120+
#define __PT_PARM1_REG_SYSCALL orig_gpr2
120121
#define __PT_PARM2_REG gprs[3]
121122
#define __PT_PARM3_REG gprs[4]
122123
#define __PT_PARM4_REG gprs[5]

0 commit comments

Comments
 (0)