Skip to content

Modify some code about test_verifier#11344

Open
kernel-patches-daemon-bpf[bot] wants to merge 2 commits intobpf-next_basefrom
series/1064123=>bpf-next
Open

Modify some code about test_verifier#11344
kernel-patches-daemon-bpf[bot] wants to merge 2 commits intobpf-next_basefrom
series/1064123=>bpf-next

Conversation

@kernel-patches-daemon-bpf
Copy link

Pull request for series with
subject: Modify some code about test_verifier
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1064123

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: bd2e02e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1064123
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 0c55d48
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1064123
version: 1

CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is set unconditionally for the
most archs such as x86_64, aarch64, ppc64el and s390x, but this config
may be not set by users for riscv64 and loongarch64.

If CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set, the BPF verifier
detects if a program has unaligned access and then rejects them. So it
should also check the flag F_NEEDS_EFFICIENT_UNALIGNED_ACCESS if the
expected result is REJECT and set alignment_prevented_execution as 1,
then the message "(NOTE: not executed due to unknown alignment)" can
be printed for some testcases of test_verifier to reflect the reality.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
There exists failure when executing the testcase "./test_verifier 190" if
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set on LoongArch.

  #190/p calls: two calls that return map_value with incorrect bool check FAIL
  ...
  misaligned access off (0x0; 0xffffffffffffffff)+0 size 8
  ...
  Summary: 0 PASSED, 0 SKIPPED, 1 FAILED

It means that the program has unaligned accesses, but the kernel sets
CONFIG_ARCH_STRICT_ALIGN by default to enable -mstrict-align to prevent
unaligned accesses, so add a flag F_NEEDS_EFFICIENT_UNALIGNED_ACCESS
into the testcase to avoid the failure.

This is somehow similar with the commit ce1f289 ("selftests/bpf:
Add F_NEEDS_EFFICIENT_UNALIGNED_ACCESS to some tests").

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e95e85b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1064123
version: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant