Skip to content

Move ld_abs/ld_ind to native BPF

Daniel Borkmann netdev 2 versions Applied

Status from this message: Applied to bpf-next, Thanks Daniel.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest13 patches 1 replyApplied
  2. v112 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Added missing seen_lds_abs in LDX_MSH and use X = A initially due to being preserved on func call.
- Added a large batch of cBPF tests into test_bpf.
- Added x32 removal of LD_ABS/LD_IND, so all JITs are covered.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/13bpf: prefix cbpf internal helpers with bpf_net/core/filter.c+9 -90 replies
2/13bpf: migrate ebpf ld_abs/ld_ind tests to test_verifierinclude/linux/bpf.h lib/test_bpf.c net/core/filter.c +1 more+619 -2250 replies
3/13bpf: implement ld_abs/ld_ind in native bpfinclude/linux/bpf.h include/linux/filter.h kernel/bpf/core.c +2 more+262 -1000 replies
4/13bpf: add skb_load_bytes_relative helperinclude/uapi/linux/bpf.h net/core/filter.c+77 -10 replies
5/13bpf, x64: remove ld_abs/ld_indarch/x86/net/Makefile arch/x86/net/bpf_jit.S arch/x86/net/bpf_jit_comp.c+5 -2960 replies
6/13bpf, arm64: remove ld_abs/ld_indarch/arm64/net/bpf_jit_comp.c+0 -650 replies
7/13bpf, sparc64: remove ld_abs/ld_indarch/sparc/net/Makefile arch/sparc/net/bpf_jit_64.h arch/sparc/net/bpf_jit_asm_64.S +1 more+6 -2690 replies
8/13bpf, arm32: remove ld_abs/ld_indarch/arm/net/bpf_jit_32.c+0 -770 replies
9/13bpf, mips64: remove ld_abs/ld_indarch/mips/net/ebpf_jit.c+0 -1040 replies
10/13bpf, ppc64: remove ld_abs/ld_indarch/powerpc/net/Makefile arch/powerpc/net/bpf_jit64.h arch/powerpc/net/bpf_jit_asm64.S +1 more+11 -3170 replies
11/13bpf, s390x: remove ld_abs/ld_indarch/s390/net/Makefile arch/s390/net/bpf_jit.S arch/s390/net/bpf_jit.h +1 more+13 -2520 replies
12/13bpf, x32: remove ld_abs/ld_indarch/x86/net/bpf_jit_comp32.c+1 -1350 replies
13/13bpf: sync tools bpf.h uapi headertools/include/uapi/linux/bpf.h+32 -10 replies

Reviews trailers per patch

All 13 patches have a Reviewed-by or Acked-by.

PatchAlexei StarovoitovDavid S. MillerNaveen N. RaoSandipan Das
1/13A-b
2/13A-b
3/13A-b
4/13A-b
5/13A-b
6/13A-b
7/13A-b A-b
8/13A-b
9/13A-b
10/13A-b A-b T-b
11/13A-b
12/13A-b
13/13A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH bpf-next v2 00/13] Move ld_abs/ld_ind to native BPF

This set simplifies BPF JITs significantly by moving ld_abs/ld_ind to native BPF, for details see individual patches. Main rationale is in patch 'implement ld_abs/ld_ind in native bpf'. Thanks!

v1 -> v2:
- Added missing seen_lds_abs in LDX_MSH and use X = A initially due to being preserved on func call.
- Added a large batch of cBPF tests into test_bpf.
- Added x32 removal of LD_ABS/LD_IND, so all JITs are covered.

Daniel Borkmann (13):
bpf: prefix cbpf internal helpers with bpf_
bpf: migrate ebpf ld_abs/ld_ind tests to test_verifier
bpf: implement ld_abs/ld_ind in native bpf
bpf: add skb_load_bytes_relative helper
bpf, x64: remove ld_abs/ld_ind
bpf, arm64: remove ld_abs/ld_ind
bpf, sparc64: remove ld_abs/ld_ind
bpf, arm32: remove ld_abs/ld_ind
bpf, mips64: remove ld_abs/ld_ind
bpf, ppc64: remove ld_abs/ld_ind
bpf, s390x: remove ld_abs/ld_ind
bpf, x32: remove ld_abs/ld_ind
bpf: sync tools bpf.h uapi header

 arch/arm/net/bpf_jit_32.c                   |  77 ----
 arch/arm64/net/bpf_jit_comp.c               |  65 ----
 arch/mips/net/ebpf_jit.c                    | 104 -----
 arch/powerpc/net/Makefile                   |   2 +-
 arch/powerpc/net/bpf_jit64.h                |  37 +-
 arch/powerpc/net/bpf_jit_asm64.S            | 180 ---------
 arch/powerpc/net/bpf_jit_comp64.c           | 109 +-----
 arch/s390/net/Makefile                      |   2 +-
 arch/s390/net/bpf_jit.S                     | 116 ------
 arch/s390/net/bpf_jit.h                     |  20 +-
 arch/s390/net/bpf_jit_comp.c                | 127 +------
 arch/sparc/net/Makefile                     |   5 +-
 arch/sparc/net/bpf_jit_64.h                 |  29 --
 arch/sparc/net/bpf_jit_asm_64.S             | 162 --------
 arch/sparc/net/bpf_jit_comp_64.c            |  79 +---
 arch/x86/net/Makefile                       |   3 +-
 arch/x86/net/bpf_jit.S                      | 154 --------
 arch/x86/net/bpf_jit_comp.c                 | 144 +------
 arch/x86/net/bpf_jit_comp32.c               | 136 +------
 include/linux/bpf.h                         |   4 +-
 include/linux/filter.h                      |   4 +-
 include/uapi/linux/bpf.h                    |  33 +-
 kernel/bpf/core.c                           |  96 +----
 kernel/bpf/verifier.c                       |  24 ++
 lib/test_bpf.c                              | 570 +++++++++++++++++-----------
 net/core/filter.c                           | 305 +++++++++++++--
 tools/include/uapi/linux/bpf.h              |  33 +-
 tools/testing/selftests/bpf/test_verifier.c | 266 ++++++++++++-
 28 files changed, 1035 insertions(+), 1851 deletions(-)
 delete mode 100644 arch/powerpc/net/bpf_jit_asm64.S
 delete mode 100644 arch/s390/net/bpf_jit.S
 delete mode 100644 arch/sparc/net/bpf_jit_asm_64.S
 delete mode 100644 arch/x86/net/bpf_jit.S
Signature · 1 line
2.9.5