forked from torvalds/linux
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
bpf: btf: Introduce infrastructure for module helpers
This adds support for calling helper functions in eBPF applications that have been declared in a kernel module. The corresponding verifier changes for module helpers will be added in a later patch. Module helpers are useful as: - They support more argument and return types when compared to module kfunc. - This adds a way to have helper functions that would be too specialized for a specific usecase to merge upstream, but are functions that can have a constant API and can be maintained in-kernel modules. - The number of in-kernel helpers have grown to a large number (187 at the time of writing this commit). Having module helper functions could possibly reduce the number of in-kernel helper functions growing in the future and maintained upstream. When the kernel module registers the helper, the module owner, BTF id set of the function and function proto is stored as part of a btf_mod_helper entry in a btf_mod_helper_list which is part of struct btf. This entry can be removed in the unregister function while exiting the module, and can be used by the bpf verifier to check the helper call and get function proto. Signed-off-by: Usama Arif <usama.arif@bytedance.com>
- Loading branch information
1 parent
820e6e2
commit ca60b90025819a8a03818e86e2105bd15576d134
Showing
2 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters