linux/scripts
Masahiro Yamada 7fb1d1e038 kbuild: move non-boot built-in DTBs to .rodata section
Commit aab94339cd ("of: Add support for linking device tree blobs
into vmlinux") introduced a mechanism to embed DTBs into vmlinux.

Initially, it was used for wrapping boot DTBs in arch/*/boot/dts/, but
it is now reused for more generic purposes, such as testing.

Built-in DTBs are discarded because KERNEL_DTB() is part of INIT_DATA,
as defined in include/asm-generic/vmlinux.lds.h.

This has not been an issue so far because OF unittests are triggered
during boot, as defined by late_initcall(of_unittest).

However, the recent clk KUnit test additions have caused problems
because KUnit can execute test suites after boot.

For example:

  # echo > /sys/kernel/debug/kunit/clk_register_clk_parent_data_device/run

This command triggers a stack trace because built-in DTBs have already
been freed.

While it is possible to move such test suites from kunit_test_suites to
kunit_test_init_section_suites, it would be preferable to avoid usage
limitations.

This commit moves non-boot built-in DTBs to the .rodata section. Since
these generic DTBs are looked up by name, they do not need to be placed
in the special .dtb.init.rodata section.

Boot DTBs should remain in .dtb.init.rodata because the arch boot code
generally does not know the DT name, thus it uses the __dtb_start symbol
to locate it.

This separation also ensures that the __dtb_start symbol references the
boot DTB. Currently, the .dtb.init.rodata is a mixture of both boot and
non-boot DTBs. The __dtb_start symbol must be followed by the boot DTB,
but we currently rely on the link order (i.e., the order in Makefiles),
which is very fragile.

The implementation is kind of cheesy; the section is .dtb.init.rodata
when $(obj) starts with arch/$(SRCARCH)/boot/dts, and .rodata section
otherwise. This will be refactored later.

Fixes: 5c9dd72d83 ("of: Add a KUnit test for overlays and test managed APIs")
Fixes: 5776526beb ("clk: Add KUnit tests for clk fixed rate basic type")
Fixes: 274aff8711 ("clk: Add KUnit tests for clks registered with struct clk_parent_data")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
2024-09-30 20:42:52 +09:00
..
atomic locking/atomic: scripts: fix ${atomic}_sub_and_test() kerneldoc 2024-06-05 15:52:34 +02:00
basic fixdep: use xmalloc() 2024-09-01 20:34:49 +09:00
clang-tools
coccinelle Reduce Coccinelle choices in string_choices.cocci 2024-09-28 21:33:11 +02:00
dtc dt: dt-extract-compatibles: Extract compatibles from function parameters 2024-09-05 10:17:03 -05:00
dummy-tools
gcc-plugins gcc-plugins: randstruct: Remove GCC 4.7 or newer requirement 2024-08-05 14:34:23 -07:00
gdb scripts/gdb: add 'lx-kasan_mem_to_shadow' command 2024-09-01 20:43:29 -07:00
genksyms kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
include kconfig: use hash table to reuse expressions 2024-09-20 09:21:52 +09:00
ipe scripts: add boot policy generation program 2024-08-20 14:03:39 -04:00
kconfig kconfig: cache expression values 2024-09-20 09:21:53 +09:00
ksymoops
mod Char/Misc and other driver changes for 6.12-rc1 2024-09-26 10:13:08 -07:00
package kbuild: add debug package to pacman PKGBUILD 2024-09-07 17:24:08 +09:00
selinux
tracing
.gitignore
as-version.sh
asn1_compiler.c
bloat-o-meter
bootgraph.pl
bpf_doc.py
build-version kbuild: move init/build-version to scripts/ 2024-07-16 01:08:37 +09:00
cc-can-link.sh
cc-version.sh
check_extable.sh
check-git
check-sysctl-docs
check-uapi.sh
check-variable-fonts.sh docs: scripts/check-variable-fonts.sh: Improve commands for detection 2024-05-02 10:14:52 -06:00
checkdeclares.pl
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl net: drop special comment style 2024-08-23 10:21:02 +01:00
checkstack.pl
checksyscalls.sh
checktransupdate.py scripts: fix all issues reported by pylint 2024-07-29 15:34:22 -06:00
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch sound updates for 6.11-rc1 2024-07-19 12:39:34 -07:00
decode_stacktrace.sh scripts/decode_stacktrace.sh: add '-h' flag 2024-09-01 20:43:41 -07:00
decodecode
depmod.sh
dev-needs.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract_xc3028.pl
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
faddr2line scripts/faddr2line: Check only two symbols when calculating symbol size 2024-07-02 23:38:37 -07:00
file-size.sh
find-unused-docs.sh
gcc-x86_32-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-07-29 03:47:00 +09:00
gcc-x86_64-has-stack-protector.sh kbuild: Fix '-S -c' in x86 stack protector scripts 2024-07-29 03:47:00 +09:00
gen-randstruct-seed.sh
generate_builtin_ranges.awk kbuild: generate offset range data for builtin modules 2024-09-20 09:21:43 +09:00
generate_initcall_order.pl
generate_rust_analyzer.py rust: Support latest version of rust-analyzer 2024-08-07 01:16:52 +02:00
generate_rust_target.rs kbuild: rust: Enable KASAN support 2024-09-16 18:04:37 +02:00
get_abi.pl
get_dvb_firmware
get_feat.pl
get_maintainer.pl get_maintainer: add --bug option to print bug reporting info 2024-08-26 16:10:12 -06:00
gfp-translate scripts: fix gfp-translate after ___GFP_*_BITS conversion to an enum 2024-09-01 17:59:01 -07:00
git.orderFile
head-object-list.txt powerpc: Remove core support for 40x 2024-06-28 22:28:47 +10:00
headerdep.pl
headers_install.sh m68k: Avoid CONFIG_COLDFIRE switch in uapi header 2024-05-07 08:55:23 +10:00
insert-sys-cert.c
install.sh kbuild: Create INSTALL_PATH directory if it does not exist 2024-07-20 13:34:54 +09:00
jobserver-exec
kallsyms.c kallsyms: change overflow variable to bool type 2024-09-20 09:21:52 +09:00
Kbuild.include kbuild: raise the minimum GNU Make requirement to 4.0 2024-07-16 16:07:14 +09:00
Kconfig.include kbuild: rust: Define probing macros for rustc 2024-09-16 18:04:37 +02:00
kernel-doc mm/slab: Plumb kmem_buckets into __do_kmalloc_node() 2024-07-03 12:24:19 +02:00
ld-version.sh kbuild: Make ld-version.sh more robust against version string changes 2024-07-15 03:13:32 +09:00
leaking_addresses.pl
Lindent
link-vmlinux.sh Kbuild updates for v6.12 2024-09-24 13:02:06 -07:00
macro_checker.py scripts: add macro_checker script to check unused parameters in macros 2024-09-01 20:43:28 -07:00
make_fit.py scripts/make_fit: Support decomposing DTBs 2024-07-16 01:08:37 +09:00
Makefile scripts: add boot policy generation program 2024-08-20 14:03:39 -04:00
Makefile.asm-headers kbuild: fix rebuild of generic syscall headers 2024-07-18 10:01:55 -07:00
Makefile.btf kbuild,bpf: Add module-specific pahole flags for distilled base BTF 2024-06-21 14:45:07 -07:00
Makefile.build Rust changes for v6.12 2024-09-25 10:25:40 -07:00
Makefile.clang
Makefile.clean kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
Makefile.compiler kbuild: rust: Define probing macros for rustc 2024-09-16 18:04:37 +02:00
Makefile.debug kbuild: rust: use -Zdebuginfo-compression 2024-04-02 17:41:22 +02:00
Makefile.defconf
Makefile.dtbinst kbuild: Install dtb files as 0644 in Makefile.dtbinst 2024-06-26 00:18:57 +09:00
Makefile.dtbs kbuild: move non-boot built-in DTBs to .rodata section 2024-09-30 20:42:52 +09:00
Makefile.extrawarn kbuild: enable -Wcast-function-type-strict unconditionally 2024-05-19 14:36:16 -07:00
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host kbuild: add intermediate targets for Flex/Bison in scripts/Makefile.host 2024-09-08 12:15:46 +09:00
Makefile.kasan kbuild: rust: Enable KASAN support 2024-09-16 18:04:37 +02:00
Makefile.kcov
Makefile.kcsan
Makefile.kmsan
Makefile.lib Rust changes for v6.12 2024-09-25 10:25:40 -07:00
Makefile.modfinal kbuild: remove append operation on cmd_ld_ko_o 2024-09-20 09:21:53 +09:00
Makefile.modinst Modules changes for v6.12-rc1 2024-09-28 09:06:15 -07:00
Makefile.modpost Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
Makefile.package kbuild: pacman-pkg: do not override objtree 2024-09-01 20:34:49 +09:00
Makefile.randstruct
Makefile.ubsan
Makefile.userprogs
Makefile.vdsoinst more s390 updates for 6.10 merge window 2024-05-21 12:09:36 -07:00
Makefile.vmlinux kbuild: generate offset range data for builtin modules 2024-09-20 09:21:43 +09:00
Makefile.vmlinux_o kbuild: generate offset range data for builtin modules 2024-09-20 09:21:43 +09:00
makelst
markup_oops.pl
min-tool-version.sh rust: upgrade to Rust 1.78.0 2024-05-05 20:17:25 +02:00
misc-check
mkcompile_h
mksysmap kbuild: change scripts/mksysmap into sed script 2024-05-29 16:40:03 +09:00
mkuboot.sh
module-common.c kbuild: compile constant module information only once 2024-09-07 17:24:08 +09:00
module.lds.S The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
modules-check.sh
nsdeps
objdiff
objdump-func
orc_hash.sh
pahole-version.sh
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h
recordmcount.pl
relocs_check.sh
remove-stale-files fortify: refactor test_fortify Makefile to fix some build problems 2024-08-15 09:26:02 -07:00
rust_is_available_bindgen_0_66.h rust: warn about bindgen versions 0.66.0 and 0.66.1 2024-07-10 10:28:52 +02:00
rust_is_available_bindgen_libclang.h
rust_is_available_test.py rust: warn about bindgen versions 0.66.0 and 0.66.1 2024-07-10 10:28:52 +02:00
rust_is_available.sh rust: warn about bindgen versions 0.66.0 and 0.66.1 2024-07-10 10:28:52 +02:00
rustc-version.sh kbuild: rust: add CONFIG_RUSTC_VERSION 2024-09-05 22:44:18 +02:00
rustdoc_test_builder.rs
rustdoc_test_gen.rs
setlocalversion
show_delta
sign-file.c sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 2024-09-20 19:52:48 +03:00
sorttable.c
sorttable.h
spdxcheck-test.sh
spdxcheck.py scripts/spdxcheck: Add count of missing files to stats output 2024-05-04 19:00:54 +02:00
spdxexclude
spelling.txt kernel-wide: fix spelling mistakes like "assocative" -> "associative" 2024-06-28 19:36:28 -07:00
sphinx-pre-install scripts: sphinx-pre-install: remove unnecessary double check for $cur_version 2024-09-05 14:32:36 -06:00
split-man.pl
ssl-common.h sign-file,extract-cert: avoid using deprecated ERR_get_error_line() 2024-09-20 19:49:52 +03:00
stackdelta
stackusage
subarch.include scripts: subarch.include: fix SUBARCH on macOS hosts 2024-09-10 13:56:37 +09:00
syscall.tbl syscalls: add back legacy __NR_nfsservctl macro 2024-08-06 08:57:02 +02:00
syscallhdr.sh
syscallnr.sh
syscalltbl.sh x86/syscall: Mark exit[_group] syscall handlers __noreturn 2024-06-28 15:23:38 +02:00
tags.sh
tools-support-relr.sh
unifdef.c scripts/unifdef: avoid constexpr keyword 2024-04-23 00:09:41 +09:00
ver_linux
verify_builtin_ranges.awk scripts: add verifier script for builtin module range data 2024-09-20 09:21:52 +09:00
xen-hypercalls.sh
xz_wrap.sh xz: adjust arch-specific options for better kernel compression 2024-09-01 20:43:27 -07:00