selftests/bpf: relax expected log messages to allow emitting BPF_ST
authorEduard Zingerman <eddyz87@gmail.com>
Tue, 8 Aug 2023 16:27:55 +0000 (19:27 +0300)
committerMartin KaFai Lau <martin.lau@kernel.org>
Wed, 9 Aug 2023 00:02:22 +0000 (17:02 -0700)
commit898f55f50a00f56dac1ef55f5478c10a7511d0a6
tree2c5e39b685d9d60422e268735abbdeb64ec2e30f
parent96ead1e702902c21513354174942415eed0958f3
selftests/bpf: relax expected log messages to allow emitting BPF_ST

Update [1] to LLVM BPF backend seeks to enable generation of BPF_ST
instruction when CPUv4 is selected. This affects expected log messages
for the following selftests:
- log_fixup/missing_map
- spin_lock/lock_id_mapval_preserve
- spin_lock/lock_id_innermapval_preserve

Expected messages in these tests hard-code instruction numbers for BPF
programs compiled from C. These instruction numbers change when
BPF_ST is allowed because single BPF_ST instruction replaces a pair of
BPF_MOV/BPF_STX instructions, e.g.:

    r1 = 42;
    *(u32 *)(r10 - 8) = r1;  --->  *(u32 *)(r10 - 8) = 42;

This commit updates expected log messages to avoid matching specific
instruction numbers (program position still could be uniquely
identified).

[1] https://reviews.llvm.org/D140804
    "[BPF] support for BPF_ST instruction in codegen"

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20230808162755.392606-1-eddyz87@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/log_fixup.c
tools/testing/selftests/bpf/prog_tests/spin_lock.c