mbox series

[bpf-next,v3,00/11] libbpf: Fix accessing syscall arguments

Message ID 20220204145018.1983773-1-iii@linux.ibm.com (mailing list archive)
Headers show
Series libbpf: Fix accessing syscall arguments | expand

Message

Ilya Leoshkevich Feb. 4, 2022, 2:50 p.m. UTC
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).

+cc Naveen.

Ilya Leoshkevich (11):
  arm64/bpf: Add orig_x0 to user_pt_regs
  s390/bpf: Add orig_gpr2 to user_pt_regs
  selftests/bpf: Fix an endianness issue in bpf_syscall_macro test
  libbpf: Add __PT_PARM1_REG_SYSCALL macro
  libbpf: Add PT_REGS_SYSCALL_REGS macro
  selftests/bpf: Use PT_REGS_SYSCALL_REGS in bpf_syscall_macro
  libbpf: Fix accessing the first syscall argument on arm64
  libbpf: Fix accessing syscall arguments on powerpc
  libbpf: Fix accessing program counter on riscv
  libbpf: Fix accessing syscall arguments on riscv
  libbpf: Fix accessing the first syscall argument on s390

 arch/arm64/include/asm/ptrace.h               |  2 +-
 arch/arm64/include/uapi/asm/ptrace.h          |  1 +
 arch/s390/include/asm/ptrace.h                |  2 +-
 arch/s390/include/uapi/asm/ptrace.h           |  1 +
 tools/lib/bpf/bpf_tracing.h                   | 23 ++++++++++++++++++-
 .../selftests/bpf/progs/bpf_syscall_macro.c   |  7 ++++--
 6 files changed, 31 insertions(+), 5 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 5, 2022, 8:30 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Fri,  4 Feb 2022 15:50:07 +0100 you wrote:
> 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).
> 
> [...]

Here is the summary with links:
  - [bpf-next,v3,01/11] arm64/bpf: Add orig_x0 to user_pt_regs
    https://git.kernel.org/bpf/bpf-next/c/d473f4062165
  - [bpf-next,v3,02/11] s390/bpf: Add orig_gpr2 to user_pt_regs
    https://git.kernel.org/bpf/bpf-next/c/61f88e88f263
  - [bpf-next,v3,03/11] selftests/bpf: Fix an endianness issue in bpf_syscall_macro test
    https://git.kernel.org/bpf/bpf-next/c/a936c141cbe4
  - [bpf-next,v3,04/11] libbpf: Add __PT_PARM1_REG_SYSCALL macro
    https://git.kernel.org/bpf/bpf-next/c/3a9d84aafb8c
  - [bpf-next,v3,05/11] libbpf: Add PT_REGS_SYSCALL_REGS macro
    https://git.kernel.org/bpf/bpf-next/c/b62a862d42f5
  - [bpf-next,v3,06/11] selftests/bpf: Use PT_REGS_SYSCALL_REGS in bpf_syscall_macro
    https://git.kernel.org/bpf/bpf-next/c/730809c15ac2
  - [bpf-next,v3,07/11] libbpf: Fix accessing the first syscall argument on arm64
    https://git.kernel.org/bpf/bpf-next/c/8b9b06ad4726
  - [bpf-next,v3,08/11] libbpf: Fix accessing syscall arguments on powerpc
    https://git.kernel.org/bpf/bpf-next/c/f5af16d0ae28
  - [bpf-next,v3,09/11] libbpf: Fix accessing program counter on riscv
    https://git.kernel.org/bpf/bpf-next/c/27870c91b5c7
  - [bpf-next,v3,10/11] libbpf: Fix accessing syscall arguments on riscv
    https://git.kernel.org/bpf/bpf-next/c/5860b82236c6
  - [bpf-next,v3,11/11] libbpf: Fix accessing the first syscall argument on s390
    https://git.kernel.org/bpf/bpf-next/c/088d6aafd5bb

You are awesome, thank you!
Andrii Nakryiko Feb. 7, 2022, 4:10 p.m. UTC | #2
On Sat, Feb 5, 2022 at 12:30 PM <patchwork-bot+netdevbpf@kernel.org> wrote:
>
> Hello:
>
> This series was applied to bpf/bpf-next.git (master)
> by Andrii Nakryiko <andrii@kernel.org>:
>
> On Fri,  4 Feb 2022 15:50:07 +0100 you wrote:
> > 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).
> >
> > [...]
>
> Here is the summary with links:
>   - [bpf-next,v3,01/11] arm64/bpf: Add orig_x0 to user_pt_regs
>     https://git.kernel.org/bpf/bpf-next/c/d473f4062165
>   - [bpf-next,v3,02/11] s390/bpf: Add orig_gpr2 to user_pt_regs
>     https://git.kernel.org/bpf/bpf-next/c/61f88e88f263
>   - [bpf-next,v3,03/11] selftests/bpf: Fix an endianness issue in bpf_syscall_macro test
>     https://git.kernel.org/bpf/bpf-next/c/a936c141cbe4
>   - [bpf-next,v3,04/11] libbpf: Add __PT_PARM1_REG_SYSCALL macro
>     https://git.kernel.org/bpf/bpf-next/c/3a9d84aafb8c
>   - [bpf-next,v3,05/11] libbpf: Add PT_REGS_SYSCALL_REGS macro
>     https://git.kernel.org/bpf/bpf-next/c/b62a862d42f5
>   - [bpf-next,v3,06/11] selftests/bpf: Use PT_REGS_SYSCALL_REGS in bpf_syscall_macro
>     https://git.kernel.org/bpf/bpf-next/c/730809c15ac2
>   - [bpf-next,v3,07/11] libbpf: Fix accessing the first syscall argument on arm64
>     https://git.kernel.org/bpf/bpf-next/c/8b9b06ad4726
>   - [bpf-next,v3,08/11] libbpf: Fix accessing syscall arguments on powerpc
>     https://git.kernel.org/bpf/bpf-next/c/f5af16d0ae28
>   - [bpf-next,v3,09/11] libbpf: Fix accessing program counter on riscv
>     https://git.kernel.org/bpf/bpf-next/c/27870c91b5c7
>   - [bpf-next,v3,10/11] libbpf: Fix accessing syscall arguments on riscv
>     https://git.kernel.org/bpf/bpf-next/c/5860b82236c6
>   - [bpf-next,v3,11/11] libbpf: Fix accessing the first syscall argument on s390
>     https://git.kernel.org/bpf/bpf-next/c/088d6aafd5bb
>

I've backed out this patch set from bpf-next for now while we are
deciding the best way to deal with s390x and arm64 arches without
breaking UAPIs.

> You are awesome, thank you!
> --
> Deet-doot-dot, I am a bot.
> https://korg.docs.kernel.org/patchwork/pwbot.html
>
>