Skip to content

Optimize bounds refinement by reordering deductions

Paul Chaignon bpf 1 version Applied

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

  1. v3 Latest3 patches 5 repliesApplied 3/3

Changes in v3 from the cover letter

- Added first commit from Eduard that significantly helps with readability of second commit.
- Reshuffled a bit more the functions in the second commit to improve precision (Eduard).
- Rebased.

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: better naming for __reg_deduce_bounds() partskernel/bpf/verifier.c+11 -60 repliesApplied
2/3bpf: Avoid one round of bounds deductionkernel/bpf/verifier.c+1 -20 repliesApplied
3/3selftests/bpf: Test case for refinement improvement using 64b boundstools/testing/selftests/bpf/progs/verifier_bounds.c+33 -01 replyApplied

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchShung-Hsi YuEduard Zingerman
1/3
2/3A-b
3/3T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/3] Optimize bounds refinement by reordering deductions

This patchset optimizes the bounds refinement (reg_bounds_sync) by reordering deductions in __reg_deduce_bounds. This reordering allows us to improve precision slightly while losing one call to __reg_deduce_bounds.

The first patch from Eduard refactors the __reg_deduce_bounds subfunctions, the second patch implements the reordering, and the last one adds a selftest.

Changes in v3:
- Added first commit from Eduard that significantly helps with readability of second commit.
- Reshuffled a bit more the functions in the second commit to improve precision (Eduard).
- Rebased.
Changes in v2:
- Updated description to mention potential precision improvement and to clarify the sequence of refinements (Shung-Hsi).
- Added the second patch.
- Rebased.

Eduard Zingerman (1):
bpf: better naming for __reg_deduce_bounds() parts

Paul Chaignon (2):
bpf: Avoid one round of bounds deduction
selftests/bpf: Test case for refinement improvement using 64b bounds

 kernel/bpf/verifier.c                         | 18 ++++++----
 .../selftests/bpf/progs/verifier_bounds.c     | 33 +++++++++++++++++++
 2 files changed, 44 insertions(+), 7 deletions(-)
Signature · 1 line
2.43.0