selftests/bpf: Add test for static subprog call in lock cs
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Sun, 4 Feb 2024 22:23:49 +0000 (22:23 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 6 Feb 2024 03:58:47 +0000 (19:58 -0800)
commite8699c4ff85baedcf40f33db816cc487cee39397
treeb0dda80da2bdd867ad47d5d108bbea0e1e5f822c
parenta44b1334aadd82203f661adb9adb41e53ad0e8d1
selftests/bpf: Add test for static subprog call in lock cs

Add selftests for static subprog calls within bpf_spin_lock critical
section, and ensure we still reject global subprog calls. Also test the
case where a subprog call will unlock the caller's held lock, or the
caller will unlock a lock taken by a subprog call, ensuring correct
transfer of lock state across frames on exit.

Acked-by: Yonghong Song <yonghong.song@linux.dev>
Acked-by: David Vernet <void@manifault.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20240204222349.938118-3-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/spin_lock.c
tools/testing/selftests/bpf/progs/test_spin_lock.c
tools/testing/selftests/bpf/progs/test_spin_lock_fail.c