]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: BPF test_verifier selftests for bpf_loop inlining
authorEduard Zingerman <eddyz87@gmail.com>
Mon, 20 Jun 2022 23:53:43 +0000 (02:53 +0300)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 21 Jun 2022 00:40:51 +0000 (17:40 -0700)
commitc99404e3945ba6cdc9bfb566af070c759a362810
treef3ea7252815a35d68dc4058ff8c7c22b95c06631
parent3eddb97c081002082c9c17a48fcd7b3284e03bd1
selftests/bpf: BPF test_verifier selftests for bpf_loop inlining

A number of test cases for BPF selftests test_verifier to check how
bpf_loop inline transformation rewrites the BPF program. The following
cases are covered:
 - happy path
 - no-rewrite when flags is non-zero
 - no-rewrite when callback is non-constant
 - subprogno in insn_aux is updated correctly when dead sub-programs
   are removed
 - check that correct stack offsets are assigned for spilling of R6-R8
   registers

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/r/20220620235344.569325-5-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/verifier/bpf_loop_inline.c [new file with mode: 0644]