[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <398c3793-1530-fdcb-3a0c-2b82c52256cb@huaweicloud.com>
Date: Tue, 16 Jan 2024 19:15:30 +0800
From: Hou Tao <houtao@...weicloud.com>
To: Tiezhu Yang <yangtiezhu@...ngson.cn>, Alexei Starovoitov
<ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>
Cc: Eduard Zingerman <eddyz87@...il.com>,
John Fastabend <john.fastabend@...il.com>, Jiri Olsa <jolsa@...nel.org>,
bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v4 2/2] selftests/bpf: Skip callback tests if jit
is disabled in test_verifier
On 1/16/2024 12:50 PM, Tiezhu Yang wrote:
> If CONFIG_BPF_JIT_ALWAYS_ON is not set and bpf_jit_enable is 0, there
> exist 6 failed tests.
>
> [root@...ux bpf]# echo 0 > /proc/sys/net/core/bpf_jit_enable
> [root@...ux bpf]# echo 0 > /proc/sys/kernel/unprivileged_bpf_disabled
> [root@...ux bpf]# ./test_verifier | grep FAIL
> #106/p inline simple bpf_loop call FAIL
> #107/p don't inline bpf_loop call, flags non-zero FAIL
> #108/p don't inline bpf_loop call, callback non-constant FAIL
> #109/p bpf_loop_inline and a dead func FAIL
> #110/p bpf_loop_inline stack locations for loop vars FAIL
> #111/p inline bpf_loop call in a big program FAIL
> Summary: 768 PASSED, 15 SKIPPED, 6 FAILED
>
> The test log shows that callbacks are not allowed in non-JITed programs,
> interpreter doesn't support them yet, thus these tests should be skipped
> if jit is disabled, copy some check functions from the other places under
> tools directory, and then handle this case in do_test_single().
>
> With this patch:
>
> [root@...ux bpf]# echo 0 > /proc/sys/net/core/bpf_jit_enable
> [root@...ux bpf]# echo 0 > /proc/sys/kernel/unprivileged_bpf_disabled
> [root@...ux bpf]# ./test_verifier | grep FAIL
> Summary: 768 PASSED, 21 SKIPPED, 0 FAILED
>
> Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
Acked-by: Hou Tao <houtao1@...wei.com>
Powered by blists - more mailing lists