diff options
| author | Alexei Starovoitov <[email protected]> | 2023-02-14 23:50:51 +0000 |
|---|---|---|
| committer | Martin KaFai Lau <[email protected]> | 2023-02-15 17:24:59 +0000 |
| commit | 62d101d5f422cde39b269f7eb4cbbe2f1e26f9d4 (patch) | |
| tree | 59b808098f150e0f6ac994adcb30f2bae2c271b0 /tools/testing/selftests/bpf/prog_tests/recursion.c | |
| parent | selftests/bpf: Cross-compile bpftool (diff) | |
| download | kernel-62d101d5f422cde39b269f7eb4cbbe2f1e26f9d4.tar.gz kernel-62d101d5f422cde39b269f7eb4cbbe2f1e26f9d4.zip | |
selftests/bpf: Fix map_kptr test.
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: 2cbc469a6fc3 ("selftests/bpf: Add C tests for kptr")
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Stanislav Fomichev <[email protected]>
Acked-by: Kumar Kartikeya Dwivedi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/recursion.c')
0 files changed, 0 insertions, 0 deletions
