Skip to content

bpf, riscv64: Support load-acquire and store-release instructions

Peilin Ye bpf linux-riscv 2 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 3 repliesApplied 8/8
  2. v18 patches 15 repliesSuperseded

Changes in v2 from the cover letter

* add Acked-by:, Reviewed-by: and Tested-by: tags from Lehui and Björn
* simplify code logic in PATCH 1 (Lehui)
* in PATCH 3, avoid changing 'return 0;' to 'return ret;' at the end of bpf_jit_emit_insn() (Lehui)

Patches in v2 All 8 applied

#Subject and filesSizeRepliesApplied
1/8bpf/verifier: Handle BPF_LOAD_ACQ instructions in insn_def_regno()kernel/bpf/verifier.c+6 -61 replyApplied
2/8bpf, riscv64: Introduce emit_load_*() and emit_store_*()arch/riscv/net/bpf_jit_comp64.c+143 -990 repliesApplied
3/8bpf, riscv64: Support load-acquire and store-release instructionsarch/riscv/net/bpf_jit.h arch/riscv/net/bpf_jit_comp64.c+85 -51 replyApplied
4/8bpf, riscv64: Skip redundant zext instruction after load-acquirearch/riscv/net/bpf_jit_comp64.c arch/riscv/net/bpf_jit_core.c+19 -70 repliesApplied
5/8selftests/bpf: Use CAN_USE_LOAD_ACQ_STORE_REL when appropriatetools/testing/selftests/bpf/progs/verifier_precision.c tools/testing/selftests/bpf/progs/verifier_store_release.c+5 -70 repliesApplied
6/8selftests/bpf: Avoid passing out-of-range values to __retval()tools/testing/selftests/bpf/progs/verifier_load_acquire.c tools/testing/selftests/bpf/progs/verifier_store_release.c+52 -200 repliesApplied
7/8selftests/bpf: Verify zero-extension behavior in load-acquire teststools/testing/selftests/bpf/progs/verifier_load_acquire.c+4 -40 repliesApplied
8/8selftests/bpf: Enable non-arena load-acquire/store-release selftests for riscv64tools/testing/selftests/bpf/progs/bpf_misc.h+3 -20 repliesApplied

Reviews trailers per patch

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

PatchBjörn TöpelPu LehuiPeilin Ye
1/8A-b T-b R-b
2/8A-b T-b R-b T-b
3/8A-b T-b R-b
4/8A-b T-b R-b
5/8A-b T-b R-b
6/8A-b T-b R-b
7/8A-b T-b R-b
8/8A-b T-b R-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 3 reviewers.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/8] bpf, riscv64: Support load-acquire and store-release instructions

Hi all!

Patchset [1] introduced BPF load-acquire (BPF_LOAD_ACQ) and store-release (BPF_STORE_REL) instructions, and added x86-64 and arm64 JIT compiler support. As a follow-up, this v2 patchset supports load-acquire and store-release instructions for the riscv64 JIT compiler, and introduces some related selftests/ changes.

Specifically:

* PATCH 1 makes insn_def_regno() handle load-acquires properly for bpf_jit_needs_zext() (true for riscv64) architectures
* PATCH 2, 3 from Andrea Parri add the actual support to the riscv64 JIT compiler
* PATCH 4 optimizes code emission by skipping redundant zext instructions inserted by the verifier
* PATCH 5, 6 and 7 are minor selftest/ improvements
* PATCH 8 enables (non-arena) load-acquire/store-release selftests for riscv64

v1: https://lore.kernel.org/bpf/[email protected]/
Changes since v1:

* add Acked-by:, Reviewed-by: and Tested-by: tags from Lehui and Björn
* simplify code logic in PATCH 1 (Lehui)
* in PATCH 3, avoid changing 'return 0;' to 'return ret;' at the end of bpf_jit_emit_insn() (Lehui)

Please refer to individual patches for details. Thanks!

[1] https://lore.kernel.org/all/[email protected]/

Andrea Parri (2):
bpf, riscv64: Introduce emit_load_*() and emit_store_*() bpf, riscv64: Support load-acquire and store-release instructions

Peilin Ye (6):
bpf/verifier: Handle BPF_LOAD_ACQ instructions in insn_def_regno() bpf, riscv64: Skip redundant zext instruction after load-acquire selftests/bpf: Use CAN_USE_LOAD_ACQ_STORE_REL when appropriate selftests/bpf: Avoid passing out-of-range values to __retval() selftests/bpf: Verify zero-extension behavior in load-acquire tests selftests/bpf: Enable non-arena load-acquire/store-release selftests
for riscv64

 arch/riscv/net/bpf_jit.h                      |  15 +
 arch/riscv/net/bpf_jit_comp64.c               | 332 ++++++++++++------
 arch/riscv/net/bpf_jit_core.c                 |   3 +-
 kernel/bpf/verifier.c                         |  12 +-
 tools/testing/selftests/bpf/progs/bpf_misc.h  |   5 +-
 .../bpf/progs/verifier_load_acquire.c         |  48 ++-
 .../selftests/bpf/progs/verifier_precision.c  |   5 +-
 .../bpf/progs/verifier_store_release.c        |  39 +-
 8 files changed, 313 insertions(+), 146 deletions(-)
Signature · 1 line
2.49.0.967.g6a0df3ecc3-goog