mirror of
https://github.com/torvalds/linux.git
synced 2026-05-04 06:22:40 -04:00
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>
This commit is contained in:
committed by
Alexei Starovoitov
parent
ca0f39a369
commit
2af3aa702c
@@ -110,6 +110,7 @@ __u64 bpf_kfunc_call_test1(struct sock *sk, __u32 a, __u64 b,
|
||||
int bpf_kfunc_call_test2(struct sock *sk, __u32 a, __u32 b) __ksym;
|
||||
struct sock *bpf_kfunc_call_test3(struct sock *sk) __ksym;
|
||||
long bpf_kfunc_call_test4(signed char a, short b, int c, long d) __ksym;
|
||||
int bpf_kfunc_call_test5(__u8 a, __u16 b, __u32 c) __ksym;
|
||||
|
||||
void bpf_kfunc_call_test_pass_ctx(struct __sk_buff *skb) __ksym;
|
||||
void bpf_kfunc_call_test_pass1(struct prog_test_pass1 *p) __ksym;
|
||||
|
||||
Reference in New Issue
Block a user