...as this will allow split BTF modules with a base BTF representation (rather than the full vmlinux BTF at time of BTF encoding) to resolve their references to kernel types in a way that is more resilient to small changes in kernel types. This will allow modules that are not built every time the kernel is to provide more resilient BTF, rather than have it invalidated every time BTF ids for core kernel types change. Fields are ordered to avoid holes in struct module.
Unified · Split
| @@ -509,7 +509,9 @@ struct module { · 508 unmodified lines | ||
| 509 | 509 | #endif |
| 510 | 510 | #ifdef CONFIG_DEBUG_INFO_BTF_MODULES |
| 511 | 511 | unsigned int btf_data_size; |
| 512 | + unsigned int btf_base_data_size; | |
| 512 | 513 | void *btf_data; |
| 514 | + void *btf_base_data; | |
| 513 | 515 | #endif |
| 514 | 516 | #ifdef CONFIG_JUMP_LABEL |
| 515 | 517 | struct jump_entry *jump_entries; |
| @@ -2166,6 +2166,8 @@ static int find_module_sections(struct module *mod, struct load_info *info) · 2165 unmodified lines | ||
| 2166 | 2166 | #endif |
| 2167 | 2167 | #ifdef CONFIG_DEBUG_INFO_BTF_MODULES |
| 2168 | 2168 | mod->btf_data = any_section_objs(info, ".BTF", 1, &mod->btf_data_size); |
| 2169 | + mod->btf_base_data = any_section_objs(info, ".BTF.base", 1, | |
| 2170 | + &mod->btf_base_data_size); | |
| 2169 | 2171 | #endif |
| 2170 | 2172 | #ifdef CONFIG_JUMP_LABEL |
| 2171 | 2173 | mod->jump_entries = section_objs(info, "__jump_table", |
| @@ -2590,8 +2592,9 @@ static noinline int do_init_module(struct module *mod) · 418 unmodified lines | ||
| 2590 | 2592 | } |
| 2591 | 2593 | |
| 2592 | 2594 | #ifdef CONFIG_DEBUG_INFO_BTF_MODULES |
| 2593 | − /* .BTF is not SHF_ALLOC and will get removed, so sanitize pointer */ | |
| 2595 | + /* .BTF is not SHF_ALLOC and will get removed, so sanitize pointers */ | |
| 2594 | 2596 | mod->btf_data = NULL; |
| 2597 | + mod->btf_base_data = NULL; | |
| 2595 | 2598 | #endif |
| 2596 | 2599 | /* |
| 2597 | 2600 | * We want to free module_init, but be aware that kallsyms may be |