* [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops
@ 2024-02-08 6:24 Geliang Tang
2024-02-08 6:24 ` [PATCH bpf-next v5 1/3] bpf, btf: Fix return value of register_btf_id_dtor_kfuncs Geliang Tang
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Geliang Tang @ 2024-02-08 6:24 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, Matthieu Baerts,
Eduard Zingerman, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa
Cc: Geliang Tang, bpf, mptcp, kernel test robot
From: Geliang Tang <tanggeliang@kylinos.cn>
v5:
- drop CONFIG_MODULE_ALLOW_BTF_MISMATCH check as Martin suggested.
v4:
- add a new patch to fix error checks for btf_get_module_btf.
- rename the helper to check_btf_kconfigs.
v3:
- fix this build error:
kernel/bpf/btf.c:7750:11: error: incomplete definition of type 'struct module'
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202402040934.Fph0XeEo-lkp@intel.com/
v2:
- add register_check_missing_btf helper as Jiri suggested.
Geliang Tang (3):
bpf, btf: Fix return value of register_btf_id_dtor_kfuncs
bpf, btf: Add check_btf_kconfigs helper
bpf, btf: Check btf for register_bpf_struct_ops
kernel/bpf/btf.c | 39 ++++++++++++++++++---------------------
1 file changed, 18 insertions(+), 21 deletions(-)
--
2.40.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH bpf-next v5 1/3] bpf, btf: Fix return value of register_btf_id_dtor_kfuncs
2024-02-08 6:24 [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops Geliang Tang
@ 2024-02-08 6:24 ` Geliang Tang
2024-02-08 6:24 ` [PATCH bpf-next v5 2/3] bpf, btf: Add check_btf_kconfigs helper Geliang Tang
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Geliang Tang @ 2024-02-08 6:24 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, Matthieu Baerts,
Eduard Zingerman, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa
Cc: Geliang Tang, bpf, mptcp
From: Geliang Tang <tanggeliang@kylinos.cn>
The same as __register_btf_kfunc_id_set(), to let the modules with
stripped btf section loaded, this patch changes the return value of
register_btf_id_dtor_kfuncs() too from -ENOENT to 0 when btf is NULL.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
kernel/bpf/btf.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index f7725cb6e564..16eb937eca46 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -8219,10 +8219,8 @@ int register_btf_id_dtor_kfuncs(const struct btf_id_dtor_kfunc *dtors, u32 add_c
pr_err("missing vmlinux BTF, cannot register dtor kfuncs\n");
return -ENOENT;
}
- if (owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES)) {
- pr_err("missing module BTF, cannot register dtor kfuncs\n");
- return -ENOENT;
- }
+ if (owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
+ pr_warn("missing module BTF, cannot register dtor kfuncs\n");
return 0;
}
if (IS_ERR(btf))
--
2.40.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH bpf-next v5 2/3] bpf, btf: Add check_btf_kconfigs helper
2024-02-08 6:24 [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops Geliang Tang
2024-02-08 6:24 ` [PATCH bpf-next v5 1/3] bpf, btf: Fix return value of register_btf_id_dtor_kfuncs Geliang Tang
@ 2024-02-08 6:24 ` Geliang Tang
2024-02-08 10:07 ` Jiri Olsa
2024-02-08 6:24 ` [PATCH bpf-next v5 3/3] bpf, btf: Check btf for register_bpf_struct_ops Geliang Tang
2024-02-08 19:50 ` [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops patchwork-bot+netdevbpf
3 siblings, 1 reply; 11+ messages in thread
From: Geliang Tang @ 2024-02-08 6:24 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, Matthieu Baerts,
Eduard Zingerman, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa
Cc: Geliang Tang, bpf, mptcp
From: Geliang Tang <tanggeliang@kylinos.cn>
This patch extracts duplicate code on error path when btf_get_module_btf()
returns NULL from the functions __register_btf_kfunc_id_set() and
register_btf_id_dtor_kfuncs() into a new helper named check_btf_kconfigs()
to check CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES in it.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
kernel/bpf/btf.c | 33 +++++++++++++++------------------
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 16eb937eca46..e318df7f0071 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -7738,6 +7738,17 @@ static struct btf *btf_get_module_btf(const struct module *module)
return btf;
}
+static int check_btf_kconfigs(const struct module *module)
+{
+ if (!module && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) {
+ pr_err("missing vmlinux BTF, cannot register kfuncs\n");
+ return -ENOENT;
+ }
+ if (module && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
+ pr_warn("missing module BTF, cannot register kfuncs\n");
+ return 0;
+}
+
BPF_CALL_4(bpf_btf_find_by_name_kind, char *, name, int, name_sz, u32, kind, int, flags)
{
struct btf *btf = NULL;
@@ -8098,15 +8109,8 @@ static int __register_btf_kfunc_id_set(enum btf_kfunc_hook hook,
int ret, i;
btf = btf_get_module_btf(kset->owner);
- if (!btf) {
- if (!kset->owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) {
- pr_err("missing vmlinux BTF, cannot register kfuncs\n");
- return -ENOENT;
- }
- if (kset->owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
- pr_warn("missing module BTF, cannot register kfuncs\n");
- return 0;
- }
+ if (!btf)
+ return check_btf_kconfigs(kset->owner);
if (IS_ERR(btf))
return PTR_ERR(btf);
@@ -8214,15 +8218,8 @@ int register_btf_id_dtor_kfuncs(const struct btf_id_dtor_kfunc *dtors, u32 add_c
int ret;
btf = btf_get_module_btf(owner);
- if (!btf) {
- if (!owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) {
- pr_err("missing vmlinux BTF, cannot register dtor kfuncs\n");
- return -ENOENT;
- }
- if (owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
- pr_warn("missing module BTF, cannot register dtor kfuncs\n");
- return 0;
- }
+ if (!btf)
+ return check_btf_kconfigs(owner);
if (IS_ERR(btf))
return PTR_ERR(btf);
--
2.40.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH bpf-next v5 3/3] bpf, btf: Check btf for register_bpf_struct_ops
2024-02-08 6:24 [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops Geliang Tang
2024-02-08 6:24 ` [PATCH bpf-next v5 1/3] bpf, btf: Fix return value of register_btf_id_dtor_kfuncs Geliang Tang
2024-02-08 6:24 ` [PATCH bpf-next v5 2/3] bpf, btf: Add check_btf_kconfigs helper Geliang Tang
@ 2024-02-08 6:24 ` Geliang Tang
2024-02-08 7:16 ` bpf, btf: Check btf for register_bpf_struct_ops: Tests Results MPTCP CI
` (3 more replies)
2024-02-08 19:50 ` [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops patchwork-bot+netdevbpf
3 siblings, 4 replies; 11+ messages in thread
From: Geliang Tang @ 2024-02-08 6:24 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, Matthieu Baerts,
Eduard Zingerman, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa
Cc: Geliang Tang, bpf, mptcp
From: Geliang Tang <tanggeliang@kylinos.cn>
Similar to the handling in the functions __register_btf_kfunc_id_set()
and register_btf_id_dtor_kfuncs(), this patch uses the newly added
helper check_btf_kconfigs() and IS_ERR() to check the return value of
btf_get_module_btf().
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
kernel/bpf/btf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index e318df7f0071..c18b0f47f1f9 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -8882,7 +8882,9 @@ int __register_bpf_struct_ops(struct bpf_struct_ops *st_ops)
btf = btf_get_module_btf(st_ops->owner);
if (!btf)
- return -EINVAL;
+ return check_btf_kconfigs(st_ops->owner);
+ if (IS_ERR(btf))
+ return PTR_ERR(btf);
log = kzalloc(sizeof(*log), GFP_KERNEL | __GFP_NOWARN);
if (!log) {
--
2.40.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: bpf, btf: Check btf for register_bpf_struct_ops: Tests Results
2024-02-08 6:24 ` [PATCH bpf-next v5 3/3] bpf, btf: Check btf for register_bpf_struct_ops Geliang Tang
@ 2024-02-08 7:16 ` MPTCP CI
2024-02-08 7:32 ` MPTCP CI
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: MPTCP CI @ 2024-02-08 7:16 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp
Hi Geliang,
Thank you for your modifications, that's great!
Our CI (GitHub Action) did some validations and here is its report:
- KVM Validation: normal:
- Unstable: 2 failed test(s): packetdrill_regressions selftest_mptcp_join 🔴:
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/7825836847
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/0a74337f9112
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normal
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bpf, btf: Check btf for register_bpf_struct_ops: Tests Results
2024-02-08 6:24 ` [PATCH bpf-next v5 3/3] bpf, btf: Check btf for register_bpf_struct_ops Geliang Tang
2024-02-08 7:16 ` bpf, btf: Check btf for register_bpf_struct_ops: Tests Results MPTCP CI
@ 2024-02-08 7:32 ` MPTCP CI
2024-02-08 10:57 ` MPTCP CI
2024-02-08 11:14 ` MPTCP CI
3 siblings, 0 replies; 11+ messages in thread
From: MPTCP CI @ 2024-02-08 7:32 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp
Hi Geliang,
Thank you for your modifications, that's great!
Our CI (Cirrus) did some validations with a debug kernel and here is its report:
- KVM Validation: debug (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/4767446159065088
- Summary: https://api.cirrus-ci.com/v1/artifact/task/4767446159065088/summary/summary.txt
- KVM Validation: debug (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5893346065907712
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5893346065907712/summary/summary.txt
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/0a74337f9112
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-debug
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH bpf-next v5 2/3] bpf, btf: Add check_btf_kconfigs helper
2024-02-08 6:24 ` [PATCH bpf-next v5 2/3] bpf, btf: Add check_btf_kconfigs helper Geliang Tang
@ 2024-02-08 10:07 ` Jiri Olsa
2024-02-08 19:53 ` Martin KaFai Lau
0 siblings, 1 reply; 11+ messages in thread
From: Jiri Olsa @ 2024-02-08 10:07 UTC (permalink / raw)
To: Geliang Tang
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, Matthieu Baerts,
Eduard Zingerman, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Geliang Tang, bpf, mptcp
On Thu, Feb 08, 2024 at 02:24:22PM +0800, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> This patch extracts duplicate code on error path when btf_get_module_btf()
> returns NULL from the functions __register_btf_kfunc_id_set() and
> register_btf_id_dtor_kfuncs() into a new helper named check_btf_kconfigs()
> to check CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES in it.
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> kernel/bpf/btf.c | 33 +++++++++++++++------------------
> 1 file changed, 15 insertions(+), 18 deletions(-)
>
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 16eb937eca46..e318df7f0071 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -7738,6 +7738,17 @@ static struct btf *btf_get_module_btf(const struct module *module)
> return btf;
> }
>
> +static int check_btf_kconfigs(const struct module *module)
> +{
> + if (!module && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) {
> + pr_err("missing vmlinux BTF, cannot register kfuncs\n");
> + return -ENOENT;
> + }
> + if (module && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
> + pr_warn("missing module BTF, cannot register kfuncs\n");
> + return 0;
> +}
> +
> BPF_CALL_4(bpf_btf_find_by_name_kind, char *, name, int, name_sz, u32, kind, int, flags)
> {
> struct btf *btf = NULL;
> @@ -8098,15 +8109,8 @@ static int __register_btf_kfunc_id_set(enum btf_kfunc_hook hook,
> int ret, i;
>
> btf = btf_get_module_btf(kset->owner);
> - if (!btf) {
> - if (!kset->owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) {
> - pr_err("missing vmlinux BTF, cannot register kfuncs\n");
> - return -ENOENT;
> - }
> - if (kset->owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
> - pr_warn("missing module BTF, cannot register kfuncs\n");
> - return 0;
> - }
> + if (!btf)
> + return check_btf_kconfigs(kset->owner);
> if (IS_ERR(btf))
> return PTR_ERR(btf);
>
> @@ -8214,15 +8218,8 @@ int register_btf_id_dtor_kfuncs(const struct btf_id_dtor_kfunc *dtors, u32 add_c
> int ret;
>
> btf = btf_get_module_btf(owner);
> - if (!btf) {
> - if (!owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) {
> - pr_err("missing vmlinux BTF, cannot register dtor kfuncs\n");
> - return -ENOENT;
> - }
> - if (owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
> - pr_warn("missing module BTF, cannot register dtor kfuncs\n");
nit, we do lose the 'dtor' from the message but I think it's ok,
for the patchset:
Acked-by: Jiri Olsa <jolsa@kernel.org>
jirka
> - return 0;
> - }
> + if (!btf)
> + return check_btf_kconfigs(owner);
> if (IS_ERR(btf))
> return PTR_ERR(btf);
>
> --
> 2.40.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bpf, btf: Check btf for register_bpf_struct_ops: Tests Results
2024-02-08 6:24 ` [PATCH bpf-next v5 3/3] bpf, btf: Check btf for register_bpf_struct_ops Geliang Tang
2024-02-08 7:16 ` bpf, btf: Check btf for register_bpf_struct_ops: Tests Results MPTCP CI
2024-02-08 7:32 ` MPTCP CI
@ 2024-02-08 10:57 ` MPTCP CI
2024-02-08 11:14 ` MPTCP CI
3 siblings, 0 replies; 11+ messages in thread
From: MPTCP CI @ 2024-02-08 10:57 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp
Hi Geliang,
Thank you for your modifications, that's great!
Our CI (GitHub Action) did some validations and here is its report:
- KVM Validation: normal:
- Success! ✅:
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/7828113236
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/95e0e3a258c6
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normal
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: bpf, btf: Check btf for register_bpf_struct_ops: Tests Results
2024-02-08 6:24 ` [PATCH bpf-next v5 3/3] bpf, btf: Check btf for register_bpf_struct_ops Geliang Tang
` (2 preceding siblings ...)
2024-02-08 10:57 ` MPTCP CI
@ 2024-02-08 11:14 ` MPTCP CI
3 siblings, 0 replies; 11+ messages in thread
From: MPTCP CI @ 2024-02-08 11:14 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp
Hi Geliang,
Thank you for your modifications, that's great!
Our CI (Cirrus) did some validations with a debug kernel and here is its report:
- KVM Validation: debug (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/6339634976784384
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6339634976784384/summary/summary.txt
- KVM Validation: debug (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/4932260093231104
- Summary: https://api.cirrus-ci.com/v1/artifact/task/4932260093231104/summary/summary.txt
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/95e0e3a258c6
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-debug
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops
2024-02-08 6:24 [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops Geliang Tang
` (2 preceding siblings ...)
2024-02-08 6:24 ` [PATCH bpf-next v5 3/3] bpf, btf: Check btf for register_bpf_struct_ops Geliang Tang
@ 2024-02-08 19:50 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 11+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-08 19:50 UTC (permalink / raw)
To: Geliang Tang
Cc: ast, daniel, andrii, martin.lau, song, yonghong.song, matttbe,
eddyz87, john.fastabend, kpsingh, sdf, haoluo, jolsa, tanggeliang,
bpf, mptcp, lkp
Hello:
This series was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:
On Thu, 8 Feb 2024 14:24:20 +0800 you wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> v5:
> - drop CONFIG_MODULE_ALLOW_BTF_MISMATCH check as Martin suggested.
>
> v4:
> - add a new patch to fix error checks for btf_get_module_btf.
> - rename the helper to check_btf_kconfigs.
>
> [...]
Here is the summary with links:
- [bpf-next,v5,1/3] bpf, btf: Fix return value of register_btf_id_dtor_kfuncs
https://git.kernel.org/bpf/bpf-next/c/b9a395f0f7af
- [bpf-next,v5,2/3] bpf, btf: Add check_btf_kconfigs helper
https://git.kernel.org/bpf/bpf-next/c/9e60b0e02550
- [bpf-next,v5,3/3] bpf, btf: Check btf for register_bpf_struct_ops
https://git.kernel.org/bpf/bpf-next/c/947e56f82fd7
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH bpf-next v5 2/3] bpf, btf: Add check_btf_kconfigs helper
2024-02-08 10:07 ` Jiri Olsa
@ 2024-02-08 19:53 ` Martin KaFai Lau
0 siblings, 0 replies; 11+ messages in thread
From: Martin KaFai Lau @ 2024-02-08 19:53 UTC (permalink / raw)
To: Geliang Tang
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Song Liu,
Yonghong Song, Matthieu Baerts, Eduard Zingerman, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Geliang Tang, bpf, mptcp,
Jiri Olsa
On 2/8/24 2:07 AM, Jiri Olsa wrote:
>> +static int check_btf_kconfigs(const struct module *module)
>> +{
>> + if (!module && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) {
>> + pr_err("missing vmlinux BTF, cannot register kfuncs\n");
>> + return -ENOENT;
>> + }
>> + if (module && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
>> + pr_warn("missing module BTF, cannot register kfuncs\n");
>> + return 0;
>> +}
>> +
>> BPF_CALL_4(bpf_btf_find_by_name_kind, char *, name, int, name_sz, u32, kind, int, flags)
>> {
>> struct btf *btf = NULL;
>> @@ -8098,15 +8109,8 @@ static int __register_btf_kfunc_id_set(enum btf_kfunc_hook hook,
>> int ret, i;
>>
>> btf = btf_get_module_btf(kset->owner);
>> - if (!btf) {
>> - if (!kset->owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) {
>> - pr_err("missing vmlinux BTF, cannot register kfuncs\n");
>> - return -ENOENT;
>> - }
>> - if (kset->owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
>> - pr_warn("missing module BTF, cannot register kfuncs\n");
>> - return 0;
>> - }
>> + if (!btf)
>> + return check_btf_kconfigs(kset->owner);
>> if (IS_ERR(btf))
>> return PTR_ERR(btf);
>>
>> @@ -8214,15 +8218,8 @@ int register_btf_id_dtor_kfuncs(const struct btf_id_dtor_kfunc *dtors, u32 add_c
>> int ret;
>>
>> btf = btf_get_module_btf(owner);
>> - if (!btf) {
>> - if (!owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) {
>> - pr_err("missing vmlinux BTF, cannot register dtor kfuncs\n");
>> - return -ENOENT;
>> - }
>> - if (owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF_MODULES))
>> - pr_warn("missing module BTF, cannot register dtor kfuncs\n");
> nit, we do lose the 'dtor' from the message but I think it's ok,
> for the patchset:
I added "const char *feature" argument to check_btf_kconfigs(), so it is like
check_btf_kconfigs(, "kfunc"), check_btf_kconfigs(, "dtor kfunc"), and
check_btf_kconfigs(, "struct_ops"). Applied. Thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-02-08 19:53 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-08 6:24 [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops Geliang Tang
2024-02-08 6:24 ` [PATCH bpf-next v5 1/3] bpf, btf: Fix return value of register_btf_id_dtor_kfuncs Geliang Tang
2024-02-08 6:24 ` [PATCH bpf-next v5 2/3] bpf, btf: Add check_btf_kconfigs helper Geliang Tang
2024-02-08 10:07 ` Jiri Olsa
2024-02-08 19:53 ` Martin KaFai Lau
2024-02-08 6:24 ` [PATCH bpf-next v5 3/3] bpf, btf: Check btf for register_bpf_struct_ops Geliang Tang
2024-02-08 7:16 ` bpf, btf: Check btf for register_bpf_struct_ops: Tests Results MPTCP CI
2024-02-08 7:32 ` MPTCP CI
2024-02-08 10:57 ` MPTCP CI
2024-02-08 11:14 ` MPTCP CI
2024-02-08 19:50 ` [PATCH bpf-next v5 0/3] bpf, btf: Add DEBUG_INFO_BTF checks for __register_bpf_struct_ops patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.