| From bb3e8149bf93b180164bf49931b30d10beb6a894 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Wed, 9 Feb 2022 03:17:39 +0100 |
| Subject: libbpf: Fix accessing syscall arguments on powerpc |
| |
| From: Ilya Leoshkevich <iii@linux.ibm.com> |
| |
| [ Upstream commit f07f1503469b11b739892d50c836992ffbe026ee ] |
| |
| powerpc 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> |
| Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> |
| Link: https://lore.kernel.org/bpf/20220209021745.2215452-5-iii@linux.ibm.com |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| tools/lib/bpf/bpf_tracing.h | 2 ++ |
| 1 file changed, 2 insertions(+) |
| |
| diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h |
| index e1b505606882..41f5f3149875 100644 |
| --- a/tools/lib/bpf/bpf_tracing.h |
| +++ b/tools/lib/bpf/bpf_tracing.h |
| @@ -178,6 +178,8 @@ |
| #define __PT_RC_REG gpr[3] |
| #define __PT_SP_REG sp |
| #define __PT_IP_REG nip |
| +/* powerpc does not select ARCH_HAS_SYSCALL_WRAPPER. */ |
| +#define PT_REGS_SYSCALL_REGS(ctx) ctx |
| |
| #elif defined(bpf_target_sparc) |
| |
| -- |
| 2.35.1 |
| |