Thread (117 messages) 117 messages, 15 authors, 2024-10-19

Re: [PATCH 05/11] vmlinux.lds.h: Preserve DTB sections from being discarded after init

From: Stephen Boyd <sboyd@kernel.org>
Date: 2024-08-30 19:46:37
Also in: linux-arch, linux-clk, linux-gpio, linux-pci, lkml, netdev

Quoting Andrea della Porta (2024-08-20 07:36:07)
quoted hunk ↗ jump to hunk
The special section .dtb.init.rodata contains dtb and dtbo compiled
as objects inside the kernel and ends up in .init.data sectiion that
will be discarded early after the init phase. This is a problem for
builtin drivers that apply dtb overlay at runtime since this happens
later (e.g. during bus enumeration) and also for modules that should
be able to do it dynamically during runtime.
Move the dtb section to .data.

Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
---
 include/asm-generic/vmlinux.lds.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index ad6afc5c4918..3ae9097774b0 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -365,6 +365,7 @@
        TRACE_PRINTKS()                                                 \
        BPF_RAW_TP()                                                    \
        TRACEPOINT_STR()                                                \
+       KERNEL_DTB()                                                    \
The KERNEL_DTB() macro shows the section name is dtb.init.rodata. Can
you remove the ".init." part if this isn't initdata anymore? And
shouldn't it be in the RO_DATA() macro?

It would be nice to keep the initdata properties when this isn't used
after init as well. Perhaps we need another macro and/or filename to
indicate that the DTB{O} can be thrown away after init/module init.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help