All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v4 0/7] bpf: JIT related bug fixes
Date: Tue, 23 Jun 2026 16:23:11 -0700	[thread overview]
Message-ID: <20260623232522.257208-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20260608203322.1116296-1-stephen@networkplumber.org>

While implementing JIT for packet capture ran into several issues:
  1. x86 JIT had pre-existing bug which would crash
  2. ARM64 BPF JIT was missing instructions for packet access.
     Which had been discovered previously [1]
  3. Tests related to JIT were not being run or missing coverage.

Fixed all of these. Patches are ordered so that most urgent fix
is first, followed by the test that should have caught the problem.

The arm64 epilogue branch fix (patch 4) was originally posted by
Christophe Fontaine [1]; that series stalled, so it is carried here
with his authorship.

Changes since v3:
 - incorporate review feedback
 - rebase to current main
 - extend the x86 fix to all fixed-width immediates, not just JSET:
   TEST is always imm32, while ROR and the shift group are always
   imm8; patch 1 retitled to match
 - add a regression test for a large shift count (patch 3)

Changes since v2:
 - found more places where the x86 JIT emitted invalid opcodes for
   fixed-width immediates

Changes since v1:
 - add the x86 JSET encoding fix and its regression test, found once
   the convert test ran generated code through the JIT
 - carry Christophe's arm64 epilogue fix with his sign-off
 - convert test now runs the converted filters through the JIT, not
   just loading them
 - kept Marat's ack on the "check JIT was generated" patch; dropped it
   on the convert test since that changed substantially

[1] https://inbox.dpdk.org/dev/20260319114500.9757-2-cfontain@redhat.com/

Christophe Fontaine (1):
  bpf/arm64: fix offset type to allow a negative jump

Stephen Hemminger (6):
  bpf/x86: fix JIT encoding of fixed-width immediates
  test/bpf: add JSET test with small immediate
  test/bpf: add test for large shift
  test/bpf: check that JIT was generated
  bpf/arm64: add BPF_ABS/BPF_IND packet load support
  test/bpf: check that bpf_convert can be JIT'd

 app/test/test_bpf.c     | 327 +++++++++++++++++++++++++++++++---------
 lib/bpf/bpf_jit_arm64.c | 153 ++++++++++++++++++-
 lib/bpf/bpf_jit_x86.c   |   6 +-
 lib/bpf/meson.build     |   2 +
 4 files changed, 412 insertions(+), 76 deletions(-)

-- 
2.53.0


  parent reply	other threads:[~2026-06-23 23:25 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 20:28 [PATCH 0/4] bpf/arm64: add BPF_ABS/BPF_IND packet load support Stephen Hemminger
2026-06-08 20:28 ` [PATCH 1/4] bpf/arm64: fix zero-return branch in multi-exit programs Stephen Hemminger
2026-06-17 18:03   ` Marat Khalili
2026-06-08 20:28 ` [PATCH 2/4] test: bpf check that JIT was generated Stephen Hemminger
2026-06-17 18:09   ` Marat Khalili
2026-06-08 20:28 ` [PATCH 3/4] test: bpf check that bpf_convert can be JIT'd Stephen Hemminger
2026-06-17 18:14   ` Marat Khalili
2026-06-08 20:28 ` [PATCH 4/4] bpf/arm64: add BPF_ABS/BPF_IND packet load support Stephen Hemminger
2026-06-17 19:35   ` Marat Khalili
2026-06-17 17:37 ` [PATCH 0/4] " Marat Khalili
2026-06-17 21:17   ` Stephen Hemminger
2026-06-18 20:47 ` [PATCH v2 0/6] bpf: JIT related bug fixes Stephen Hemminger
2026-06-18 20:47   ` [PATCH v2 1/6] bpf/x86: fix JIT encoding of BPF_JSET with immediate Stephen Hemminger
2026-06-19  2:09     ` Stephen Hemminger
2026-06-18 20:47   ` [PATCH v2 2/6] test/bpf: add JSET test with small immediate Stephen Hemminger
2026-06-18 20:47   ` [PATCH v2 3/6] bpf/arm64: fix offset type to allow a negative jump Stephen Hemminger
2026-06-18 20:47   ` [PATCH v2 4/6] test/bpf: check that JIT was generated Stephen Hemminger
2026-06-18 20:47   ` [PATCH v2 5/6] bpf/arm64: add BPF_ABS/BPF_IND packet load support Stephen Hemminger
2026-06-18 20:47   ` [PATCH v2 6/6] test/bpf: check that bpf_convert can be JIT'd Stephen Hemminger
2026-06-21 16:23 ` [PATCH v3 0/6] bpf: JIT related bug fixes Stephen Hemminger
2026-06-21 16:23   ` [PATCH v3 1/6] bpf/x86: fix JIT encoding of BPF_JSET with immediate Stephen Hemminger
2026-06-23 10:11     ` Marat Khalili
2026-06-21 16:23   ` [PATCH v3 2/6] test/bpf: add JSET test with small immediate Stephen Hemminger
2026-06-23 10:16     ` Marat Khalili
2026-06-21 16:23   ` [PATCH v3 3/6] bpf/arm64: fix offset type to allow a negative jump Stephen Hemminger
2026-06-22 16:26     ` Marat Khalili
2026-06-21 16:23   ` [PATCH v3 4/6] test/bpf: check that JIT was generated Stephen Hemminger
2026-06-21 16:23   ` [PATCH v3 5/6] bpf/arm64: add BPF_ABS/BPF_IND packet load support Stephen Hemminger
2026-06-21 16:23   ` [PATCH v3 6/6] test/bpf: check that bpf_convert can be JIT'd Stephen Hemminger
2026-06-23 13:57     ` Marat Khalili
2026-06-23 15:51       ` Stephen Hemminger
2026-06-23 20:58       ` Stephen Hemminger
2026-06-23 23:23 ` Stephen Hemminger [this message]
2026-06-23 23:23   ` [PATCH v4 1/7] bpf/x86: fix JIT encoding of fixed-width immediates Stephen Hemminger
2026-06-23 23:23   ` [PATCH v4 2/7] test/bpf: add JSET test with small immediate Stephen Hemminger
2026-06-23 23:23   ` [PATCH v4 3/7] test/bpf: add test for large shift Stephen Hemminger
2026-06-23 23:23   ` [PATCH v4 4/7] bpf/arm64: fix offset type to allow a negative jump Stephen Hemminger
2026-06-23 23:23   ` [PATCH v4 5/7] test/bpf: check that JIT was generated Stephen Hemminger
2026-06-23 23:23   ` [PATCH v4 6/7] bpf/arm64: add BPF_ABS/BPF_IND packet load support Stephen Hemminger
2026-06-23 23:23   ` [PATCH v4 7/7] test/bpf: check that bpf_convert can be JIT'd Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260623232522.257208-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.