提交 13379059 编写于 作者: A Artem Savkov 提交者: Alexei Starovoitov

bpf: export crash_kexec() as destructive kfunc

Allow properly marked bpf programs to call crash_kexec().
Signed-off-by: NArtem Savkov <asavkov@redhat.com>
Link: https://lore.kernel.org/r/20220810065905.475418-3-asavkov@redhat.comSigned-off-by: NAlexei Starovoitov <ast@kernel.org>
上级 4dd48c6f
......@@ -1725,3 +1725,21 @@ 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)
{
return register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING, &tracing_kfunc_set);
}
late_initcall(kfunc_init);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册