[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQKgOR0L0thz6HbkL1x7mwc4eSRHftwsrzE9AxufyGBYZg@mail.gmail.com>
Date: Tue, 9 Aug 2022 10:48:48 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Artem Savkov <asavkov@...hat.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>, bpf <bpf@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Daniel Vacek <dvacek@...hat.com>,
Jiri Olsa <olsajiri@...il.com>, Song Liu <song@...nel.org>,
Daniel Xu <dxu@...uu.xyz>,
Kumar Kartikeya Dwivedi <memxor@...il.com>
Subject: Re: [PATCH bpf-next v4 2/3] bpf: export crash_kexec() as destructive kfunc
On Tue, Aug 9, 2022 at 3:53 AM Artem Savkov <asavkov@...hat.com> wrote:
>
> Allow properly marked bpf programs to call crash_kexec().
>
> Signed-off-by: Artem Savkov <asavkov@...hat.com>
> ---
> kernel/bpf/helpers.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> index 1f961f9982d2..103dbddff41f 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
> @@ -1711,3 +1711,24 @@ bpf_base_func_proto(enum bpf_func_id func_id)
> return NULL;
> }
> }
> +
> +BTF_SET8_START(tracing_btf_ids)
> +#ifdef CONFIG_KEXEC_CORE
> +BTF_ID_FLAGS(func, crash_kexec, KF_DESTRUCTIVE)
> +#endif
> +BTF_SET8_END(tracing_btf_ids)
> +
> +static const struct btf_kfunc_id_set tracing_kfunc_set = {
> + .owner = THIS_MODULE,
> + .set = &tracing_btf_ids,
> +};
> +
> +static int __init kfunc_init(void)
> +{
> + if (register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING, &tracing_kfunc_set))
> + pr_warn("failed to register kfunc id set for BPF_PROG_TYPE_TRACING\n");
Please drop pr_warn. We don't have it in all other
places where we do registration.
Powered by blists - more mailing lists