Skip to content

arm64 BPF JIT Optimizations

Luke Nelson bpf linux-arm-kernel lkml netdev 2 versions – Applied

Status from this message: Applied to arm64 (for-next/bpf), thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied
  2. v1 RFC3 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- Cleaned up patch to insn.c.
(Marc Zyngier, Will Deacon)

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3arm64: insn: Fix two bugs in encoding 32-bit logical immediatesarch/arm64/kernel/insn.c+7 -70 replies
2/3bpf, arm64: Optimize AND,OR,XOR,JSET BPF_K using arm64 logical immediatesarch/arm64/net/bpf_jit.h arch/arm64/net/bpf_jit_comp.c+43 -80 replies
3/3bpf, arm64: Optimize ADD,SUB,JMP BPF_K using arm64 add/sub immediatesarch/arm64/net/bpf_jit.h arch/arm64/net/bpf_jit_comp.c+38 -60 replies

Reviews trailers per patch

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

PatchMarc ZyngierDaniel Borkmann
1/3R-b
2/3A-b
3/3A-b

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

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/3] arm64 BPF JIT Optimizations

This patch series introduces several optimizations to the arm64 BPF JIT. The optimizations make use of arm64 immediate instructions to avoid loading BPF immediates to temporary registers, when possible.

In the process, we discovered two bugs in the logical immediate encoding function in arch/arm64/kernel/insn.c using Serval. The series also fixes the two bugs before introducing the optimizations.

Tested on aarch64 QEMU virt machine using test_bpf and test_verifier.

v2:
- Cleaned up patch to insn.c.
(Marc Zyngier, Will Deacon)

Luke Nelson (3):
arm64: insn: Fix two bugs in encoding 32-bit logical immediates bpf, arm64: Optimize AND,OR,XOR,JSET BPF_K using arm64 logical
immediates
bpf, arm64: Optimize ADD,SUB,JMP BPF_K using arm64 add/sub immediates

 arch/arm64/kernel/insn.c      | 14 +++----
 arch/arm64/net/bpf_jit.h      | 22 +++++++++++
 arch/arm64/net/bpf_jit_comp.c | 73 ++++++++++++++++++++++++++++-------
 3 files changed, 88 insertions(+), 21 deletions(-)
Cc Xi Wang <[email protected]>
Signature · 1 line
2.17.1