linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bpf-next v2 0/5] powerpc64/bpf: Add support for bpf arena and arena atomics
@ 2025-08-29 16:51 Saket Kumar Bhaskar
  2025-08-29 16:51 ` [PATCH bpf-next v2 1/5] powerpc64/bpf: Implement PROBE_MEM32 pseudo instructions Saket Kumar Bhaskar
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Saket Kumar Bhaskar @ 2025-08-29 16:51 UTC (permalink / raw)
  To: bpf, linuxppc-dev, linux-kselftest, linux-kernel
  Cc: hbathini, sachinpb, venkat88, andrii, eddyz87, mykolal, ast,
	daniel, martin.lau, song, yonghong.song, john.fastabend, kpsingh,
	sdf, haoluo, jolsa, christophe.leroy, naveen, maddy, mpe, npiggin,
	memxor, iii, shuah

This patch series introduces support for the PROBE_MEM32,
bpf_addr_space_cast and PROBE_ATOMIC instructions in the powerpc BPF JIT,
facilitating the implementation of BPF arena and arena atomics.

The last patch in the series has fix for arena spinlock selftest
failure.

All selftests related to bpf_arena, bpf_arena_atomic(except
load_acquire/store_release) enablement are passing:

# ./test_progs -t arena_list
#5/1     arena_list/arena_list_1:OK
#5/2     arena_list/arena_list_1000:OK
#5       arena_list:OK
Summary: 1/2 PASSED, 0 SKIPPED, 0 FAILED

# ./test_progs -t arena_htab
#4/1     arena_htab/arena_htab_llvm:OK
#4/2     arena_htab/arena_htab_asm:OK
#4       arena_htab:OK
Summary: 1/2 PASSED, 0 SKIPPED, 0 FAILED

# ./test_progs -t verifier_arena
#464/1   verifier_arena/basic_alloc1:OK
#464/2   verifier_arena/basic_alloc2:OK
#464/3   verifier_arena/basic_alloc3:OK
#464/4   verifier_arena/iter_maps1:OK
#464/5   verifier_arena/iter_maps2:OK
#464/6   verifier_arena/iter_maps3:OK
#464     verifier_arena:OK
#465/1   verifier_arena_large/big_alloc1:OK
#465/2   verifier_arena_large/big_alloc2:OK
#465     verifier_arena_large:OK
Summary: 2/8 PASSED, 0 SKIPPED, 0 FAILED

# ./test_progs -t arena_atomics
#3/1     arena_atomics/add:OK
#3/2     arena_atomics/sub:OK
#3/3     arena_atomics/and:OK
#3/4     arena_atomics/or:OK
#3/5     arena_atomics/xor:OK
#3/6     arena_atomics/cmpxchg:OK
#3/7     arena_atomics/xchg:OK
#3/8     arena_atomics/uaf:OK
#3/9     arena_atomics/load_acquire:SKIP
#3/10    arena_atomics/store_release:SKIP
#3       arena_atomics:OK (SKIP: 2/10)
Summary: 1/8 PASSED, 2 SKIPPED, 0 FAILED

All selftests related to arena_spin_lock are passing:

# ./test_progs -t arena_spin_lock
#6/1     arena_spin_lock/arena_spin_lock_1:OK
#6/2     arena_spin_lock/arena_spin_lock_1000:OK
#6/3     arena_spin_lock/arena_spin_lock_50000:OK
#6       arena_spin_lock:OK
Summary: 1/3 PASSED, 0 SKIPPED, 0 FAILED

Changes since v1:

Addressed comments from Chris:
* Squashed introduction of bpf_jit_emit_probe_mem_store() and its usage in
  one patch.
* Defined and used PPC_RAW_RLDICL_DOT to avoid the CMPDI.
* Removed conditional statement for fixup[0] = PPC_RAW_LI(dst_reg, 0);
* Indicated this change is limited to powerpc64 in subject.

Addressed comments from Alexei:
* Removed skel->rodata->nr_cpus = get_nprocs() and its usage to get
  currently online cpus(as it needs to be updated from userspace).

Saket Kumar Bhaskar (5):
  powerpc64/bpf: Implement PROBE_MEM32 pseudo instructions
  powerpc64/bpf: Implement bpf_addr_space_cast instruction
  powerpc64/bpf: Introduce bpf_jit_emit_atomic_ops() to emit atomic
    instructions
  powerpc64/bpf: Implement PROBE_ATOMIC instructions
  selftests/bpf: Fix arena_spin_lock selftest failure

 arch/powerpc/include/asm/ppc-opcode.h         |   1 +
 arch/powerpc/net/bpf_jit.h                    |   6 +-
 arch/powerpc/net/bpf_jit_comp.c               |  32 +-
 arch/powerpc/net/bpf_jit_comp32.c             |   2 +-
 arch/powerpc/net/bpf_jit_comp64.c             | 401 +++++++++++++-----
 .../bpf/prog_tests/arena_spin_lock.c          |  13 +
 .../selftests/bpf/progs/arena_spin_lock.c     |   5 +-
 7 files changed, 347 insertions(+), 113 deletions(-)

-- 
2.43.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-09-04 10:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29 16:51 [bpf-next v2 0/5] powerpc64/bpf: Add support for bpf arena and arena atomics Saket Kumar Bhaskar
2025-08-29 16:51 ` [PATCH bpf-next v2 1/5] powerpc64/bpf: Implement PROBE_MEM32 pseudo instructions Saket Kumar Bhaskar
2025-09-04  8:16   ` Hari Bathini
2025-08-29 16:51 ` [PATCH bpf-next v2 2/5] powerpc64/bpf: Implement bpf_addr_space_cast instruction Saket Kumar Bhaskar
2025-08-29 16:51 ` [PATCH bpf-next v2 3/5] powerpc64/bpf: Introduce bpf_jit_emit_atomic_ops() to emit atomic instructions Saket Kumar Bhaskar
2025-08-29 16:51 ` [PATCH bpf-next v2 4/5] powerpc64/bpf: Implement PROBE_ATOMIC instructions Saket Kumar Bhaskar
2025-08-29 16:51 ` [PATCH bpf-next v2 5/5] selftests/bpf: Fix arena_spin_lock selftest failure Saket Kumar Bhaskar
2025-09-04  8:09   ` Hari Bathini
2025-09-04  8:25     ` Saket Kumar Bhaskar
2025-09-04 10:34       ` Saket Kumar Bhaskar
2025-09-02 15:33 ` [bpf-next v2 0/5] powerpc64/bpf: Add support for bpf arena and arena atomics Venkat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).