public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v3 0/3] Global subprogs in RCU/{preempt,irq}-disabled sections
@ 2025-03-01 15:18 Kumar Kartikeya Dwivedi
  2025-03-01 15:18 ` [PATCH bpf-next v3 1/3] bpf: Summarize sleepable global subprogs Kumar Kartikeya Dwivedi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kumar Kartikeya Dwivedi @ 2025-03-01 15:18 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Martin KaFai Lau, Eduard Zingerman, kkd, kernel-team

Small change to allow non-sleepable global subprogs in
RCU, preempt-disabled, and irq-disabled sections. For
now, we don't lift the limitation for locks as it requires
more analysis, and will do this one resilient spin locks
land.

This surfaced a bug where sleepable global subprogs were
allowed in RCU read sections, that has been fixed. Tests
have been added to cover various cases.

Changelog:
----------
v2 -> v3
v2: https://lore.kernel.org/bpf/20250301030205.1221223-1-memxor@gmail.com

  * Fix broken to_be_replaced argument in the selftest.
  * Adjust selftest program type.

v1 -> v2
v1: https://lore.kernel.org/bpf/20250228162858.1073529-1-memxor@gmail.com

  * Rename subprog_info[i].sleepable to might_sleep, which more
    accurately reflects the nature of the bit. 'sleepable' means whether
    a given context is allowed to, while might_sleep captures if it
    does.
  * Disallow extensions that might sleep to attach to targets that don't
    sleep, since they'd be permitted to be called in atomic contexts. (Eduard)
  * Add tests for mixing non-sleepable and sleepable global function
    calls, and extensions attaching to non-sleepable global functions. (Eduard)
  * Rename changes_pkt_data -> summarization

Kumar Kartikeya Dwivedi (3):
  bpf: Summarize sleepable global subprogs
  selftests/bpf: Test sleepable global subprogs in atomic contexts
  selftests/bpf: Add tests for extending sleepable global subprogs

 include/linux/bpf.h                           |   1 +
 include/linux/bpf_verifier.h                  |   1 +
 kernel/bpf/verifier.c                         |  62 ++++++--
 .../bpf/prog_tests/changes_pkt_data.c         | 107 -------------
 .../selftests/bpf/prog_tests/rcu_read_lock.c  |   3 +
 .../selftests/bpf/prog_tests/spin_lock.c      |   3 +
 .../selftests/bpf/prog_tests/summarization.c  | 144 ++++++++++++++++++
 .../selftests/bpf/progs/changes_pkt_data.c    |  39 -----
 tools/testing/selftests/bpf/progs/irq.c       |  71 ++++++++-
 .../selftests/bpf/progs/preempt_lock.c        |  68 ++++++++-
 .../selftests/bpf/progs/rcu_read_lock.c       |  58 +++++++
 .../selftests/bpf/progs/summarization.c       |  78 ++++++++++
 ...ta_freplace.c => summarization_freplace.c} |  17 ++-
 .../selftests/bpf/progs/test_spin_lock_fail.c |  69 +++++++++
 14 files changed, 558 insertions(+), 163 deletions(-)
 delete mode 100644 tools/testing/selftests/bpf/prog_tests/changes_pkt_data.c
 create mode 100644 tools/testing/selftests/bpf/prog_tests/summarization.c
 delete mode 100644 tools/testing/selftests/bpf/progs/changes_pkt_data.c
 create mode 100644 tools/testing/selftests/bpf/progs/summarization.c
 rename tools/testing/selftests/bpf/progs/{changes_pkt_data_freplace.c => summarization_freplace.c} (57%)


base-commit: 0b9363131daf4227d5ae11ee677acdcfff06e938
-- 
2.43.5


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

end of thread, other threads:[~2025-03-02 22:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-01 15:18 [PATCH bpf-next v3 0/3] Global subprogs in RCU/{preempt,irq}-disabled sections Kumar Kartikeya Dwivedi
2025-03-01 15:18 ` [PATCH bpf-next v3 1/3] bpf: Summarize sleepable global subprogs Kumar Kartikeya Dwivedi
2025-03-01 15:18 ` [PATCH bpf-next v3 2/3] selftests/bpf: Test sleepable global subprogs in atomic contexts Kumar Kartikeya Dwivedi
2025-03-01 15:18 ` [PATCH bpf-next v3 3/3] selftests/bpf: Add tests for extending sleepable global subprogs Kumar Kartikeya Dwivedi
2025-03-02 22:20 ` [PATCH bpf-next v3 0/3] Global subprogs in RCU/{preempt,irq}-disabled sections patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox