diff options
author | Jiong Wang <jiong.wang@netronome.com> | 2019-05-24 23:25:20 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-05-24 18:58:37 -0700 |
commit | f3b55abb6d5a522228e136c3bc4a9a716d5d8a54 (patch) | |
tree | 67608709b1dd5b9e560e5af8238e978d0b6feaa0 /tools/testing/selftests/bpf/test_socket_cookie.c | |
parent | libbpf: add "prog_flags" to bpf_program/bpf_prog_load_attr/bpf_load_program_attr (diff) | |
download | linux-dev-f3b55abb6d5a522228e136c3bc4a9a716d5d8a54.tar.xz linux-dev-f3b55abb6d5a522228e136c3bc4a9a716d5d8a54.zip |
selftests: bpf: adjust several test_verifier helpers for insn insertion
- bpf_fill_ld_abs_vlan_push_pop:
Prevent zext happens inside PUSH_CNT loop. This could happen because
of BPF_LD_ABS (32-bit def) + BPF_JMP (64-bit use), or BPF_LD_ABS +
EXIT (64-bit use of R0). So, change BPF_JMP to BPF_JMP32 and redefine
R0 at exit path to cut off the data-flow from inside the loop.
- bpf_fill_jump_around_ld_abs:
Jump range is limited to 16 bit. every ld_abs is replaced by 6 insns,
but on arches like arm, ppc etc, there will be one BPF_ZEXT inserted
to extend the error value of the inlined ld_abs sequence which then
contains 7 insns. so, set the dividend to 7 so the testcase could
work on all arches.
- bpf_fill_scale1/bpf_fill_scale2:
Both contains ~1M BPF_ALU32_IMM which will trigger ~1M insn patcher
call because of hi32 randomization later when BPF_F_TEST_RND_HI32 is
set for bpf selftests. Insn patcher is not efficient that 1M call to
it will hang computer. So , change to BPF_ALU64_IMM to avoid hi32
randomization.
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_socket_cookie.c')
0 files changed, 0 insertions, 0 deletions