All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v5 00/10] Fix accessing syscall arguments
@ 2022-02-09  2:17 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
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Ilya Leoshkevich @ 2022-02-09  2:17 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Heiko Carstens, Vasily Gorbik, Christian Borntraeger,
	Alexander Gordeev
  Cc: bpf, Ilya Leoshkevich

libbpf now has macros to access syscall arguments in an
architecture-agnostic manner, but unfortunately they have a number of
issues on non-Intel arches, which this series aims to fix.

v1: https://lore.kernel.org/bpf/20220201234200.1836443-1-iii@linux.ibm.com/
v1 -> v2:
* Put orig_gpr2 in place of args[1] on s390 (Vasily).
* Fix arm64, powerpc and riscv (Heiko).

v2: https://lore.kernel.org/bpf/20220204041955.1958263-1-iii@linux.ibm.com/
v2 -> v3:
* Undo args[1] change (Andrii).
* Rename PT_REGS_SYSCALL to PT_REGS_SYSCALL_REGS (Andrii).
* Split the riscv patch (Andrii).

v3: https://lore.kernel.org/bpf/20220204145018.1983773-1-iii@linux.ibm.com/
v3 -> v4:
* Undo arm64's and s390's user_pt_regs changes.
* Use struct pt_regs when vmlinux.h is available (Andrii).
* Use offsetofend for accessing orig_gpr2 and orig_x0 (Andrii).
* Move libbpf's copy of offsetofend to a new header.
* Fix riscv's __PT_FP_REG.
* Use PT_REGS_SYSCALL_REGS in test_probe_user.c.
* Test bpf_syscall_macro with userspace headers.
* Use Naveen's suggestions and code in patches 5 and 6.
* Add warnings to arm64's and s390's ptrace.h (Andrii).

v4: https://lore.kernel.org/bpf/20220208051635.2160304-1-iii@linux.ibm.com/
v4 -> v5:
* Go back to v3.
* Do not touch arch headers.
* Use CO-RE struct flavors to access orig_x0 and orig_gpr2.
* Fail compilation if non-CO-RE macros are used to access the first
  syscall parameter on arm64 and s390.
* Fix accessing frame pointer on riscv.

Ilya Leoshkevich (10):
  selftests/bpf: Fix an endianness issue in bpf_syscall_macro test
  libbpf: Add PT_REGS_SYSCALL_REGS macro
  selftests/bpf: Use PT_REGS_SYSCALL_REGS in bpf_syscall_macro
  libbpf: Fix accessing syscall arguments on powerpc
  libbpf: Fix riscv register names
  libbpf: Fix accessing syscall arguments on riscv
  selftests/bpf: Skip test_bpf_syscall_macro:syscall_arg1 on arm64 and
    s390
  libbpf: Allow overriding PT_REGS_PARM1{_CORE}_SYSCALL
  libbpf: Fix accessing the first syscall argument on arm64
  libbpf: Fix accessing the first syscall argument on s390

 tools/lib/bpf/bpf_tracing.h                   | 42 ++++++++++++++++++-
 .../bpf/prog_tests/test_bpf_syscall_macro.c   |  4 ++
 .../selftests/bpf/progs/bpf_syscall_macro.c   |  9 +++-
 3 files changed, 51 insertions(+), 4 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-02-09  5:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH bpf-next v5 05/10] libbpf: Fix riscv register names Ilya Leoshkevich
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.