diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2022-12-06 15:33:44 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-12-06 19:14:38 -0800 |
commit | a095f421057e22853022cb644b1589d0dd0e756e (patch) | |
tree | c33f61ef1b9eb4bb28e81e0c4abca9ae4b6ad831 /tools/testing/selftests/bpf/prog_tests/recursion.c | |
parent | bffdeaa8a5af7200b0e74c9d5a41167f86626a36 (diff) |
bpf: mostly decouple jump history management from is_state_visited()
Jump history updating and state equivalence checks are conceptually
independent, so move push_jmp_history() out of is_state_visited(). Also
make a decision whether to perform state equivalence checks or not one
layer higher in do_check(), keeping is_state_visited() unconditionally
performing state checks.
push_jmp_history() should be performed after state checks. There is just
one small non-uniformity. When is_state_visited() finds already
validated equivalent state, it propagates precision marks to current
state's parent chain. For this to work correctly, jump history has to be
updated, so is_state_visited() is doing that internally.
But if no equivalent verified state is found, jump history has to be
updated in a newly cloned child state, so is_jmp_point()
+ push_jmp_history() is performed after is_state_visited() exited with
zero result, which means "proceed with validation".
This change has no functional changes. It's not strictly necessary, but
feels right to decouple these two processes.
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20221206233345.438540-3-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/recursion.c')
0 files changed, 0 insertions, 0 deletions