mbox series

[bpf-next,0/2] bpf: Add detection of kfuncs.

Message ID 20230315223607.50803-1-alexei.starovoitov@gmail.com (mailing list archive)
Headers show
Series bpf: Add detection of kfuncs. | expand

Message

Alexei Starovoitov March 15, 2023, 10:36 p.m. UTC
From: Alexei Starovoitov <ast@kernel.org>

Allow BPF programs detect at load time whether particular kfunc exists.

Alexei Starovoitov (2):
  bpf: Allow ld_imm64 instruction to point to kfunc.
  selftests/bpf: Add test for bpf_kfunc_exists().

 kernel/bpf/verifier.c                              |  7 +++++--
 tools/lib/bpf/bpf_helpers.h                        |  3 +++
 .../selftests/bpf/progs/task_kfunc_success.c       | 14 +++++++++++++-
 3 files changed, 21 insertions(+), 3 deletions(-)

Comments

Martin KaFai Lau March 16, 2023, 12:33 a.m. UTC | #1
On 3/15/23 3:36 PM, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> Allow BPF programs detect at load time whether particular kfunc exists.

Reviewed-by: Martin KaFai Lau <martin.lau@kernel.org>
John Fastabend March 16, 2023, 5:34 a.m. UTC | #2
Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> Allow BPF programs detect at load time whether particular kfunc exists.
> 
> Alexei Starovoitov (2):
>   bpf: Allow ld_imm64 instruction to point to kfunc.
>   selftests/bpf: Add test for bpf_kfunc_exists().
> 
>  kernel/bpf/verifier.c                              |  7 +++++--
>  tools/lib/bpf/bpf_helpers.h                        |  3 +++
>  .../selftests/bpf/progs/task_kfunc_success.c       | 14 +++++++++++++-
>  3 files changed, 21 insertions(+), 3 deletions(-)
> 
> -- 
> 2.34.1
> 

For the series

Acked-by: John Fastabend <john.fastabend@gmail.com>
Toke Høiland-Jørgensen March 16, 2023, 10:31 a.m. UTC | #3
Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:

> From: Alexei Starovoitov <ast@kernel.org>
>
> Allow BPF programs detect at load time whether particular kfunc exists.
>
> Alexei Starovoitov (2):
>   bpf: Allow ld_imm64 instruction to point to kfunc.
>   selftests/bpf: Add test for bpf_kfunc_exists().
>
>  kernel/bpf/verifier.c                              |  7 +++++--
>  tools/lib/bpf/bpf_helpers.h                        |  3 +++
>  .../selftests/bpf/progs/task_kfunc_success.c       | 14 +++++++++++++-
>  3 files changed, 21 insertions(+), 3 deletions(-)

Nice!

For the series:

Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>