|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1 |
|
| #
6f110a5e |
| 06-Apr-2025 |
Linus Torvalds <[email protected]> |
Disable SLUB_TINY for build testing
... and don't error out so hard on missing module descriptions.
Before commit 6c6c1fc09de3 ("modpost: require a MODULE_DESCRIPTION()") we used to warn about miss
Disable SLUB_TINY for build testing
... and don't error out so hard on missing module descriptions.
Before commit 6c6c1fc09de3 ("modpost: require a MODULE_DESCRIPTION()") we used to warn about missing module descriptions, but only when building with extra warnigns (ie 'W=1').
After that commit the warning became an unconditional hard error.
And it turns out not all modules have been converted despite the claims to the contrary. As reported by Damian Tometzki, the slub KUnit test didn't have a module description, and apparently nobody ever really noticed.
The reason nobody noticed seems to be that the slub KUnit tests get disabled by SLUB_TINY, which also ends up disabling a lot of other code, both in tests and in slub itself. And so anybody doing full build tests didn't actually see this failre.
So let's disable SLUB_TINY for build-only tests, since it clearly ends up limiting build coverage. Also turn the missing module descriptions error back into a warning, but let's keep it around for non-'W=1' builds.
Reported-by: Damian Tometzki <[email protected]> Link: https://lore.kernel.org/all/01070196099fd059-e8463438-7b1b-4ec8-816d-173874be9966-000000@eu-central-1.amazonses.com/ Cc: Masahiro Yamada <[email protected]> Cc: Jeff Johnson <[email protected]> Fixes: 6c6c1fc09de3 ("modpost: require a MODULE_DESCRIPTION()") Signed-off-by: Linus Torvalds <[email protected]>
show more ...
|
|
Revision tags: v6.14, v6.14-rc7 |
|
| #
6c6c1fc0 |
| 11-Mar-2025 |
Jeff Johnson <[email protected]> |
modpost: require a MODULE_DESCRIPTION()
Since commit 1fffe7a34c89 ("script: modpost: emit a warning when the description is missing"), a module without a MODULE_DESCRIPTION() has resulted in a warni
modpost: require a MODULE_DESCRIPTION()
Since commit 1fffe7a34c89 ("script: modpost: emit a warning when the description is missing"), a module without a MODULE_DESCRIPTION() has resulted in a warning with make W=1. Since that time, all known instances of this issue have been fixed. Therefore, now make it an error if a MODULE_DESCRIPTION() is not present.
Signed-off-by: Jeff Johnson <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2 |
|
| #
59d60d26 |
| 07-Feb-2025 |
Masahiro Yamada <[email protected]> |
modpost: introduce get_basename() helper
The logic to retrieve the basename appears multiple times. Factor out the common pattern into a helper function.
I copied kbasename() from include/linux/str
modpost: introduce get_basename() helper
The logic to retrieve the basename appears multiple times. Factor out the common pattern into a helper function.
I copied kbasename() from include/linux/string.h and renamed it to get_basename().
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
show more ...
|
| #
b28fb1f2 |
| 13-Feb-2025 |
Uwe Kleine-König <[email protected]> |
modpost: Fix a few typos in a comment
Namely: s/becasue/because/ and s/wiht/with/ plus an added article.
Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Masahiro Yamad
modpost: Fix a few typos in a comment
Namely: s/becasue/because/ and s/wiht/with/ plus an added article.
Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc1 |
|
| #
4c56eb33 |
| 01-Feb-2025 |
Masahiro Yamada <[email protected]> |
kbuild: keep symbols for symbol_get() even with CONFIG_TRIM_UNUSED_KSYMS
Linus observed that the symbol_request(utf8_data_table) call fails when CONFIG_UNICODE=y and CONFIG_TRIM_UNUSED_KSYMS=y.
sym
kbuild: keep symbols for symbol_get() even with CONFIG_TRIM_UNUSED_KSYMS
Linus observed that the symbol_request(utf8_data_table) call fails when CONFIG_UNICODE=y and CONFIG_TRIM_UNUSED_KSYMS=y.
symbol_get() relies on the symbol data being present in the ksymtab for symbol lookups. However, EXPORT_SYMBOL_GPL(utf8_data_table) is dropped due to CONFIG_TRIM_UNUSED_KSYMS, as no module references it in this case.
Probably, this has been broken since commit dbacb0ef670d ("kconfig option for TRIM_UNUSED_KSYMS").
This commit addresses the issue by leveraging modpost. Symbol names passed to symbol_get() are recorded in the special .no_trim_symbol section, which is then parsed by modpost to forcibly keep such symbols. The .no_trim_symbol section is discarded by the linker scripts, so there is no impact on the size of the final vmlinux or modules.
This commit cannot resolve the issue for direct calls to __symbol_get() because the symbol name is not known at compile-time.
Although symbol_get() may eventually be deprecated, this workaround should be good enough meanwhile.
Reported-by: Linus Torvalds <[email protected]> Suggested-by: Linus Torvalds <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.13, v6.13-rc7, v6.13-rc6 |
|
| #
e8639b7e |
| 03-Jan-2025 |
Matthew Maurer <[email protected]> |
modpost: Allow extended modversions without basic MODVERSIONS
If you know that your kernel modules will only ever be loaded by a newer kernel, you can disable BASIC_MODVERSIONS to save space. This a
modpost: Allow extended modversions without basic MODVERSIONS
If you know that your kernel modules will only ever be loaded by a newer kernel, you can disable BASIC_MODVERSIONS to save space. This also allows easy creation of test modules to see how tooling will respond to modules that only have the new format.
Signed-off-by: Matthew Maurer <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
fc7d5e32 |
| 03-Jan-2025 |
Matthew Maurer <[email protected]> |
modpost: Produce extended MODVERSIONS information
Generate both the existing modversions format and the new extended one when running modpost. Presence of this metadata in the final .ko is guarded b
modpost: Produce extended MODVERSIONS information
Generate both the existing modversions format and the new extended one when running modpost. Presence of this metadata in the final .ko is guarded by CONFIG_EXTENDED_MODVERSIONS.
We no longer generate an error on long symbols in modpost if CONFIG_EXTENDED_MODVERSIONS is set, as they can now be appropriately encoded in the extended section. These symbols will be skipped in the previous encoding. An error will still be generated if CONFIG_EXTENDED_MODVERSIONS is not set.
Reviewed-by: Sami Tolvanen <[email protected]> Signed-off-by: Matthew Maurer <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc5 |
|
| #
5963913b |
| 28-Dec-2024 |
Masahiro Yamada <[email protected]> |
modpost: zero-pad CRC values in modversion_info array
I do not think the '#' flag is useful here because adding the explicit '0x' is clearer. Add the '0' flag to zero-pad the CRC values.
This chang
modpost: zero-pad CRC values in modversion_info array
I do not think the '#' flag is useful here because adding the explicit '0x' is clearer. Add the '0' flag to zero-pad the CRC values.
This change gives better alignment in the generated *.mod.c files. There is no impact to the compiled modules.
[Before]
$ grep -A5 modversion_info fs/efivarfs/efivarfs.mod.c static const struct modversion_info ____versions[] __used __section("__versions") = { { 0x907d14d, "blocking_notifier_chain_register" }, { 0x53d3b64, "simple_inode_init_ts" }, { 0x65487097, "__x86_indirect_thunk_rax" }, { 0x122c3a7e, "_printk" },
[After]
$ grep -A5 modversion_info fs/efivarfs/efivarfs.mod.c static const struct modversion_info ____versions[] __used __section("__versions") = { { 0x0907d14d, "blocking_notifier_chain_register" }, { 0x053d3b64, "simple_inode_init_ts" }, { 0x65487097, "__x86_indirect_thunk_rax" }, { 0x122c3a7e, "_printk" },
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
8fe1a63d |
| 25-Dec-2024 |
Masahiro Yamada <[email protected]> |
modpost: work around unaligned data access error
With the latest binutils, modpost fails with a bus error on some architectures such as ARM and sparc64.
Since binutils commit 1f1b5e506bf0 ("bfd/ELF
modpost: work around unaligned data access error
With the latest binutils, modpost fails with a bus error on some architectures such as ARM and sparc64.
Since binutils commit 1f1b5e506bf0 ("bfd/ELF: restrict file alignment for object files"), the byte offset to each section (sh_offset) in relocatable ELF is no longer guaranteed to be aligned.
modpost parses MODULE_DEVICE_TABLE() data structures, which are usually located in the .rodata section. If it is not properly aligned, unaligned access errors may occur.
To address the issue, this commit imports the get_unaligned() helper from include/linux/unaligned.h.
The get_unaligned_native() helper caters to the endianness in addition to handling the unaligned access.
I slightly refactored do_pcmcia_entry() and do_input() to avoid writing back to an unaligned address. (We would need the put_unaligned() helper to do that.)
The addend_*_rel() functions need similar adjustments because the .text sections are not aligned either.
It seems that the .symtab, .rel.* and .rela.* sections are still aligned. Keep normal pointer access for these sections to avoid unnecessary performance costs.
Reported-by: Paulo Pisati <[email protected]> Reported-by: Matthias Klose <[email protected]> Closes: https://sourceware.org/bugzilla/show_bug.cgi?id=32435 Reported-by: John Paul Adrian Glaubitz <[email protected]> Closes: https://sourceware.org/bugzilla/show_bug.cgi?id=32493 Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: John Paul Adrian Glaubitz <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc4, v6.13-rc3 |
|
| #
9435dc77 |
| 12-Dec-2024 |
Masahiro Yamada <[email protected]> |
modpost: distinguish same module paths from different dump files
Since commit 13b25489b6f8 ("kbuild: change working directory to external module directory with M="), module paths are always relative
modpost: distinguish same module paths from different dump files
Since commit 13b25489b6f8 ("kbuild: change working directory to external module directory with M="), module paths are always relative to the top of the external module tree.
The module paths recorded in Module.symvers are no longer globally unique when they are passed via KBUILD_EXTRA_SYMBOLS for building other external modules, which may result in false-positive "exported twice" errors. Such errors should not occur because external modules should be able to override in-tree modules.
To address this, record the dump file path in struct module and check it when searching for a module.
Fixes: 13b25489b6f8 ("kbuild: change working directory to external module directory with M=") Reported-by: Jon Hunter <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Masahiro Yamada <[email protected]> Tested-by: Jon Hunter <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc2, v6.13-rc1 |
|
| #
79124056 |
| 01-Dec-2024 |
Thomas Gleixner <[email protected]> |
modpost: Add .irqentry.text to OTHER_SECTIONS
The compiler can fully inline the actual handler function of an interrupt entry into the .irqentry.text entry point. If such a function contains an acce
modpost: Add .irqentry.text to OTHER_SECTIONS
The compiler can fully inline the actual handler function of an interrupt entry into the .irqentry.text entry point. If such a function contains an access which has an exception table entry, modpost complains about a section mismatch:
WARNING: vmlinux.o(__ex_table+0x447c): Section mismatch in reference ...
The relocation at __ex_table+0x447c references section ".irqentry.text" which is not in the list of authorized sections.
Add .irqentry.text to OTHER_SECTIONS to cure the issue.
Reported-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] # needed for linux-5.4-y Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
5eaea851 |
| 23-Nov-2024 |
Masahiro Yamada <[email protected]> |
modpost: replace tdb_hash() with hash_str()
Use a helper available in scripts/include/hash.h.
Signed-off-by: Masahiro Yamada <[email protected]>
|
| #
9d98038d |
| 19-Nov-2024 |
Masahiro Yamada <[email protected]> |
modpost: move strstarts() to modpost.h
This macro is useful in file2alias.c as well.
Signed-off-by: Masahiro Yamada <[email protected]>
|
| #
f4fdb17c |
| 19-Nov-2024 |
Masahiro Yamada <[email protected]> |
modpost: introduce module_alias_printf() helper
The generic ->do_entry() handler is currently limited to returning a single alias string.
However, this is not flexible enough for several subsystems
modpost: introduce module_alias_printf() helper
The generic ->do_entry() handler is currently limited to returning a single alias string.
However, this is not flexible enough for several subsystems, which currently require their own implementations:
- do_usb_table() - do_of_table() - do_pnp_device_entry() - do_pnp_card_entries()
This commit introduces a helper function so that these special cases can add multiple MODULE_ALIAS() and then migrate to the generic framework.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7 |
|
| #
fdf94e44 |
| 01-Sep-2024 |
Thomas Weißschuh <[email protected]> |
kbuild: compile constant module information only once
Various information about modules is compiled into the info sections. For that a dedicated .mod.c file is generated by modpost for each module a
kbuild: compile constant module information only once
Various information about modules is compiled into the info sections. For that a dedicated .mod.c file is generated by modpost for each module and then linked into the module. However most of the information in the .mod.c is the same for all modules, internal and external. Split the shared information into a dedicated source file that is compiled once and then linked into all modules.
This avoids frequent rebuilds for all .mod.c files when using CONFIG_LOCALVERSION_AUTO because the local version ends up in .mod.c through UTS_RELEASE and VERMAGIC_STRING. The modules are still relinked in this case.
The code is also easier to maintain as it's now in a proper source file instead of an inline string literal.
Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.11-rc6, v6.11-rc5, v6.11-rc4 |
|
| #
4079fe8e |
| 16-Aug-2024 |
Masahiro Yamada <[email protected]> |
modpost: simplify modpost_log()
With commit cda5f94e88b4 ("modpost: avoid using the alias attribute"), only two log levels remain: LOG_WARN and LOG_ERROR. Simplify this by making it a boolean variab
modpost: simplify modpost_log()
With commit cda5f94e88b4 ("modpost: avoid using the alias attribute"), only two log levels remain: LOG_WARN and LOG_ERROR. Simplify this by making it a boolean variable.
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]>
show more ...
|
| #
7a7f9745 |
| 12-Aug-2024 |
Masahiro Yamada <[email protected]> |
modpost: improve the section mismatch warning format
This commit improves the section mismatch warning format when there is no suitable symbol name to print.
The section mismatch warning prints the
modpost: improve the section mismatch warning format
This commit improves the section mismatch warning format when there is no suitable symbol name to print.
The section mismatch warning prints the reference source in the form of <symbol_name>+<offset> and the reference destination in the form of <symbol_name>.
However, there are some corner cases where <symbol_name> becomes "(unknown)", as reported in commit 23dfd914d2bf ("modpost: fix null pointer dereference").
In such cases, it is better to print the symbol address.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
4c2598e3 |
| 12-Aug-2024 |
Masahiro Yamada <[email protected]> |
modpost: replace the use of NOFAIL() with xmalloc() etc.
I think x*alloc() functions are cleaner.
Signed-off-by: Masahiro Yamada <[email protected]>
|
|
Revision tags: v6.11-rc3, v6.11-rc2, v6.11-rc1 |
|
| #
a660deb0 |
| 27-Jul-2024 |
Masahiro Yamada <[email protected]> |
modpost: detect endianness on run-time
Endianness is currently detected on compile-time, but we can defer this until run-time. This change avoids re-executing scripts/mod/mk_elfconfig even if modpos
modpost: detect endianness on run-time
Endianness is currently detected on compile-time, but we can defer this until run-time. This change avoids re-executing scripts/mod/mk_elfconfig even if modpost in the linux-headers package needs to be rebuilt for a foreign architecture.
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
show more ...
|
| #
3554a452 |
| 20-Jul-2024 |
Masahiro Yamada <[email protected]> |
modpost: use generic macros for hash table implementation
Use macros provided by hashtable.h
Signed-off-by: Masahiro Yamada <[email protected]>
|
| #
fbaf242c |
| 20-Jul-2024 |
Masahiro Yamada <[email protected]> |
kbuild: move some helper headers from scripts/kconfig/ to scripts/include/
Move array_size.h, hashtable.h, list.h, list_types.h from scripts/kconfig/ to scripts/include/.
These headers will be usef
kbuild: move some helper headers from scripts/kconfig/ to scripts/include/
Move array_size.h, hashtable.h, list.h, list_types.h from scripts/kconfig/ to scripts/include/.
These headers will be useful for other host programs.
Remove scripts/mod/list.h.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.10, v6.10-rc7 |
|
| #
f58437ab |
| 04-Jul-2024 |
Masahiro Yamada <[email protected]> |
modpost: rename R_ARM_THM_CALL to R_ARM_THM_PC22
/usr/include/elf.h, which originates from the glibc/musl, defines R_ARM_THM_PC22 instead of R_ARM_THM_CALL.
Signed-off-by: Masahiro Yamada <masahiro
modpost: rename R_ARM_THM_CALL to R_ARM_THM_PC22
/usr/include/elf.h, which originates from the glibc/musl, defines R_ARM_THM_PC22 instead of R_ARM_THM_CALL.
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]>
show more ...
|
| #
3914cdde |
| 04-Jul-2024 |
Masahiro Yamada <[email protected]> |
modpost: remove self-definitions of R_ARM_* macros
Commit f5983dab0ead ("modpost: define more R_ARM_* for old distributions") added self-definitions for the R_ARM_* macros to fix build errors on Cen
modpost: remove self-definitions of R_ARM_* macros
Commit f5983dab0ead ("modpost: define more R_ARM_* for old distributions") added self-definitions for the R_ARM_* macros to fix build errors on CentOS 7.
RHEL/CentOS 7 were retired at the end of June.
Remove all the R_ARM_* definitions (except for R_ARM_THM_CALL), which should be available in recent distributions.
glibc and musl added most of R_ARM_* macros in 2013. [1] [2]
[1]: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=08cbd996d33114ca50644d060fbe3a08260430fb [2]: https://git.musl-libc.org/cgit/musl/commit/?id=268375c1c017c0bdefeed1a330811e433c4dfaef
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]>
show more ...
|
|
Revision tags: v6.10-rc6, v6.10-rc5, v6.10-rc4 |
|
| #
7308bf8a |
| 11-Jun-2024 |
Uwe Kleine-König <[email protected]> |
modpost: Enable section warning from *driver to .exit.text
There used to be several offenders, but now that for all of them patches were sent and most of them were applied, enable the warning also f
modpost: Enable section warning from *driver to .exit.text
There used to be several offenders, but now that for all of them patches were sent and most of them were applied, enable the warning also for builds without W=1.
Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
73db3abd |
| 06-Jul-2024 |
Masahiro Yamada <[email protected]> |
init/modpost: conditionally check section mismatch to __meminit*
This reverts commit eb8f689046b8 ("Use separate sections for __dev/ _cpu/__mem code/data").
Check section mismatch to __meminit* onl
init/modpost: conditionally check section mismatch to __meminit*
This reverts commit eb8f689046b8 ("Use separate sections for __dev/ _cpu/__mem code/data").
Check section mismatch to __meminit* only when CONFIG_MEMORY_HOTPLUG=n.
With this change, the linker script and modpost become simpler, and we can get rid of the __ref annotations from the memory hotplug code.
[[email protected]: remove MEM_KEEP from arch/powerpc/kernel/vmlinux.lds.S] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Stephen Rothwell <[email protected]> Reviewed-by: Wei Yang <[email protected]> Cc: Stephen Rothwell <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
show more ...
|