Re: [PATCH bpf-next 00/10] Add support arena atomics for RV64

From: Daniel Borkmann
Date: Fri Aug 15 2025 - 05:15:45 EST


On 8/5/25 8:52 AM, Pu Lehui wrote:
On 2025/8/5 14:38, Björn Töpel wrote:
Pu Lehui <pulehui@xxxxxxxxxxxxxxx> writes:

From: Pu Lehui <pulehui@xxxxxxxxxx>

patch 1-3 refactor redundant load and store operations.
patch 4-7 add Zacas instructions for cmpxchg.
patch 8 optimizes exception table handling.
patch 9-10 add support arena atomics for RV64.

Tests `test_progs -t atomic,arena` have passed as shown bellow,
as well as `test_verifier` and `test_bpf.ko` have passed.

[...]

Pu Lehui (10):
   riscv, bpf: Extract emit_stx() helper
   riscv, bpf: Extract emit_st() helper
   riscv, bpf: Extract emit_ldx() helper
   riscv: Separate toolchain support dependency from RISCV_ISA_ZACAS
   riscv, bpf: Add rv_ext_enabled macro for runtime detection extentsion
   riscv, bpf: Add Zacas instructions
   riscv, bpf: Optimize cmpxchg insn with Zacas support
   riscv, bpf: Add ex_insn_off and ex_jmp_off for exception table
     handling
   riscv, bpf: Add support arena atomics for RV64
   selftests/bpf: Enable arena atomics tests for RV64

  arch/riscv/Kconfig                            |   1 -
  arch/riscv/include/asm/cmpxchg.h              |   6 +-
  arch/riscv/kernel/setup.c                     |   1 +
  arch/riscv/net/bpf_jit.h                      |  70 ++-
  arch/riscv/net/bpf_jit_comp64.c               | 516 +++++-------------
  .../selftests/bpf/progs/arena_atomics.c       |   9 +-
  6 files changed, 214 insertions(+), 389 deletions(-)

What a nice series! The best kind of changeset -- new feature, less
code! Thank you, Lehui! Again, apologies for the horrible SLA. The
weather in Sweden was simply Too Good this summer!

Sounds like a great vacation!

Thanks for working on this! I just took this into bpf-next, please also
make sure to address the small follow-up request from Bjorn.

Tested-by: Björn Töpel <bjorn@xxxxxxxxxxxx> # QEMU only
Acked-by: Björn Töpel <bjorn@xxxxxxxxxx>

Thanks,
Daniel