Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selftests/bpf: Fix map_kptr test. #4598

Closed
wants to merge 2 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: selftests/bpf: Fix map_kptr test.
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=721900

@kernel-patches-bot
Copy link
Author

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

@kernel-patches-bot
Copy link
Author

Upstream branch: 213aacb
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=721900
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: 5e53e5c
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=721900
version: 1

The compiler is optimizing out majority of unref_ptr read/writes, so the test
wasn't testing much. For example, one could delete '__kptr' tag from
'struct prog_test_ref_kfunc __kptr *unref_ptr;' and the test would still "pass".

Convert it to volatile stores. Confirmed by comparing bpf asm before/after.

Fixes: 2cbc469 ("selftests/bpf: Add C tests for kptr")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=721900 irrelevant now. Closing PR.

@kernel-patches-bot kernel-patches-bot deleted the series/721900=>bpf-next branch February 15, 2023 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant