Message ID | 20230516214945.1013578-1-yhs@fb.com (mailing list archive) |
---|---|
State | Accepted |
Commit | de58ef414d8d7a0a635cd331b3b013d8216c4e60 |
Delegated to: | BPF |
Headers | show |
Series | [bpf-next] selftests/bpf: Fix s390 sock_field test failure | expand |
Hello: This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <ast@kernel.org>: On Tue, 16 May 2023 14:49:45 -0700 you wrote: > llvm patch [1] enabled cross-function optimization for func arguments > (ArgumentPromotion) at -O2 level. And this caused s390 sock_fields > test failure ([2]). The failure is gone right now as patch [1] was > reverted in [3]. But it is possible that patch [3] will be reverted > again and then the test failure in [2] will show up again. So it is > desirable to fix the failure regardless. > > [...] Here is the summary with links: - [bpf-next] selftests/bpf: Fix s390 sock_field test failure https://git.kernel.org/bpf/bpf-next/c/de58ef414d8d You are awesome, thank you!
diff --git a/tools/testing/selftests/bpf/progs/test_sock_fields.c b/tools/testing/selftests/bpf/progs/test_sock_fields.c index bbad3c2d9aa5..f75e531bf36f 100644 --- a/tools/testing/selftests/bpf/progs/test_sock_fields.c +++ b/tools/testing/selftests/bpf/progs/test_sock_fields.c @@ -265,7 +265,10 @@ static __noinline bool sk_dst_port__load_word(struct bpf_sock *sk) static __noinline bool sk_dst_port__load_half(struct bpf_sock *sk) { - __u16 *half = (__u16 *)&sk->dst_port; + __u16 *half; + + asm volatile (""); + half = (__u16 *)&sk->dst_port; return half[0] == bpf_htons(0xcafe); }