Skip to content

Add BPF_J{LT,LE,SLT,SLE} instructions

Daniel Borkmann netdev 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 1 replyIn review
  2. v19 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- Reworded commit msg in patch 1

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9bpf: add BPF_J{LT,LE,SLT,SLE} instructionsDocumentation/networking/filter.txt include/uapi/linux/bpf.h kernel/bpf/core.c +3 more+455 -40 replies
2/9bpf, x86: implement jiting of BPF_J{LT,LE,SLT,SLE}arch/x86/net/bpf_jit_comp.c+26 -00 replies
3/9bpf, arm64: implement jiting of BPF_J{LT,LE,SLT,SLE}arch/arm64/net/bpf_jit.h arch/arm64/net/bpf_jit_comp.c+24 -00 replies
4/9bpf, sparc64: implement jiting of BPF_J{LT, LE, SLT, SLE}arch/sparc/net/bpf_jit_comp_64.c+34 -00 replies
5/9bpf, s390x: implement jiting of BPF_J{LT,LE,SLT,SLE}arch/s390/net/bpf_jit_comp.c+24 -00 replies
6/9bpf, ppc64: implement jiting of BPF_J{LT,LE,SLT,SLE}arch/powerpc/net/bpf_jit.h arch/powerpc/net/bpf_jit_comp64.c+21 -00 replies
7/9bpf, nfp: implement jiting of BPF_J{LT,LE}drivers/net/ethernet/netronome/nfp/bpf/jit.c+24 -00 replies
8/9bpf: enable BPF_J{LT,LE,SLT,SLE} opcodes in verifierkernel/bpf/verifier.c+58 -40 replies
9/9bpf: add test cases for new BPF_J{LT, LE, SLT, SLE} instructionstools/testing/selftests/bpf/test_verifier.c+313 -00 replies

Reviews trailers per patch

7 of 9 patches have a Reviewed-by or Acked-by.

PatchAlexei StarovoitovMichael HolzheuNaveen N. RaoJakub KicinskiJohn Fastabend
1/9A-b
2/9A-b
3/9
4/9
5/9A-b
6/9A-b T-b
7/9A-b
8/9A-b A-b
9/9A-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 5 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 0/9] Add BPF_J{LT,LE,SLT,SLE} instructions

This set adds BPF_J{LT,LE,SLT,SLE} instructions to the BPF insn set, interpreter, JIT hardening code and all JITs are also updated to support the new instructions. Basic idea is to reduce register pressure by avoiding BPF_J{GT,GE,SGT,SGE} rewrites. Removing the workaround for the rewrites in LLVM, this can result in shorter BPF programs, less stack usage and less verification complexity. First patch provides some more details on rationale and integration.

Thanks a lot!

v1 -> v2:
- Reworded commit msg in patch 1

Daniel Borkmann (9):
bpf: add BPF_J{LT,LE,SLT,SLE} instructions
bpf, x86: implement jiting of BPF_J{LT,LE,SLT,SLE} bpf, arm64: implement jiting of BPF_J{LT,LE,SLT,SLE} bpf, sparc64: implement jiting of BPF_J{LT, LE, SLT, SLE} bpf, s390x: implement jiting of BPF_J{LT,LE,SLT,SLE} bpf, ppc64: implement jiting of BPF_J{LT,LE,SLT,SLE} bpf, nfp: implement jiting of BPF_J{LT,LE}
bpf: enable BPF_J{LT,LE,SLT,SLE} opcodes in verifier
bpf: add test cases for new BPF_J{LT, LE, SLT, SLE} instructions

 Documentation/networking/filter.txt          |   4 +
 arch/arm64/net/bpf_jit.h                     |   4 +
 arch/arm64/net/bpf_jit_comp.c                |  20 ++
 arch/powerpc/net/bpf_jit.h                   |   1 +
 arch/powerpc/net/bpf_jit_comp64.c            |  20 ++
 arch/s390/net/bpf_jit_comp.c                 |  24 ++
 arch/sparc/net/bpf_jit_comp_64.c             |  34 +++
 arch/x86/net/bpf_jit_comp.c                  |  26 ++
 drivers/net/ethernet/netronome/nfp/bpf/jit.c |  24 ++
 include/uapi/linux/bpf.h                     |   5 +
 kernel/bpf/core.c                            |  60 +++++
 kernel/bpf/verifier.c                        |  62 ++++-
 lib/test_bpf.c                               | 364 +++++++++++++++++++++++++++
 net/core/filter.c                            |  21 +-
 tools/include/uapi/linux/bpf.h               |   5 +
 tools/testing/selftests/bpf/test_verifier.c  | 313 +++++++++++++++++++++++
 16 files changed, 979 insertions(+), 8 deletions(-)
Signature · 1 line
1.9.3