lkml.org 
[lkml]   [2022]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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@redhat.com> wrote:
>
> Allow properly marked bpf programs to call crash_kexec().
>
> Signed-off-by: Artem Savkov <asavkov@redhat.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.

\
 
 \ /
  Last update: 2022-08-09 19:49    [W:0.064 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site