All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] LoongArch bpf kptr xchg inline support
@ 2026-06-03 10:04 Chenguang Zhao
  2026-06-03 10:04 ` [PATCH v2 1/4] LoongArch: bpf: Use amswap_db for BPF atomic xchg Chenguang Zhao
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Chenguang Zhao @ 2026-06-03 10:04 UTC (permalink / raw)
  To: Huacai Chen, WANG Xuerui, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman,
	Kumar Kartikeya Dwivedi, Tiezhu Yang
  Cc: Chenguang Zhao, Hengqi Chen, Song Liu, Yonghong Song, Jiri Olsa,
	Shuah Khan, loongarch, bpf, linux-kselftest

This series replaces the single patch "LoongArch: bpf: Support kptr xchg
inline" with four logically separate changes as requested during review.

Patch 1 fixes BPF JIT atomic xchg to use amswap_db.{w,d}, which provide
the full barrier semantics required by LKMM for value-returning atomic RMW.
This is independent of kptr inlining.

Patch 2 advertises bpf_jit_supports_ptr_xchg() so the verifier may inline
bpf_kptr_xchg() to BPF_XCHG on LoongArch.

Patches 3 and 4 extend bpf selftests: functional coverage via
./bench -d 30 -w 5 -p 1 kptr-xchg --nr-loops 256

Chenguang Zhao (4):
  LoongArch: bpf: Use amswap_db for BPF atomic xchg
  LoongArch: bpf: Advertise JIT support for kptr xchg inline
  selftests/bpf: Enable kptr_xchg_inline test on LoongArch
  selftests/bpf: Add kptr-xchg benchmark

 arch/loongarch/include/asm/inst.h             |  2 +
 arch/loongarch/net/bpf_jit.c                  |  9 +-
 tools/testing/selftests/bpf/Makefile          |  2 +
 tools/testing/selftests/bpf/bench.c           |  2 +
 .../selftests/bpf/benchs/bench_kptr_xchg.c    | 96 +++++++++++++++++++
 .../bpf/prog_tests/kptr_xchg_inline.c         |  3 +-
 .../selftests/bpf/progs/kptr_xchg_bench.c     | 48 ++++++++++
 7 files changed, 159 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/benchs/bench_kptr_xchg.c
 create mode 100644 tools/testing/selftests/bpf/progs/kptr_xchg_bench.c

---
v2:
 - Split the original single patch into four separate commits. 
 - Switch BPF_W/BPF_DW atomic xchg from plain amswap{w,d} to barrier-aware amswapdbw/amswapdbd.

v1:
 - https://lore.kernel.org/all/20260602021515.214560-1-zhaochenguang@kylinos.cn/

-- 
2.25.1


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

end of thread, other threads:[~2026-06-03 10:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03 10:04 [PATCH v2 0/4] LoongArch bpf kptr xchg inline support Chenguang Zhao
2026-06-03 10:04 ` [PATCH v2 1/4] LoongArch: bpf: Use amswap_db for BPF atomic xchg Chenguang Zhao
2026-06-03 10:16   ` sashiko-bot
2026-06-03 10:59   ` bot+bpf-ci
2026-06-03 10:04 ` [PATCH v2 2/4] LoongArch: bpf: Advertise JIT support for kptr xchg inline Chenguang Zhao
2026-06-03 10:27   ` sashiko-bot
2026-06-03 10:41   ` bot+bpf-ci
2026-06-03 10:04 ` [PATCH v2 3/4] selftests/bpf: Enable kptr_xchg_inline test on LoongArch Chenguang Zhao
2026-06-03 10:04 ` [PATCH v2 4/4] selftests/bpf: Add kptr-xchg benchmark Chenguang Zhao
2026-06-03 10:40   ` sashiko-bot

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.