While implementing JIT for packet capture ran into several issues:
1. x86 JIT had a pre-existing bug which would crash.
2. The arm64 JIT was missing the packet-access instructions, found
previously [1].
3. Shift counts were not masked to the operand width as RFC 9669
requires: undefined behavior in the interpreter and an encoding
failure in the arm64 JIT.
4. Tests related to JIT were not being run or were missing coverage.
Fixed all of these. Patches are ordered with the most urgent fix (the
x86 crash) first, each fix followed by the test that exercises it. The
arm64 packet-load support is kept ahead of the "check JIT was generated"
patch so the series bisects cleanly on arm64.
The arm64 epilogue branch fix (patch 6) was originally posted by
Christophe Fontaine [1]; that series stalled, so it is carried here with
his authorship.
[1] https://inbox.dpdk.org/dev/[email protected]/
v6:
- address Marat's review ARM64 JIT of LD IND instructions
need to handle offsets outside of 32 bit range.
Christophe Fontaine (1):
bpf/arm64: fix offset type to allow a negative jump
Stephen Hemminger (8):
bpf/x86: fix JIT encoding of fixed-width immediates
test/bpf: add JSET test with small immediate
bpf: mask shift count in interpreter per RFC 9669
bpf/arm64: mask shift count per RFC 9669
test/bpf: add test for large shift
bpf/arm64: add BPF_ABS/BPF_IND packet load support
test/bpf: check that JIT was generated
test/bpf: check that bpf_convert can be JIT'd
app/test/test_bpf.c | 320 +++++++++++++++++++++++++++++++---------
lib/bpf/bpf_exec.c | 31 ++--
lib/bpf/bpf_jit_arm64.c | 185 ++++++++++++++++++++++-
lib/bpf/bpf_jit_x86.c | 6 +-
lib/bpf/meson.build | 2 +
5 files changed, 456 insertions(+), 88 deletions(-)
--
2.53.0