• Eduard Zingerman's avatar
    bpf: Remove mark_precise_scalar_ids() · 842edb55
    Eduard Zingerman authored
    Function mark_precise_scalar_ids() is superseded by
    bt_sync_linked_regs() and equal scalars tracking in jump history.
    mark_precise_scalar_ids() propagates precision over registers sharing
    same ID on parent/child state boundaries, while jump history records
    allow bt_sync_linked_regs() to propagate same information with
    instruction level granularity, which is strictly more precise.
    
    This commit removes mark_precise_scalar_ids() and updates test cases
    in progs/verifier_scalar_ids to reflect new verifier behavior.
    
    The tests are updated in the following manner:
    - mark_precise_scalar_ids() propagated precision regardless of
      presence of conditional jumps, while new jump history based logic
      only kicks in when conditional jumps are present.
      Hence test cases are augmented with conditional jumps to still
      trigger precision propagation.
    - As equal scalars tracking no longer relies on parent/child state
      boundaries some test cases are no longer interesting,
      such test cases are removed, namely:
      - precision_same_state and precision_cross_state are superseded by
        linked_regs_bpf_k;
      - precision_same_state_broken_link and equal_scalars_broken_link
        are superseded by linked_regs_broken_link.
    Signed-off-by: default avatarEduard Zingerman <eddyz87@gmail.com>
    Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20240718202357.1746514-3-eddyz87@gmail.com
    842edb55
precise.c 9.49 KB