Skip to content

RFC Optimize BPF tail calls for direct jumps

Daniel Borkmann bpf netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8bpf, x86: generalize and extend bpf_arch_text_poke for direct jumpsarch/x86/net/bpf_jit_comp.c include/linux/bpf.h+52 -183 replies
2/8bpf: add bpf_prog_under_eviction helperinclude/linux/bpf.h kernel/bpf/syscall.c+6 -00 replies
3/8bpf: move bpf_free_used_maps into sleepable sectioninclude/linux/bpf.h kernel/bpf/core.c kernel/bpf/syscall.c+27 -201 reply
4/8bpf: move owner type,jited info into array auxillary datainclude/linux/bpf.h kernel/bpf/arraymap.c kernel/bpf/core.c +2 more+54 -281 reply
5/8bpf: add jit poke descriptor mock-up for jit imagesinclude/linux/bpf.h include/linux/filter.h kernel/bpf/core.c+64 -02 replies
6/8bpf: add poke dependency tracking for prog array mapsinclude/linux/bpf.h kernel/bpf/arraymap.c kernel/bpf/core.c+162 -34 replies
7/8bpf, x86: emit patchable direct jump as tail callarch/x86/net/bpf_jit_comp.c+157 -952 replies
8/8bpf: constant map key tracking for prog array pokesinclude/linux/bpf_verifier.h kernel/bpf/verifier.c+99 -06 replies

Reviews trailers per patch

3 of 8 patches have a Reviewed-by or Acked-by.

PatchAndrii Nakryiko
1/8
2/8
3/8A-b
4/8A-b
5/8A-b
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH rfc bpf-next 0/8] Optimize BPF tail calls for direct jumps

This gets rid of indirect jumps for BPF tail calls whenever possible. See patch 7/8 for more general details. This is on top of Alexei's '[v4,bpf-next,00/20] Introduce BPF trampoline' series [0]. For non-RFC I'll still massage commit messages a bit and expand the existing set of tail call tests with a few more kselftest cases.

Thanks,
Daniel

[0] https://patchwork.ozlabs.org/project/netdev/list/?series=142923

Daniel Borkmann (8):
bpf, x86: generalize and extend bpf_arch_text_poke for direct jumps
bpf: add bpf_prog_under_eviction helper
bpf: move bpf_free_used_maps into sleepable section
bpf: move owner type,jited info into array auxillary data
bpf: add jit poke descriptor mock-up for jit images
bpf: add poke dependency tracking for prog array maps bpf, x86: emit patchable direct jump as tail call
bpf: constant map key tracking for prog array pokes

 arch/x86/net/bpf_jit_comp.c  | 234 ++++++++++++++++++++++++-----------
 include/linux/bpf.h          |  85 +++++++++++--
 include/linux/bpf_verifier.h |   1 +
 include/linux/filter.h       |  10 ++
 kernel/bpf/arraymap.c        | 152 ++++++++++++++++++++++-
 kernel/bpf/core.c            |  73 ++++++++++-
 kernel/bpf/map_in_map.c      |   5 +-
 kernel/bpf/syscall.c         |  41 ++----
 kernel/bpf/verifier.c        |  98 +++++++++++++++
 9 files changed, 578 insertions(+), 121 deletions(-)
Signature · 1 line
2.21.0