mbox series

[v3,bpf-next,0/8] Allocate bpf trampoline on bpf_prog_pack

Message ID 20230926190020.1111575-1-song@kernel.org (mailing list archive)
Headers show
Series Allocate bpf trampoline on bpf_prog_pack | expand

Message

Song Liu Sept. 26, 2023, 7 p.m. UTC
This set enables allocating bpf trampoline from bpf_prog_pack on x86. The
majority of this work, however, is the refactoring of trampoline code.
This is needed because we need to handle 4 archs and 2 users (trampoline
and struct_ops).

1/8 is a dependency that is already applied to bpf tree.
2/8 through 7/8 refactors trampoline code. A few helpers are added.
8/8 finally let bpf trampoline on x86 use bpf_prog_pack.

Changes in v3:
1. Fix bug in s390. (Thanks to Ilya Leoshkevich).
2. Fix build error in riscv. (kernel test robot).

Changes in v2:
1. Add missing changes in net/bpf/bpf_dummy_struct_ops.c.
2. Reduce one dry run in arch_prepare_bpf_trampoline. (Xu Kuohai)
3. Other small fixes.

Song Liu (8):
  s390/bpf: Let arch_prepare_bpf_trampoline return program size
  bpf: Let bpf_prog_pack_free handle any pointer
  bpf: Adjust argument names of arch_prepare_bpf_trampoline()
  bpf: Add helpers for trampoline image management
  bpf, x86: Adjust arch_prepare_bpf_trampoline return value
  bpf: Add arch_bpf_trampoline_size()
  bpf: Use arch_bpf_trampoline_size
  x86, bpf: Use bpf_prog_pack for bpf trampoline

 arch/arm64/net/bpf_jit_comp.c   |  55 +++++++++-----
 arch/riscv/net/bpf_jit_comp64.c |  25 ++++---
 arch/s390/net/bpf_jit_comp.c    |  56 +++++++++------
 arch/x86/net/bpf_jit_comp.c     | 124 +++++++++++++++++++++++++-------
 include/linux/bpf.h             |  12 +++-
 include/linux/filter.h          |   2 +-
 kernel/bpf/bpf_struct_ops.c     |  19 +++--
 kernel/bpf/core.c               |  21 +++---
 kernel/bpf/dispatcher.c         |   5 +-
 kernel/bpf/trampoline.c         |  93 ++++++++++++++++++------
 net/bpf/bpf_dummy_struct_ops.c  |   7 +-
 11 files changed, 292 insertions(+), 127 deletions(-)

--
2.34.1

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 4, 2023, 3:40 p.m. UTC | #1
Hello:

This series was applied to netdev/net.git (main)
by Alexei Starovoitov <ast@kernel.org>:

On Tue, 26 Sep 2023 12:00:12 -0700 you wrote:
> This set enables allocating bpf trampoline from bpf_prog_pack on x86. The
> majority of this work, however, is the refactoring of trampoline code.
> This is needed because we need to handle 4 archs and 2 users (trampoline
> and struct_ops).
> 
> 1/8 is a dependency that is already applied to bpf tree.
> 2/8 through 7/8 refactors trampoline code. A few helpers are added.
> 8/8 finally let bpf trampoline on x86 use bpf_prog_pack.
> 
> [...]

Here is the summary with links:
  - [v3,bpf-next,1/8] s390/bpf: Let arch_prepare_bpf_trampoline return program size
    https://git.kernel.org/netdev/net/c/cf094baa3e0f
  - [v3,bpf-next,2/8] bpf: Let bpf_prog_pack_free handle any pointer
    (no matching commit)
  - [v3,bpf-next,3/8] bpf: Adjust argument names of arch_prepare_bpf_trampoline()
    (no matching commit)
  - [v3,bpf-next,4/8] bpf: Add helpers for trampoline image management
    (no matching commit)
  - [v3,bpf-next,5/8] bpf, x86: Adjust arch_prepare_bpf_trampoline return value
    (no matching commit)
  - [v3,bpf-next,6/8] bpf: Add arch_bpf_trampoline_size()
    (no matching commit)
  - [v3,bpf-next,7/8] bpf: Use arch_bpf_trampoline_size
    (no matching commit)
  - [v3,bpf-next,8/8] x86, bpf: Use bpf_prog_pack for bpf trampoline
    (no matching commit)

You are awesome, thank you!
Alexei Starovoitov Oct. 4, 2023, 3:50 p.m. UTC | #2
On Wed, Oct 4, 2023 at 8:40 AM <patchwork-bot+netdevbpf@kernel.org> wrote:
>
> Hello:
>
> This series was applied to netdev/net.git (main)
> by Alexei Starovoitov <ast@kernel.org>:

What is going on?
I didn't touch this commit.

> On Tue, 26 Sep 2023 12:00:12 -0700 you wrote:
> > This set enables allocating bpf trampoline from bpf_prog_pack on x86. The
> > majority of this work, however, is the refactoring of trampoline code.
> > This is needed because we need to handle 4 archs and 2 users (trampoline
> > and struct_ops).
> >
> > 1/8 is a dependency that is already applied to bpf tree.
> > 2/8 through 7/8 refactors trampoline code. A few helpers are added.
> > 8/8 finally let bpf trampoline on x86 use bpf_prog_pack.
> >
> > [...]
>
> Here is the summary with links:
>   - [v3,bpf-next,1/8] s390/bpf: Let arch_prepare_bpf_trampoline return program size
>     https://git.kernel.org/netdev/net/c/cf094baa3e0f
>   - [v3,bpf-next,2/8] bpf: Let bpf_prog_pack_free handle any pointer
>     (no matching commit)
>   - [v3,bpf-next,3/8] bpf: Adjust argument names of arch_prepare_bpf_trampoline()
>     (no matching commit)
>   - [v3,bpf-next,4/8] bpf: Add helpers for trampoline image management
>     (no matching commit)
>   - [v3,bpf-next,5/8] bpf, x86: Adjust arch_prepare_bpf_trampoline return value
>     (no matching commit)
>   - [v3,bpf-next,6/8] bpf: Add arch_bpf_trampoline_size()
>     (no matching commit)
>   - [v3,bpf-next,7/8] bpf: Use arch_bpf_trampoline_size
>     (no matching commit)
>   - [v3,bpf-next,8/8] x86, bpf: Use bpf_prog_pack for bpf trampoline
>     (no matching commit)
>
> You are awesome, thank you!
> --
> Deet-doot-dot, I am a bot.
> https://korg.docs.kernel.org/patchwork/pwbot.html
>
>
>