bpf: Make the verifier recognize llvm register allocation patterns.
Status from this message: This series was applied to bpf/bpf-next.git (refs/heads/master):
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 15 repliesApplied 4/4
- v13 patches 14 repliesSuperseded
Changes in v2 from the cover letter
- fixed 32-bit mov issue spotted by John.
- allowed r2=r1; r3=r2; sequence as suggested by John.
- added comments, acks, more tests.
Patches in v2 All 4 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | bpf: Propagate scalar ranges through register assignments.kernel/ tools/ tools/ | +59 | 1 reply | Applied |
| 2/4 | bpf: Track spill/fill of bounded scalars.kernel/ | +15 | 1 reply | Applied |
| 3/4 | selftests/bpf: Add profiler testtools/ tools/ tools/ +4 more | +1274 | 12 replies | Applied |
| 4/4 | selftests/bpf: Asm tests for the verifier regalloc tracking.tools/ | +243 | 1 reply | Applied |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Andrii Nakryiko | Yonghong Song | John Fastabend | Song Liu |
|---|---|---|---|---|
| 1/4 | A-b | A-b | ||
| 2/4 | A-b | A-b | ||
| 3/4 | A-b | T-b | ||
| 4/4 | A-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v2 bpf-next 0/4] bpf: Make the verifier recognize llvm register allocation patterns.
From: Alexei Starovoitov <[email protected]>
v1->v2:
- fixed 32-bit mov issue spotted by John.
- allowed r2=r1; r3=r2; sequence as suggested by John.
- added comments, acks, more tests.
Make two verifier improvements:
- The llvm register allocator may use two different registers representing the same virtual register. Teach the verifier to recognize that.
- Track bounded scalar spill/fill.
The profiler[123] test in patch 3 will fail to load without patches 1 and 2. The profiler[23] test may fail to load on older llvm due to speculative code motion nd instruction combining optimizations that are fixed in
https://reviews.llvm.org/D85570
Alexei Starovoitov (3):
bpf: Propagate scalar ranges through register assignments. selftests/bpf: Add profiler test
selftests/bpf: Asm tests for the verifier regalloc tracking.
Yonghong Song (1):
bpf: Track spill/fill of bounded scalars.
kernel/bpf/verifier.c | 66 +- tools/testing/selftests/bpf/README.rst | 38 + .../testing/selftests/bpf/prog_tests/align.c | 16 +- .../selftests/bpf/prog_tests/test_profiler.c | 72 ++ tools/testing/selftests/bpf/progs/profiler.h | 177 ++++ .../selftests/bpf/progs/profiler.inc.h | 969 ++++++++++++++++++ tools/testing/selftests/bpf/progs/profiler1.c | 6 + tools/testing/selftests/bpf/progs/profiler2.c | 6 + tools/testing/selftests/bpf/progs/profiler3.c | 6 + .../bpf/verifier/direct_packet_access.c | 2 +- .../testing/selftests/bpf/verifier/regalloc.c | 243 +++++ 11 files changed, 1591 insertions(+), 10 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/test_profiler.c create mode 100644 tools/testing/selftests/bpf/progs/profiler.h create mode 100644 tools/testing/selftests/bpf/progs/profiler.inc.h create mode 100644 tools/testing/selftests/bpf/progs/profiler1.c create mode 100644 tools/testing/selftests/bpf/progs/profiler2.c create mode 100644 tools/testing/selftests/bpf/progs/profiler3.c create mode 100644 tools/testing/selftests/bpf/verifier/regalloc.c
Signature · 1 line
2.23.0