IRQ save/restore
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
- v6 Latest7 patches 0 repliesApplied 7/7
- v57 patches 5 repliesSuperseded
- v47 patches 0 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 7 patches | 13 replies | Superseded | |
| v2 | 7 patches | 1 reply | Superseded | |
| v1 | 7 patches | 21 replies | Superseded |
Changes in v6 from the cover letter
v5: https://lore.kernel.org/bpf/[email protected]
* Add Eduard's Acked-by on patch 2
* Remove gen_id parameter to acquire_reference_state (Alexei)
* Remove space before REF_TYPE_LOCK (Alexei)
* Fix link to v4 in changelog
Patches in v6 All 7 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | bpf: Consolidate locks and reference state in verifier stateinclude/ kernel/ kernel/ | +88 | 0 replies | Applied |
| 2/7 | bpf: Refactor {acquire,release}_reference_statekernel/ | +59 | 0 replies | Applied |
| 3/7 | bpf: Refactor mark_{dynptr,iter}_readkernel/ | +21 | 0 replies | Applied |
| 4/7 | bpf: Introduce support for bpf_local_irq_{save,restore}include/ kernel/ kernel/ +1 more | +320 | 0 replies | Applied |
| 5/7 | bpf: Improve verifier log for resource leak on exitkernel/ tools/ tools/ +1 more | +11 | 0 replies | Applied |
| 6/7 | selftests/bpf: Expand coverage of preempt tests to sleepable kfunctools/ | +14 | 0 replies | Applied |
| 7/7 | selftests/bpf: Add IRQ save/restore teststools/ tools/ | +446 | 0 replies | Applied |
Reviews trailers per patch
All 7 patches have a Reviewed-by or Acked-by.
| Patch | Eduard Zingerman |
|---|---|
| 1/7 | A-b |
| 2/7 | A-b |
| 3/7 | A-b |
| 4/7 | A-b |
| 5/7 | A-b |
| 6/7 | A-b |
| 7/7 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v6 0/7] IRQ save/restore
This set introduces support for managing IRQ state from BPF programs. Two new kfuncs, bpf_local_irq_save, and bpf_local_irq_restore are introduced to enable this functionality.
Intended use cases are writing IRQ safe data structures (e.g. memory allocator) in BPF programs natively, and use in new spin locking primitives intended to be introduced in the next few weeks.
The set begins with some refactoring patches before the actual functionality is introduced. Patch 1 consolidates all resource related state in bpf_verifier_state, and moves it out from bpf_func_state.
Patch 2 refactor acquire and release functions for reference state to make them reusable without duplication for other resource types.
After this, patch 3 refactors stack slot liveness marking logic to be shared between dynptr, and iterators, in preparation for introducing same logic for irq flag object on stack.
Finally, patch 4 and 7 introduce the new kfuncs and their selftests. For more details, please inspect the patch commit logs. Patch 5 makes the error message in case of resource leaks under BPF_EXIT a bit clearer. Patch 6 expands coverage of existing preempt-disable selftest to cover sleepable kfuncs.
See individual patches for more details.
Changelog:
----------
v5 -> v6
v5: https://lore.kernel.org/bpf/[email protected]
* Add Eduard's Acked-by on patch 2
* Remove gen_id parameter to acquire_reference_state (Alexei)
* Remove space before REF_TYPE_LOCK (Alexei)
* Fix link to v4 in changelog
v4 -> v5
v4: https://lore.kernel.org/bpf/[email protected]
* Do regno - 1 when printing argument
* Pass verifier state explicitly into print_{insn,verifier}_state (Eduard)
* Pass frameno instead of bpf_func_state (Eduard)
* Move bpf_reference_state *refs after parent to fill two holes in bpf_verifier_state (Eduard). The hunk fixing that bug is in the commit adding IRQ save/restore kfuncs, as it is only needed then.
* Fix bug in release_reference_state breaking stack property (Eduard)
* Add selftest for triggering and reproducing bug found by Eduard irq_ooo_refs_array in final patch
* Print insn_idx and active_irq_id on error (Eduard)
* Add more acks
v3 -> v4
v3: https://lore.kernel.org/bpf/[email protected]
* Add yet another missing kfunc declaration to silence s390 CI
v2 -> v3
v2: https://lore.kernel.org/bpf/[email protected]
* Drop REF_TYPE_LOCK_MASK
* Add kfunc declarations to selftest to silence s390 CI errors
v1 -> v2
v1: https://lore.kernel.org/bpf/[email protected]
* Drop reference -> resource renaming in the verifier (Eduard, Alexei)
* Change verifier log for check_resource_leak for BPF_EXIT (Eduard)
* Remove id parameter from acquire_resource_state, read s->id (Eduard)
* Rename erase to release for reference state (Eduard)
* Move resource state to bpf_verifier_state (Eduard, Alexei)
* Drop unnecessary casting to/from u64 in helpers (Eduard)
* Add test for arg != PTR_TO_STACK (Eduard)
* Drop now redundant tests (Eduard)
* Address some other misc nits
* Add Reviewed-by and Acked-by from Eduard
Kumar Kartikeya Dwivedi (7):
bpf: Consolidate locks and reference state in verifier state
bpf: Refactor {acquire,release}_reference_state
bpf: Refactor mark_{dynptr,iter}_read
bpf: Introduce support for bpf_local_irq_{save,restore}
bpf: Improve verifier log for resource leak on exit selftests/bpf: Expand coverage of preempt tests to sleepable kfunc selftests/bpf: Add IRQ save/restore tests
include/linux/bpf_verifier.h | 26 +- kernel/bpf/helpers.c | 17 + kernel/bpf/log.c | 21 +- kernel/bpf/verifier.c | 573 +++++++++++++----- .../selftests/bpf/prog_tests/verifier.c | 2 + .../selftests/bpf/progs/exceptions_fail.c | 4 +- tools/testing/selftests/bpf/progs/irq.c | 444 ++++++++++++++ .../selftests/bpf/progs/preempt_lock.c | 28 +- .../selftests/bpf/progs/verifier_spin_lock.c | 2 +- 9 files changed, 949 insertions(+), 168 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/irq.c
base-commit: c721d8f8b196285a59ed5c940e856bce9890523f
Signature · 1 line
2.43.5