]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Improve test coverage for kfunc call
authorHari Bathini <hbathini@linux.ibm.com>
Thu, 12 Mar 2026 08:01:13 +0000 (13:31 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 13 Mar 2026 14:13:35 +0000 (07:13 -0700)
commit2af3aa702c05ecd05850db9d9e110be9ffa3cf47
treef54322e43f8fb90b36fb04f8a439341b20b175c8
parentca0f39a369c5f927c3d004e63a5a778b08a9df94
selftests/bpf: Improve test coverage for kfunc call

On powerpc, immediate load instructions are sign extended. In case
of unsigned types, arguments should be explicitly zero-extended by
the caller. For kfunc call, this needs to be handled in the JIT code.
In bpf_kfunc_call_test4(), that tests for sign-extension of signed
argument types in kfunc calls, add some additional failure checks.
And add bpf_kfunc_call_test5() to test zero-extension of unsigned
argument types in kfunc calls.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20260312080113.843408-1-hbathini@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/kfunc_call.c
tools/testing/selftests/bpf/progs/kfunc_call_test.c
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
tools/testing/selftests/bpf/test_kmods/bpf_testmod_kfunc.h