> A module with a .BTF.base section (built out of tree) that is loaded
> before the vmlinux BTF only gets its /sys/kernel/btf file once the
> vmlinux BTF has been loaded and its BTF relocated, because the raw .BTF
> is only valid against the distilled base and relocation rewrites it in
> place.  Until then the module is missing from /sys/kernel/btf, unlike
> with =y, and reading its file cannot trigger the load.
> 
> Create the file at module load instead, with its final size: relocation
> only rewrites type ids and string offsets, never the length.  Its reader,
> btf_module_sysfs_read_deferred(), has the vmlinux BTF loaded, which parses
> and relocates the kept modules, then waits until this module's BTF is
> published (btf_mod->ready) before serving it, so no unrelocated or
> half-relocated data is ever visible.  If the module goes away or its BTF
> turns out unusable first (btf_mod->gone), or the vmlinux BTF cannot be
> loaded, the read fails with -ENODEV.
> [ ... ]
> 
> Modules without .BTF.base are unchanged: their data is final and is
> served as is.
> 
> Signed-off-by: Jay Wang <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=8


Reply via email to