Re: [PATCH bpf-next 3/4] selftests/bpf: verifier precise tests
From: Alexei Starovoitov <hidden>
Date: 2019-08-26 22:47:29
Also in:
bpf
On Sun, Aug 25, 2019 at 10:22:13PM -0700, Song Liu wrote:
On Fri, Aug 23, 2019 at 2:59 AM Alexei Starovoitov [off-list ref] wrote:quoted
Use BPF_F_TEST_STATE_FREQ flag to check that precision tracking works as expected by comparing every step it takes. Signed-off-by: Alexei Starovoitov <ast@kernel.org> +static bool cmp_str_seq(const char *log, const char *exp)Maybe call it str_str_seq()?
imo cmp*() returns the result of comparison. Which is either boolean or -1,0,1. Whereas str*() should return the address, index, or offset. Hence I used cmp_ prefix here.
quoted
static void do_test_single(struct bpf_test *test, bool unpriv, int *passes, int *errors) {@@ -897,14 +929,20 @@ static void do_test_single(struct bpf_test *test, bool unpriv, pflags |= BPF_F_STRICT_ALIGNMENT; if (test->flags & F_NEEDS_EFFICIENT_UNALIGNED_ACCESS) pflags |= BPF_F_ANY_ALIGNMENT; + if (test->flags & ~3) + pflags |= test->flags;^^^^^^ why do we need these two lines?
To pass flags from test into attr.prog_flags. Older F_NEEDS_* and F_LOAD_* may use some cleanup and can be removed, but it would be a different patch.