From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: davem@davemloft.net
Cc: daniel@iogearbox.net, andrii@kernel.org, martin.lau@kernel.org,
void@manifault.com, davemarchevsky@meta.com, tj@kernel.org,
memxor@gmail.com, netdev@vger.kernel.org, bpf@vger.kernel.org,
kernel-team@fb.com
Subject: [PATCH v2 bpf-next 0/4] bpf: Add detection of kfuncs.
Date: Fri, 17 Mar 2023 13:19:16 -0700 [thread overview]
Message-ID: <20230317201920.62030-1-alexei.starovoitov@gmail.com> (raw)
From: Alexei Starovoitov <ast@kernel.org>
Allow BPF programs detect at load time whether particular kfunc exists.
Patch 1: Allow ld_imm64 to point to kfunc in the kernel.
Patch 2: Fix relocation of kfunc in ld_imm64 insn when kfunc is in kernel module.
Patch 3: Introduce bpf_ksym_exists() macro.
Patch 4: selftest.
NOTE: detection of kfuncs from light skeleton is not supported yet.
Alexei Starovoitov (4):
bpf: Allow ld_imm64 instruction to point to kfunc.
libbpf: Fix relocation of kfunc ksym in ld_imm64 insn.
libbpf: Introduce bpf_ksym_exists() macro.
selftests/bpf: Add test for bpf_ksym_exists().
kernel/bpf/verifier.c | 17 ++++++++++------
tools/lib/bpf/bpf_helpers.h | 3 +++
tools/lib/bpf/libbpf.c | 6 ++++++
.../selftests/bpf/progs/task_kfunc_success.c | 20 ++++++++++++++++++-
4 files changed, 39 insertions(+), 7 deletions(-)
--
2.34.1
next reply other threads:[~2023-03-17 20:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-17 20:19 Alexei Starovoitov [this message]
2023-03-17 20:19 ` [PATCH v2 bpf-next 1/4] bpf: Allow ld_imm64 instruction to point to kfunc Alexei Starovoitov
2023-03-17 20:19 ` [PATCH v2 bpf-next 2/4] libbpf: Fix relocation of kfunc ksym in ld_imm64 insn Alexei Starovoitov
2023-03-17 22:49 ` Andrii Nakryiko
2023-03-17 20:19 ` [PATCH v2 bpf-next 3/4] libbpf: Introduce bpf_ksym_exists() macro Alexei Starovoitov
2023-03-17 22:53 ` Andrii Nakryiko
2023-03-17 20:19 ` [PATCH v2 bpf-next 4/4] selftests/bpf: Add test for bpf_ksym_exists() Alexei Starovoitov
2023-03-17 23:00 ` [PATCH v2 bpf-next 0/4] bpf: Add detection of kfuncs patchwork-bot+netdevbpf
2023-07-25 20:44 ` Matt Bobrowski
2023-07-25 21:00 ` Alexei Starovoitov
2023-07-26 12:08 ` Matt Bobrowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230317201920.62030-1-alexei.starovoitov@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=davemarchevsky@meta.com \
--cc=kernel-team@fb.com \
--cc=martin.lau@kernel.org \
--cc=memxor@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).