Linux Modules
 help / color / mirror / Atom feed
* [GIT PULL] Modules changes for v6.17-rc1
From: Daniel Gomez @ 2025-08-03 13:18 UTC (permalink / raw)
  To: Linus Torvalds, Luis Chamberlain, Petr Pavlu, Sami Tolvanen,
	Daniel Gomez, linux-modules
  Cc: Thomas Weißschuh, David Gow, Steven Rostedt, linux-kernel

The following changes since commit 260f6f4fda93c8485c8037865c941b42b9cba5d2:

  Merge tag 'drm-next-2025-07-30' of https://gitlab.freedesktop.org/drm/kernel (2025-07-30 19:26:49 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux.git/ tags/modules-6.17-rc1

for you to fetch changes up to 40a826bd6c82ae45cfd3a19cd2a60a10f56b74c0:

  module: Rename MAX_PARAM_PREFIX_LEN to __MODULE_NAME_LEN (2025-07-31 13:57:47 +0200)

----------------------------------------------------------------
This is a small set of changes for modules, primarily to extend module users
to use the module data structures in combination with the already no-op stub
module functions, even when support for modules is disabled in the kernel
configuration. This change follows the kernel's coding style for conditional
compilation and allows kunit code to drop all CONFIG_MODULES ifdefs, which is
also part of the changes. This should allow others part of the kernel to do the
same cleanup.

Note that this had a conflict with sysctl changes [1] but should be fixed now as I
rebased on top.

The remaining changes include a fix for module name length handling which could
potentially lead to the removal of an incorrect module, and various cleanups.

The module name fix and related cleanup has been in linux-next since Thursday
(July 31) while the rest of the changes for a bit more than 3 weeks.

Note that this currently has conflicts in next with kbuild's tree [2].

Link: https://lore.kernel.org/all/20250714175916.774e6d79@canb.auug.org.au/ [1]
Link: https://lore.kernel.org/all/20250801132941.6815d93d@canb.auug.org.au/ [2]

----------------------------------------------------------------
Petr Pavlu (5):
      module: Prevent silent truncation of module name in delete_module(2)
      module: Remove unnecessary +1 from last_unloaded_module::name size
      module: Restore the moduleparam prefix length check
      tracing: Replace MAX_PARAM_PREFIX_LEN with MODULE_NAME_LEN
      module: Rename MAX_PARAM_PREFIX_LEN to __MODULE_NAME_LEN

Thomas Weißschuh (3):
      module: move 'struct module_use' to internal.h
      module: make structure definitions always visible
      kunit: test: Drop CONFIG_MODULE ifdeffery

 include/linux/module.h      | 29 +++++++++++------------------
 include/linux/moduleparam.h | 15 +++++++++------
 kernel/module/internal.h    |  7 +++++++
 kernel/module/main.c        | 12 +++++++-----
 kernel/trace/trace.c        |  2 +-
 lib/kunit/test.c            |  8 --------
 6 files changed, 35 insertions(+), 38 deletions(-)

^ permalink raw reply

* Re: [PATCH 0/5] module: Fix minor problems related to MODULE_NAME_LEN
From: Daniel Gomez @ 2025-07-31 12:03 UTC (permalink / raw)
  To: Luis Chamberlain, Sami Tolvanen, Petr Pavlu; +Cc: linux-modules, linux-kernel
In-Reply-To: <20250630143535.267745-1-petr.pavlu@suse.com>


On Mon, 30 Jun 2025 16:32:31 +0200, Petr Pavlu wrote:
> Fix a few minor problems related to MODULE_NAME_LEN and
> MAX_PARAM_PREFIX_LEN, and clean up their usage.
> 
> Petr Pavlu (5):
>   module: Prevent silent truncation of module name in delete_module(2)
>   module: Remove unnecessary +1 from last_unloaded_module::name size
>   module: Restore the moduleparam prefix length check
>   tracing: Replace MAX_PARAM_PREFIX_LEN with MODULE_NAME_LEN
>   module: Rename MAX_PARAM_PREFIX_LEN to __MODULE_NAME_LEN
> 
> [...]

Applied, thanks!

[1/5] module: Prevent silent truncation of module name in delete_module(2)
      commit: a6323bd4e611567913e23df5b58f2d4e4da06789
[2/5] module: Remove unnecessary +1 from last_unloaded_module::name size
      commit: 6c171b2ccfe677ca97fc5334f853807959f26589
[3/5] module: Restore the moduleparam prefix length check
      commit: bdc877ba6b7ff1b6d2ebeff11e63da4a50a54854
[4/5] tracing: Replace MAX_PARAM_PREFIX_LEN with MODULE_NAME_LEN
      commit: a7c54b2b41dd1f6ec780e7fbfb13f70c64c9731d
[5/5] module: Rename MAX_PARAM_PREFIX_LEN to __MODULE_NAME_LEN
      commit: 40a826bd6c82ae45cfd3a19cd2a60a10f56b74c0

Best regards,
-- 
Daniel Gomez <da.gomez@samsung.com>


^ permalink raw reply

* Re: [PATCH v5 03/10] kbuild: keep .modinfo section in vmlinux.unstripped
From: Masahiro Yamada @ 2025-07-29 13:54 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: Alexey Gladkov, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier, linux-kernel,
	linux-modules, linux-kbuild
In-Reply-To: <20250728135753.432695A72-agordeev@linux.ibm.com>

On Mon, Jul 28, 2025 at 10:58 PM Alexander Gordeev
<agordeev@linux.ibm.com> wrote:
>
> On Thu, Jul 24, 2025 at 03:49:40PM +0200, Alexey Gladkov wrote:
>
> Hi Alexey, Masahiro,
>
> > From: Masahiro Yamada <masahiroy@kernel.org>
> >
> > Keep the .modinfo section during linking, but strip it from the final
> > vmlinux.
> >
> > Adjust scripts/mksysmap to exclude modinfo symbols from kallsyms.
> >
> > This change will allow the next commit to extract the .modinfo section
> > from the vmlinux.unstripped intermediate.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >  include/asm-generic/vmlinux.lds.h | 2 +-
> >  scripts/Makefile.vmlinux          | 2 +-
> >  scripts/mksysmap                  | 3 +++
> >  3 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> > index fa5f19b8d53a..1791665006f9 100644
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -831,6 +831,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
> >
> >  /* Required sections not related to debugging. */
> >  #define ELF_DETAILS                                                  \
> > +             .modinfo : { *(.modinfo) }                              \
>
> FWIW, to me .modinfo logically does not quite belong to ELF_DETAILS,
> since it is not about ELF.
>
> I would guess, that you want to make a minimal code impact to the
> linker scripts, but with that you turn .modinfo the only section
> among ones that do not make it to the final image:
>
>         STABS_DEBUG
>         DWARF_DEBUG
>         ELF_DETAILS
>
> That immediately breaks s390, but also is a call for trouble in
> the future, as far as I am concerned.
>
> Would it makes sense to introduce e.g MODINFO instead?

I am open to MODINFO addition, if Alexey is happy about
modifying linker scripts for all arches.
Yeah, it is tedious, though...




>
> >               .comment 0 : { *(.comment) }                            \
> >               .symtab 0 : { *(.symtab) }                              \
> >               .strtab 0 : { *(.strtab) }                              \
> > @@ -1044,7 +1045,6 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
> >       *(.discard.*)                                                   \
> >       *(.export_symbol)                                               \
> >       *(.no_trim_symbol)                                              \
> > -     *(.modinfo)                                                     \
> >       /* ld.bfd warns about .gnu.version* even when not emitted */    \
> >       *(.gnu.version*)                                                \
>
> Thanks!



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply

* Re: [PATCH v5 10/10] s390: vmlinux.lds.S: Reorder sections
From: Masahiro Yamada @ 2025-07-29 12:46 UTC (permalink / raw)
  To: Alexey Gladkov
  Cc: Heiko Carstens, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier, linux-kernel,
	linux-modules, linux-kbuild, Vasily Gorbik, Alexander Gordeev,
	linux-s390, kernel test robot
In-Reply-To: <aIeUq0qYXoNIePwd@example.org>

On Tue, Jul 29, 2025 at 12:18 AM Alexey Gladkov <legion@kernel.org> wrote:
>
> On Mon, Jul 28, 2025 at 04:01:09PM +0200, Heiko Carstens wrote:
> > On Sat, Jul 26, 2025 at 07:59:16PM +0900, Masahiro Yamada wrote:
> > > On Thu, Jul 24, 2025 at 10:50 PM Alexey Gladkov <legion@kernel.org> wrote:
> > > >
> > > > Reorder the sections to be placed in the default segment. The
> > > > .vmlinux.info use :NONE to override the default segment and tell the
> > > > linker to not put the section in any segment at all.
> > > >
> > > > >> s390x-linux-ld: .tmp_vmlinux1: warning: allocated section `.modinfo' not in segment
> > > > >> s390x-linux-ld: .tmp_vmlinux2: warning: allocated section `.modinfo' not in segment
> > > > >> s390x-linux-ld: vmlinux.unstripped: warning: allocated section `.modinfo' not in segment
> > >
> > > Thank you for root-causing!


I applied this series with patch re-ordering.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply

* Re: [PATCH v5 10/10] s390: vmlinux.lds.S: Reorder sections
From: Alexey Gladkov @ 2025-07-28 15:18 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier, linux-kernel,
	linux-modules, linux-kbuild, Vasily Gorbik, Alexander Gordeev,
	linux-s390, kernel test robot
In-Reply-To: <20250728140109.7289Ae1-hca@linux.ibm.com>

On Mon, Jul 28, 2025 at 04:01:09PM +0200, Heiko Carstens wrote:
> On Sat, Jul 26, 2025 at 07:59:16PM +0900, Masahiro Yamada wrote:
> > On Thu, Jul 24, 2025 at 10:50 PM Alexey Gladkov <legion@kernel.org> wrote:
> > >
> > > Reorder the sections to be placed in the default segment. The
> > > .vmlinux.info use :NONE to override the default segment and tell the
> > > linker to not put the section in any segment at all.
> > >
> > > >> s390x-linux-ld: .tmp_vmlinux1: warning: allocated section `.modinfo' not in segment
> > > >> s390x-linux-ld: .tmp_vmlinux2: warning: allocated section `.modinfo' not in segment
> > > >> s390x-linux-ld: vmlinux.unstripped: warning: allocated section `.modinfo' not in segment
> > 
> > Thank you for root-causing!
> > 
> > > Cc: Heiko Carstens <hca@linux.ibm.com>
> > > Cc: Vasily Gorbik <gor@linux.ibm.com>
> > > Cc: Alexander Gordeev <agordeev@linux.ibm.com>
> > > Cc: linux-s390@vger.kernel.org
> > 
> > Hi s390 maintainers,
> > I need this patch for kbuild tree.
> > Ack is appreciated.
> 
> Acked-by: Heiko Carstens <hca@linux.ibm.com>
> 
> But can you reorder the series so this patch comes before any of the
> patches which introduces the above warnings, please?

Sure. I will put it first to avoid warnings.

-- 
Rgrds, legion


^ permalink raw reply

* Re: [PATCH v5 03/10] kbuild: keep .modinfo section in vmlinux.unstripped
From: Alexey Gladkov @ 2025-07-28 15:15 UTC (permalink / raw)
  To: Alexander Gordeev
  Cc: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier, linux-kernel,
	linux-modules, linux-kbuild
In-Reply-To: <20250728135753.432695A72-agordeev@linux.ibm.com>

On Mon, Jul 28, 2025 at 03:57:53PM +0200, Alexander Gordeev wrote:
> On Thu, Jul 24, 2025 at 03:49:40PM +0200, Alexey Gladkov wrote:
> 
> Hi Alexey, Masahiro,
> 
> > From: Masahiro Yamada <masahiroy@kernel.org>
> > 
> > Keep the .modinfo section during linking, but strip it from the final
> > vmlinux.
> > 
> > Adjust scripts/mksysmap to exclude modinfo symbols from kallsyms.
> > 
> > This change will allow the next commit to extract the .modinfo section
> > from the vmlinux.unstripped intermediate.
> > 
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >  include/asm-generic/vmlinux.lds.h | 2 +-
> >  scripts/Makefile.vmlinux          | 2 +-
> >  scripts/mksysmap                  | 3 +++
> >  3 files changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> > index fa5f19b8d53a..1791665006f9 100644
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -831,6 +831,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
> >  
> >  /* Required sections not related to debugging. */
> >  #define ELF_DETAILS							\
> > +		.modinfo : { *(.modinfo) }				\
> 
> FWIW, to me .modinfo logically does not quite belong to ELF_DETAILS,
> since it is not about ELF.

The macro name ELF_DETAILS is rather unfortunate. The description says
that these sections are not related to debugging.

> I would guess, that you want to make a minimal code impact to the
> linker scripts, but with that you turn .modinfo the only section
> among ones that do not make it to the final image:
> 
> 	STABS_DEBUG
> 	DWARF_DEBUG
> 	ELF_DETAILS
> 
> That immediately breaks s390, but also is a call for trouble in
> the future, as far as I am concerned.
> 
> Would it makes sense to introduce e.g MODINFO instead?

This will require patching all architectures to add MODINFO. This will
have a significant code impact. To avoid this, .modinfo was added to
ELF_DETAILS.

> >  		.comment 0 : { *(.comment) }				\
> >  		.symtab 0 : { *(.symtab) }				\
> >  		.strtab 0 : { *(.strtab) }				\
> > @@ -1044,7 +1045,6 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
> >  	*(.discard.*)							\
> >  	*(.export_symbol)						\
> >  	*(.no_trim_symbol)						\
> > -	*(.modinfo)							\
> >  	/* ld.bfd warns about .gnu.version* even when not emitted */	\
> >  	*(.gnu.version*)						\
> 
> Thanks!
> 

-- 
Rgrds, legion


^ permalink raw reply

* Re: [PATCH 4/5] tracing: Replace MAX_PARAM_PREFIX_LEN with MODULE_NAME_LEN
From: Steven Rostedt @ 2025-07-28 14:34 UTC (permalink / raw)
  To: Daniel Gomez
  Cc: Petr Pavlu, Luis Chamberlain, Sami Tolvanen, Daniel Gomez,
	Masami Hiramatsu, linux-modules, linux-kernel
In-Reply-To: <e9caf91d-3a4b-4140-a3bc-0c2b53c0a220@kernel.org>

On Mon, 28 Jul 2025 08:48:01 +0200
Daniel Gomez <da.gomez@kernel.org> wrote:

> On 30/06/2025 16.32, Petr Pavlu wrote:
> > Use the MODULE_NAME_LEN definition in module_exists() to obtain the maximum
> > size of a module name, instead of using MAX_PARAM_PREFIX_LEN. The values
> > are the same but MODULE_NAME_LEN is more appropriate in this context.
> > MAX_PARAM_PREFIX_LEN was added in commit 730b69d22525 ("module: check
> > kernel param length at compile time, not runtime") only to break a circular
> > dependency between module.h and moduleparam.h, and should mostly be limited
> > to use in moduleparam.h.
> > 
> > Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> > Cc: Steven Rostedt <rostedt@goodmis.org>
> > Cc: Masami Hiramatsu <mhiramat@kernel.org>  
> 
> Steven, Masami,
> 
> I'm planning to merge these series into modules-next. I think and Ack/Review
> would be great from you. Otherwise, let me know if you'd rather take this patch
> through tracing instead (in case it looks good from your side).

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

> 
> > ---
> > 
> > As a side note, I suspect the function module_exists() would be better
> > replaced with !!find_module() + RCU locking, but that is a separate issue.

Yeah, that is probably something that should be done too.

Thanks,

-- Steve


^ permalink raw reply

* Re: [PATCH v5 10/10] s390: vmlinux.lds.S: Reorder sections
From: Heiko Carstens @ 2025-07-28 14:01 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Alexey Gladkov, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier, linux-kernel,
	linux-modules, linux-kbuild, Vasily Gorbik, Alexander Gordeev,
	linux-s390, kernel test robot
In-Reply-To: <CAK7LNARV+8vZPUtX8iG_hEAt8tCchRPFobK85tv9dbJwVqYgsw@mail.gmail.com>

On Sat, Jul 26, 2025 at 07:59:16PM +0900, Masahiro Yamada wrote:
> On Thu, Jul 24, 2025 at 10:50 PM Alexey Gladkov <legion@kernel.org> wrote:
> >
> > Reorder the sections to be placed in the default segment. The
> > .vmlinux.info use :NONE to override the default segment and tell the
> > linker to not put the section in any segment at all.
> >
> > >> s390x-linux-ld: .tmp_vmlinux1: warning: allocated section `.modinfo' not in segment
> > >> s390x-linux-ld: .tmp_vmlinux2: warning: allocated section `.modinfo' not in segment
> > >> s390x-linux-ld: vmlinux.unstripped: warning: allocated section `.modinfo' not in segment
> 
> Thank you for root-causing!
> 
> > Cc: Heiko Carstens <hca@linux.ibm.com>
> > Cc: Vasily Gorbik <gor@linux.ibm.com>
> > Cc: Alexander Gordeev <agordeev@linux.ibm.com>
> > Cc: linux-s390@vger.kernel.org
> 
> Hi s390 maintainers,
> I need this patch for kbuild tree.
> Ack is appreciated.

Acked-by: Heiko Carstens <hca@linux.ibm.com>

But can you reorder the series so this patch comes before any of the
patches which introduces the above warnings, please?

Thanks!

^ permalink raw reply

* Re: [PATCH v5 03/10] kbuild: keep .modinfo section in vmlinux.unstripped
From: Alexander Gordeev @ 2025-07-28 13:57 UTC (permalink / raw)
  To: Alexey Gladkov
  Cc: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier, linux-kernel,
	linux-modules, linux-kbuild
In-Reply-To: <d44055fc22d4a53b7f87758d31cb4d640c8f8cca.1753354215.git.legion@kernel.org>

On Thu, Jul 24, 2025 at 03:49:40PM +0200, Alexey Gladkov wrote:

Hi Alexey, Masahiro,

> From: Masahiro Yamada <masahiroy@kernel.org>
> 
> Keep the .modinfo section during linking, but strip it from the final
> vmlinux.
> 
> Adjust scripts/mksysmap to exclude modinfo symbols from kallsyms.
> 
> This change will allow the next commit to extract the .modinfo section
> from the vmlinux.unstripped intermediate.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>  include/asm-generic/vmlinux.lds.h | 2 +-
>  scripts/Makefile.vmlinux          | 2 +-
>  scripts/mksysmap                  | 3 +++
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index fa5f19b8d53a..1791665006f9 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -831,6 +831,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
>  
>  /* Required sections not related to debugging. */
>  #define ELF_DETAILS							\
> +		.modinfo : { *(.modinfo) }				\

FWIW, to me .modinfo logically does not quite belong to ELF_DETAILS,
since it is not about ELF.

I would guess, that you want to make a minimal code impact to the
linker scripts, but with that you turn .modinfo the only section
among ones that do not make it to the final image:

	STABS_DEBUG
	DWARF_DEBUG
	ELF_DETAILS

That immediately breaks s390, but also is a call for trouble in
the future, as far as I am concerned.

Would it makes sense to introduce e.g MODINFO instead?

>  		.comment 0 : { *(.comment) }				\
>  		.symtab 0 : { *(.symtab) }				\
>  		.strtab 0 : { *(.strtab) }				\
> @@ -1044,7 +1045,6 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
>  	*(.discard.*)							\
>  	*(.export_symbol)						\
>  	*(.no_trim_symbol)						\
> -	*(.modinfo)							\
>  	/* ld.bfd warns about .gnu.version* even when not emitted */	\
>  	*(.gnu.version*)						\

Thanks!

^ permalink raw reply

* Re: [PATCH 5/5] module: Rename MAX_PARAM_PREFIX_LEN to __MODULE_NAME_LEN
From: Daniel Gomez @ 2025-07-28  6:48 UTC (permalink / raw)
  To: Petr Pavlu, Luis Chamberlain, Sami Tolvanen, Daniel Gomez
  Cc: linux-modules, linux-kernel
In-Reply-To: <20250630143535.267745-6-petr.pavlu@suse.com>

On 30/06/2025 16.32, Petr Pavlu wrote:
> The maximum module name length (MODULE_NAME_LEN) is somewhat confusingly
> defined in terms of the maximum parameter prefix length
> (MAX_PARAM_PREFIX_LEN), when in fact the dependency is in the opposite
> direction.
> 
> This split originates from commit 730b69d22525 ("module: check kernel param
> length at compile time, not runtime"). The code needed to use
> MODULE_NAME_LEN in moduleparam.h, but because module.h requires
> moduleparam.h, this created a circular dependency. It was resolved by
> introducing MAX_PARAM_PREFIX_LEN in moduleparam.h and defining
> MODULE_NAME_LEN in module.h in terms of MAX_PARAM_PREFIX_LEN.
> 
> Rename MAX_PARAM_PREFIX_LEN to __MODULE_NAME_LEN for clarity. This matches
> the similar approach of defining MODULE_INFO in module.h and __MODULE_INFO
> in moduleparam.h.
> 
> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> ---
>  include/linux/module.h      |  2 +-
>  include/linux/moduleparam.h | 12 ++++++++----
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/module.h b/include/linux/module.h
> index 5faa1fb1f4b4..0f1dde3996d9 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -32,7 +32,7 @@
>  #include <linux/percpu.h>
>  #include <asm/module.h>
>  
> -#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
> +#define MODULE_NAME_LEN __MODULE_NAME_LEN
>  
>  struct modversion_info {
>  	unsigned long crc;
> diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
> index 110e9d09de24..a04a2bc4f51e 100644
> --- a/include/linux/moduleparam.h
> +++ b/include/linux/moduleparam.h
> @@ -6,6 +6,13 @@
>  #include <linux/stringify.h>
>  #include <linux/kernel.h>
>  
> +/*
> + * The maximum module name length, including the NUL byte.
> + * Chosen so that structs with an unsigned long line up, specifically
> + * modversion_info.
> + */
> +#define __MODULE_NAME_LEN (64 - sizeof(unsigned long))
> +
>  /* You can override this manually, but generally this should match the
>     module name. */
>  #ifdef MODULE
> @@ -17,9 +24,6 @@
>  #define __MODULE_INFO_PREFIX KBUILD_MODNAME "."
>  #endif
>  
> -/* Chosen so that structs with an unsigned long line up. */
> -#define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long))
> -
>  #define __MODULE_INFO(tag, name, info)					  \
>  	static const char __UNIQUE_ID(name)[]				  \
>  		__used __section(".modinfo") __aligned(1)		  \
> @@ -284,7 +288,7 @@ struct kparam_array
>  
>  /* This is the fundamental function for registering boot/module parameters. */
>  #define __module_param_call(prefix, name, ops, arg, perm, level, flags)	\
> -	static_assert(sizeof(""prefix) - 1 <= MAX_PARAM_PREFIX_LEN);	\
> +	static_assert(sizeof(""prefix) - 1 <= __MODULE_NAME_LEN);	\
>  	static const char __param_str_##name[] = prefix #name;		\
>  	static struct kernel_param __moduleparam_const __param_##name	\
>  	__used __section("__param")					\


LGTM,

Reviewed-by: Daniel Gomez <da.gomez@samsung.com>

^ permalink raw reply

* Re: [PATCH 4/5] tracing: Replace MAX_PARAM_PREFIX_LEN with MODULE_NAME_LEN
From: Daniel Gomez @ 2025-07-28  6:48 UTC (permalink / raw)
  To: Petr Pavlu, Luis Chamberlain, Sami Tolvanen, Daniel Gomez,
	Steven Rostedt, Masami Hiramatsu
  Cc: linux-modules, linux-kernel
In-Reply-To: <20250630143535.267745-5-petr.pavlu@suse.com>

On 30/06/2025 16.32, Petr Pavlu wrote:
> Use the MODULE_NAME_LEN definition in module_exists() to obtain the maximum
> size of a module name, instead of using MAX_PARAM_PREFIX_LEN. The values
> are the same but MODULE_NAME_LEN is more appropriate in this context.
> MAX_PARAM_PREFIX_LEN was added in commit 730b69d22525 ("module: check
> kernel param length at compile time, not runtime") only to break a circular
> dependency between module.h and moduleparam.h, and should mostly be limited
> to use in moduleparam.h.
> 
> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Masami Hiramatsu <mhiramat@kernel.org>

Steven, Masami,

I'm planning to merge these series into modules-next. I think and Ack/Review
would be great from you. Otherwise, let me know if you'd rather take this patch
through tracing instead (in case it looks good from your side).

> ---
> 
> As a side note, I suspect the function module_exists() would be better
> replaced with !!find_module() + RCU locking, but that is a separate issue.
> 
>  kernel/trace/trace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 95ae7c4e5835..b9da0c4661a0 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -10373,7 +10373,7 @@ bool module_exists(const char *module)
>  {
>  	/* All modules have the symbol __this_module */
>  	static const char this_mod[] = "__this_module";
> -	char modname[MAX_PARAM_PREFIX_LEN + sizeof(this_mod) + 2];
> +	char modname[MODULE_NAME_LEN + sizeof(this_mod) + 2];
>  	unsigned long val;
>  	int n;
>  

LGTM,

Reviewed-by: Daniel Gomez <da.gomez@samsung.com>

^ permalink raw reply

* Re: [PATCH 3/5] module: Restore the moduleparam prefix length check
From: Daniel Gomez @ 2025-07-28  6:43 UTC (permalink / raw)
  To: Petr Pavlu
  Cc: Luis Chamberlain, Sami Tolvanen, Daniel Gomez, linux-modules,
	linux-kernel
In-Reply-To: <264b23ee-7046-4be9-8e01-d79a517e6256@suse.com>

On 21/07/2025 11.21, Petr Pavlu wrote:
> On 7/17/25 9:23 PM, Daniel Gomez wrote:
>> On 30/06/2025 16.32, Petr Pavlu wrote:
>>> The moduleparam code allows modules to provide their own definition of
>>> MODULE_PARAM_PREFIX, instead of using the default KBUILD_MODNAME ".".
>>>
>>> Commit 730b69d22525 ("module: check kernel param length at compile time,
>>> not runtime") added a check to ensure the prefix doesn't exceed
>>> MODULE_NAME_LEN, as this is what param_sysfs_builtin() expects.
>>>
>>> Later, commit 58f86cc89c33 ("VERIFY_OCTAL_PERMISSIONS: stricter checking
>>> for sysfs perms.") removed this check, but there is no indication this was
>>> intentional.
>>>
>>> Since the check is still useful for param_sysfs_builtin() to function
>>> properly, reintroduce it in __module_param_call(), but in a modernized form
>>> using static_assert().
>>>
>>> While here, clean up the __module_param_call() comments. In particular,
>>> remove the comment "Default value instead of permissions?", which comes
>>> from commit 9774a1f54f17 ("[PATCH] Compile-time check re world-writeable
>>> module params"). This comment was related to the test variable
>>> __param_perm_check_##name, which was removed in the previously mentioned
>>> commit 58f86cc89c33.
>>>
>>> Fixes: 58f86cc89c33 ("VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.")
>>> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
>>> ---
>>>  include/linux/moduleparam.h | 5 ++---
>>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
>>> index bfb85fd13e1f..110e9d09de24 100644
>>> --- a/include/linux/moduleparam.h
>>> +++ b/include/linux/moduleparam.h
>>> @@ -282,10 +282,9 @@ struct kparam_array
>>>  #define __moduleparam_const const
>>>  #endif
>>>  
>>> -/* This is the fundamental function for registering boot/module
>>> -   parameters. */
>>> +/* This is the fundamental function for registering boot/module parameters. */
>>>  #define __module_param_call(prefix, name, ops, arg, perm, level, flags)	\
>>> -	/* Default value instead of permissions? */			\
>>> +	static_assert(sizeof(""prefix) - 1 <= MAX_PARAM_PREFIX_LEN);	\
>>
>> Can you clarify if -1 to remove the dot from prefix?
>>
>> Final code 
>> 	static_assert(sizeof(""prefix) - 1 <= __MODULE_NAME_LEN);	\
>>
>> with __MODULE_NAME_LEN being:
>>
>> #define __MODULE_NAME_LEN (64 - sizeof(unsigned long))
> 
> Correct, -1 is to account for the dot at the end of the prefix.

LGTM,

Reviewed-by: Daniel Gomez <da.gomez@samsung.com>

> 
> I actually also wanted to assert that the prefix ends with a dot, but
> unfortunately prefix[sizeof(prefix)-2] (with prefix being a string
> literal) is not a constant expression in C.
> 

But even if that would be possible, there are some calls that do not have
a prefix with dot. For example,

#define core_param(name, var, type, perm)				\
	param_check_##type(name, &(var));				\
	__module_param_call("", name, &param_ops_##type, &var, perm, -1, 0)

So, you'd have to handle both cases. I mean, where __module_param_call(<prefix>
is used with either MODULE_PARAM_PREFIX or an empty string "".

^ permalink raw reply

* Re: [PATCH v5 10/10] s390: vmlinux.lds.S: Reorder sections
From: Masahiro Yamada @ 2025-07-26 10:59 UTC (permalink / raw)
  To: Alexey Gladkov
  Cc: Petr Pavlu, Luis Chamberlain, Sami Tolvanen, Daniel Gomez,
	Nathan Chancellor, Nicolas Schier, linux-kernel, linux-modules,
	linux-kbuild, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	linux-s390, kernel test robot
In-Reply-To: <2860d5a5e7c6279b3836537e20b0fa0c40d2ba0f.1753354215.git.legion@kernel.org>

On Thu, Jul 24, 2025 at 10:50 PM Alexey Gladkov <legion@kernel.org> wrote:
>
> Reorder the sections to be placed in the default segment. The
> .vmlinux.info use :NONE to override the default segment and tell the
> linker to not put the section in any segment at all.
>
> >> s390x-linux-ld: .tmp_vmlinux1: warning: allocated section `.modinfo' not in segment
> >> s390x-linux-ld: .tmp_vmlinux2: warning: allocated section `.modinfo' not in segment
> >> s390x-linux-ld: vmlinux.unstripped: warning: allocated section `.modinfo' not in segment

Thank you for root-causing!



> Cc: Heiko Carstens <hca@linux.ibm.com>
> Cc: Vasily Gorbik <gor@linux.ibm.com>
> Cc: Alexander Gordeev <agordeev@linux.ibm.com>
> Cc: linux-s390@vger.kernel.org


Hi s390 maintainers,
I need this patch for kbuild tree.
Ack is appreciated.


> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202506062053.zbkFBEnJ-lkp@intel.com/
> Signed-off-by: Alexey Gladkov <legion@kernel.org>
> ---
>  arch/s390/kernel/vmlinux.lds.S | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
> index ff1ddba96352..3f2f90e38808 100644
> --- a/arch/s390/kernel/vmlinux.lds.S
> +++ b/arch/s390/kernel/vmlinux.lds.S
> @@ -202,6 +202,11 @@ SECTIONS
>         . = ALIGN(PAGE_SIZE);
>         _end = . ;
>
> +       /* Debugging sections.  */
> +       STABS_DEBUG
> +       DWARF_DEBUG
> +       ELF_DETAILS
> +
>         /*
>          * uncompressed image info used by the decompressor
>          * it should match struct vmlinux_info
> @@ -232,11 +237,6 @@ SECTIONS
>  #endif
>         } :NONE
>
> -       /* Debugging sections.  */
> -       STABS_DEBUG
> -       DWARF_DEBUG
> -       ELF_DETAILS
> -
>         /*
>          * Make sure that the .got.plt is either completely empty or it
>          * contains only the three reserved double words.
> --
> 2.50.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply

* Re: [PATCH 12/16] MAINTAINERS: Include dmesg.py under PRINTK entry
From: Florian Fainelli @ 2025-07-24 21:27 UTC (permalink / raw)
  To: John Ogness, linux-kernel
  Cc: Jan Kiszka, Kieran Bingham, Michael Turquette, Stephen Boyd,
	Dennis Zhou, Tejun Heo, Christoph Lameter, Greg Kroah-Hartman,
	Rafael J. Wysocki, Danilo Krummrich, Petr Mladek, Steven Rostedt,
	Sergey Senozhatsky, Ulf Hansson, Thomas Gleixner, Andrey Ryabinin,
	Alexander Potapenko, Andrey Konovalov, Dmitry Vyukov,
	Vincenzo Frascino, Liam R. Howlett, Andrew Morton,
	Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Daniel Gomez,
	Kent Overstreet, Anna-Maria Behnsen, Frederic Weisbecker,
	Alexander Viro, Christian Brauner, Jan Kara, Uladzislau Rezki,
	Matthew Wilcox, Kuan-Ying Lee, Ilya Leoshkevich, Etienne Buira,
	Antonio Quartulli, Illia Ostapyshyn,
	open list:COMMON CLK FRAMEWORK,
	open list:PER-CPU MEMORY ALLOCATOR, open list:GENERIC PM DOMAINS,
	open list:KASAN, open list:MAPLE TREE, open list:MODULE SUPPORT,
	open list:PROC FILESYSTEM
In-Reply-To: <84v7oic2qx.fsf@jogness.linutronix.de>

On 6/26/25 01:43, John Ogness wrote:
> On 2025-06-25, Florian Fainelli <florian.fainelli@broadcom.com> wrote:
>> Include the GDB scripts file under scripts/gdb/linux/dmesg.py under the
>> PRINTK subsystem since it parses internal data structures that depend
>> upon that subsystem.
>>
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> ---
>>   MAINTAINERS | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 224825ddea83..0931440c890b 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -19982,6 +19982,7 @@ S:	Maintained
>>   T:	git git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
>>   F:	include/linux/printk.h
>>   F:	kernel/printk/
>> +F:	scripts/gdb/linux/dmesg.py
> 
> Note that Documentation/admin-guide/kdump/gdbmacros.txt also contains a
> similar macro (dmesg). If something needs fixing in
> scripts/gdb/linux/dmesg.py, it usually needs fixing in
> Documentation/admin-guide/kdump/gdbmacros.txt as well.
> 
> So perhaps while at it, we can also add here:
> 
> F:	Documentation/admin-guide/kdump/gdbmacros.txt

Thanks, v2 coming up.
-- 
Florian

^ permalink raw reply

* Re: [PATCH 08/16] MAINTAINERS: Include GDB scripts under MEMORY MANAGEMENT entry
From: Florian Fainelli @ 2025-07-24 21:27 UTC (permalink / raw)
  To: David Hildenbrand, linux-kernel
  Cc: Jan Kiszka, Kieran Bingham, Michael Turquette, Stephen Boyd,
	Dennis Zhou, Tejun Heo, Christoph Lameter, Greg Kroah-Hartman,
	Rafael J. Wysocki, Danilo Krummrich, Petr Mladek, Steven Rostedt,
	John Ogness, Sergey Senozhatsky, Ulf Hansson, Thomas Gleixner,
	Andrey Ryabinin, Alexander Potapenko, Andrey Konovalov,
	Dmitry Vyukov, Vincenzo Frascino, Liam R. Howlett, Andrew Morton,
	Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Daniel Gomez,
	Kent Overstreet, Anna-Maria Behnsen, Frederic Weisbecker,
	Alexander Viro, Christian Brauner, Jan Kara, Uladzislau Rezki,
	Matthew Wilcox, Kuan-Ying Lee, Ilya Leoshkevich, Etienne Buira,
	Antonio Quartulli, Illia Ostapyshyn,
	open list:COMMON CLK FRAMEWORK,
	open list:PER-CPU MEMORY ALLOCATOR, open list:GENERIC PM DOMAINS,
	open list:KASAN, open list:MAPLE TREE, open list:MODULE SUPPORT,
	open list:PROC FILESYSTEM
In-Reply-To: <04116d0f-2815-4583-853e-e4295fb3d014@redhat.com>

On 6/27/25 10:10, David Hildenbrand wrote:
> On 26.06.25 01:10, Florian Fainelli wrote:
>> Include the GDB scripts file under scripts/gdb/linux/ that deal with
>> memory mamagenement code under the MEMORY MANAGEMENT subsystem since
>> they parses internal data structures that depend upon that subsystem.
>>
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> ---
>>   MAINTAINERS | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index cad5d613cab0..52b37196d024 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -15812,6 +15812,10 @@ F:    include/linux/mmu_notifier.h
>>   F:    include/linux/pagewalk.h
>>   F:    include/trace/events/ksm.h
>>   F:    mm/
>> +F:    scripts/gdb/linux/mm.py
>> +F:    scripts/gdb/linux/page_owner.py
>> +F:    scripts/gdb/linux/pgtable.py
>> +F:    scripts/gdb/linux/slab.py
> 
> Probably they should go to the corresponding sub-sections. At least 
> slab.py?
> 

Sounds good, thanks!

-- 
Florian

^ permalink raw reply

* Re: [PATCH 01/16] MAINTAINERS: Include clk.py under COMMON CLK FRAMEWORK entry
From: Stephen Boyd @ 2025-07-24 21:24 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel
  Cc: Florian Fainelli, Jan Kiszka, Kieran Bingham, Michael Turquette,
	Dennis Zhou, Tejun Heo, Christoph Lameter, Greg Kroah-Hartman,
	Rafael J. Wysocki, Danilo Krummrich, Petr Mladek, Steven Rostedt,
	John Ogness, Sergey Senozhatsky, Ulf Hansson, Thomas Gleixner,
	Andrey Ryabinin, Alexander Potapenko, Andrey Konovalov,
	Dmitry Vyukov, Vincenzo Frascino, Liam R. Howlett, Andrew Morton,
	Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Daniel Gomez,
	Kent Overstreet, Anna-Maria Behnsen, Frederic Weisbecker,
	Alexander Viro, Christian Brauner, Jan Kara, Uladzislau Rezki,
	Matthew Wilcox, Kuan-Ying Lee, Ilya Leoshkevich, Etienne Buira,
	Antonio Quartulli, Illia Ostapyshyn, linux-clk, linux-mm,
	linux-pm, kasan-dev, maple-tree, linux-modules, linux-fsdevel
In-Reply-To: <20250625231053.1134589-2-florian.fainelli@broadcom.com>

Quoting Florian Fainelli (2025-06-25 16:10:38)
> Include the GDB scripts file under scripts/gdb/linux/clk.py under the
> COMMON CLK subsystem since it parses internal data structures that
> depend upon that subsystem.
> 
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> ---

Applied to clk-next

^ permalink raw reply

* Re: [PATCH v5 07/10] modpost: Add modname to mod_device_table alias
From: Miguel Ojeda @ 2025-07-24 16:00 UTC (permalink / raw)
  To: Alexey Gladkov, Andreas Hindborg, Danilo Krummrich
  Cc: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier, linux-kernel,
	linux-modules, linux-kbuild, Miguel Ojeda, Alex Gaynor,
	rust-for-linux
In-Reply-To: <e78d20afcc059cec3cd977ee74a0ec4df06de05b.1753354215.git.legion@kernel.org>

On Thu, Jul 24, 2025 at 3:50 PM Alexey Gladkov <legion@kernel.org> wrote:
>
> At this point, if a symbol is compiled as part of the kernel,
> information about which module the symbol belongs to is lost.
>
> To save this it is possible to add the module name to the alias name.
> It's not very pretty, but it's possible for now.
>
> Cc: Miguel Ojeda <ojeda@kernel.org>

Thanks for the ping -- Cc'ing as well Andreas who is working on module
bits lately (but is away right now) and Danilo who maintains the
modified file:

Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Danilo Krummrich <dakr@kernel.org>

Cheers,
Miguel

^ permalink raw reply

* Re: [PATCH v5 06/10] pinctrl: meson: Fix typo in device table macro
From: Neil Armstrong @ 2025-07-24 14:09 UTC (permalink / raw)
  To: Alexey Gladkov, Masahiro Yamada, Petr Pavlu, Luis Chamberlain,
	Sami Tolvanen, Daniel Gomez, Nathan Chancellor, Nicolas Schier
  Cc: linux-kernel, linux-modules, linux-kbuild, Xianwei Zhao,
	Linus Walleij, Kevin Hilman, linux-amlogic, linux-gpio,
	kernel test robot
In-Reply-To: <c47f5e1ab68248cbc4d51dcd822829da8857ea00.1753354215.git.legion@kernel.org>

On 24/07/2025 15:49, Alexey Gladkov wrote:
> The typo when using the MODULE_DEVICE_TABLE macro was not noticeable
> because the macro was defined only if the module was built as a separate
> module.
> 
> Cc: Xianwei Zhao <xianwei.zhao@amlogic.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Kevin Hilman <khilman@baylibre.com>
> Cc: linux-amlogic@lists.infradead.org
> Cc: linux-gpio@vger.kernel.org
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202507220009.8HKbNP16-lkp@intel.com/
> Signed-off-by: Alexey Gladkov <legion@kernel.org>
> ---
>   drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> index 385cc619df13..95525e66e5c0 100644
> --- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> +++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
> @@ -1023,7 +1023,7 @@ static const struct of_device_id aml_pctl_of_match[] = {
>   	{ .compatible = "amlogic,pinctrl-a4", },
>   	{ /* sentinel */ }
>   };
> -MODULE_DEVICE_TABLE(of, aml_pctl_dt_match);
> +MODULE_DEVICE_TABLE(of, aml_pctl_of_match);
>   
>   static struct platform_driver aml_pctl_driver = {
>   	.driver = {

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply

* [PATCH v5 10/10] s390: vmlinux.lds.S: Reorder sections
From: Alexey Gladkov @ 2025-07-24 13:49 UTC (permalink / raw)
  To: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier
  Cc: linux-kernel, linux-modules, linux-kbuild, Alexey Gladkov,
	Heiko Carstens, Vasily Gorbik, Alexander Gordeev, linux-s390,
	kernel test robot
In-Reply-To: <cover.1753354215.git.legion@kernel.org>

Reorder the sections to be placed in the default segment. The
.vmlinux.info use :NONE to override the default segment and tell the
linker to not put the section in any segment at all.

>> s390x-linux-ld: .tmp_vmlinux1: warning: allocated section `.modinfo' not in segment
>> s390x-linux-ld: .tmp_vmlinux2: warning: allocated section `.modinfo' not in segment
>> s390x-linux-ld: vmlinux.unstripped: warning: allocated section `.modinfo' not in segment

Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: linux-s390@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506062053.zbkFBEnJ-lkp@intel.com/
Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
 arch/s390/kernel/vmlinux.lds.S | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index ff1ddba96352..3f2f90e38808 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -202,6 +202,11 @@ SECTIONS
 	. = ALIGN(PAGE_SIZE);
 	_end = . ;
 
+	/* Debugging sections.	*/
+	STABS_DEBUG
+	DWARF_DEBUG
+	ELF_DETAILS
+
 	/*
 	 * uncompressed image info used by the decompressor
 	 * it should match struct vmlinux_info
@@ -232,11 +237,6 @@ SECTIONS
 #endif
 	} :NONE
 
-	/* Debugging sections.	*/
-	STABS_DEBUG
-	DWARF_DEBUG
-	ELF_DETAILS
-
 	/*
 	 * Make sure that the .got.plt is either completely empty or it
 	 * contains only the three reserved double words.
-- 
2.50.1


^ permalink raw reply related

* [PATCH v5 09/10] kbuild: vmlinux.unstripped should always depend on .vmlinux.export.o
From: Alexey Gladkov @ 2025-07-24 13:49 UTC (permalink / raw)
  To: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier
  Cc: linux-kernel, linux-modules, linux-kbuild, Alexey Gladkov
In-Reply-To: <cover.1753354215.git.legion@kernel.org>

Since .vmlinux.export.c is used to add generated by modpost modaliases
for builtin modules the .vmlinux.export.o is no longer optional and
should always be created. The generation of this file is not dependent
on CONFIG_MODULES.

Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
 scripts/Makefile.vmlinux | 9 ++-------
 scripts/link-vmlinux.sh  | 5 +----
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
index fcc188d26ead..dbbe3bf0cf23 100644
--- a/scripts/Makefile.vmlinux
+++ b/scripts/Makefile.vmlinux
@@ -53,11 +53,6 @@ endif
 # vmlinux.unstripped
 # ---------------------------------------------------------------------------
 
-ifdef CONFIG_MODULES
-targets += .vmlinux.export.o
-vmlinux.unstripped: .vmlinux.export.o
-endif
-
 ifdef CONFIG_ARCH_WANTS_PRE_LINK_VMLINUX
 vmlinux.unstripped: arch/$(SRCARCH)/tools/vmlinux.arch.o
 
@@ -72,8 +67,8 @@ cmd_link_vmlinux =							\
 	$< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)" "$@";	\
 	$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
 
-targets += vmlinux.unstripped
-vmlinux.unstripped: scripts/link-vmlinux.sh vmlinux.o $(KBUILD_LDS) FORCE
+targets += vmlinux.unstripped .vmlinux.export.o
+vmlinux.unstripped: scripts/link-vmlinux.sh vmlinux.o .vmlinux.export.o $(KBUILD_LDS) FORCE
 	+$(call if_changed_dep,link_vmlinux)
 ifdef CONFIG_DEBUG_INFO_BTF
 vmlinux.unstripped: $(RESOLVE_BTFIDS)
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 51367c2bfc21..433849ff7529 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -73,10 +73,7 @@ vmlinux_link()
 		objs="${objs} .builtin-dtbs.o"
 	fi
 
-	if is_enabled CONFIG_MODULES; then
-		objs="${objs} .vmlinux.export.o"
-	fi
-
+	objs="${objs} .vmlinux.export.o"
 	objs="${objs} init/version-timestamp.o"
 
 	if [ "${SRCARCH}" = "um" ]; then
-- 
2.50.1


^ permalink raw reply related

* [PATCH v5 08/10] modpost: Create modalias for builtin modules
From: Alexey Gladkov @ 2025-07-24 13:49 UTC (permalink / raw)
  To: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier
  Cc: linux-kernel, linux-modules, linux-kbuild, Alexey Gladkov
In-Reply-To: <cover.1753354215.git.legion@kernel.org>

For some modules, modalias is generated using the modpost utility and
the section is added to the module file.

When a module is added inside vmlinux, modpost does not generate
modalias for such modules and the information is lost.

As a result kmod (which uses modules.builtin.modinfo in userspace)
cannot determine that modalias is handled by a builtin kernel module.

$ cat /sys/devices/pci0000:00/0000:00:14.0/modalias
pci:v00008086d0000A36Dsv00001043sd00008694bc0Csc03i30

$ modinfo xhci_pci
name:           xhci_pci
filename:       (builtin)
license:        GPL
file:           drivers/usb/host/xhci-pci
description:    xHCI PCI Host Controller Driver

Missing modalias "pci:v*d*sv*sd*bc0Csc03i30*" which will be generated by
modpost if the module is built separately.

To fix this it is necessary to generate the same modalias for vmlinux as
for the individual modules. Fortunately '.vmlinux.export.o' is already
generated from which '.modinfo' can be extracted in the same way as for
vmlinux.o.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
 include/linux/module.h   |  4 ----
 scripts/Makefile.vmlinux |  5 ++++-
 scripts/mksysmap         |  3 +++
 scripts/mod/file2alias.c | 16 ++++++++++++++++
 scripts/mod/modpost.c    | 17 ++++++++++++++++-
 scripts/mod/modpost.h    |  2 ++
 6 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index 32e98200b2f4..9a8b359a1016 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -255,14 +255,10 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
 	__PASTE(type,			\
 	__PASTE(__, name)))))
 
-#ifdef MODULE
 /* Creates an alias so file2alias.c can find device table. */
 #define MODULE_DEVICE_TABLE(type, name)					\
 static typeof(name) __mod_device_table(type, name)			\
   __attribute__ ((used, alias(__stringify(name))))
-#else  /* !MODULE */
-#define MODULE_DEVICE_TABLE(type, name)
-#endif
 
 /* Version of form [<epoch>:]<version>[-<extra-version>].
  * Or for CVS/RCS ID version, everything but the number is stripped.
diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
index fdab5aa90215..fcc188d26ead 100644
--- a/scripts/Makefile.vmlinux
+++ b/scripts/Makefile.vmlinux
@@ -89,8 +89,11 @@ endif
 remove-section-y                                   := .modinfo
 remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel*'
 
+remove-symbols := -w --strip-symbol='__mod_device_table__*'
+
 quiet_cmd_strip_relocs = OBJCOPY $@
-      cmd_strip_relocs = $(OBJCOPY) $(addprefix --remove-section=,$(remove-section-y)) $< $@
+      cmd_strip_relocs = $(OBJCOPY) $(addprefix --remove-section=,$(remove-section-y)) \
+                         $(remove-symbols) $< $@
 
 targets += vmlinux
 vmlinux: vmlinux.unstripped FORCE
diff --git a/scripts/mksysmap b/scripts/mksysmap
index a607a0059d11..c4531eacde20 100755
--- a/scripts/mksysmap
+++ b/scripts/mksysmap
@@ -59,6 +59,9 @@
 # EXPORT_SYMBOL (namespace)
 / __kstrtabns_/d
 
+# MODULE_DEVICE_TABLE (symbol name)
+/ __mod_device_table__/d
+
 # ---------------------------------------------------------------------------
 # Ignored suffixes
 #  (do not forget '$' after each pattern)
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 13021266a18f..7da9735e7ab3 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1527,5 +1527,21 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
 		}
 	}
 
+	if (mod->is_vmlinux) {
+		struct module_alias *alias;
+
+		/*
+		 * If this is vmlinux, record the name of the builtin module.
+		 * Traverse the linked list in the reverse order, and set the
+		 * builtin_modname unless it has already been set in the
+		 * previous call.
+		 */
+		list_for_each_entry_reverse(alias, &mod->aliases, node) {
+			if (alias->builtin_modname)
+				break;
+			alias->builtin_modname = xstrndup(modname, modnamelen);
+		}
+	}
+
 	free(zeros);
 }
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 5ca7c268294e..67f9cd76bdd2 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2067,11 +2067,26 @@ static void write_if_changed(struct buffer *b, const char *fname)
 static void write_vmlinux_export_c_file(struct module *mod)
 {
 	struct buffer buf = { };
+	struct module_alias *alias, *next;
 
 	buf_printf(&buf,
-		   "#include <linux/export-internal.h>\n");
+		   "#include <linux/export-internal.h>\n"
+		   "#include <linux/module.h>\n");
 
 	add_exported_symbols(&buf, mod);
+
+	buf_printf(&buf,
+		   "#undef __MODULE_INFO_PREFIX\n"
+		   "#define __MODULE_INFO_PREFIX\n");
+
+	list_for_each_entry_safe(alias, next, &mod->aliases, node) {
+		buf_printf(&buf, "MODULE_INFO(%s.alias, \"%s\");\n",
+			   alias->builtin_modname, alias->str);
+		list_del(&alias->node);
+		free(alias->builtin_modname);
+		free(alias);
+	}
+
 	write_if_changed(&buf, ".vmlinux.export.c");
 	free(buf.p);
 }
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
index 9133e4c3803f..2aecb8f25c87 100644
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -99,10 +99,12 @@ buf_write(struct buffer *buf, const char *s, int len);
  * struct module_alias - auto-generated MODULE_ALIAS()
  *
  * @node: linked to module::aliases
+ * @modname: name of the builtin module (only for vmlinux)
  * @str: a string for MODULE_ALIAS()
  */
 struct module_alias {
 	struct list_head node;
+	char *builtin_modname;
 	char str[];
 };
 
-- 
2.50.1


^ permalink raw reply related

* [PATCH v5 07/10] modpost: Add modname to mod_device_table alias
From: Alexey Gladkov @ 2025-07-24 13:49 UTC (permalink / raw)
  To: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier
  Cc: linux-kernel, linux-modules, linux-kbuild, Alexey Gladkov,
	Miguel Ojeda, Alex Gaynor, rust-for-linux
In-Reply-To: <cover.1753354215.git.legion@kernel.org>

At this point, if a symbol is compiled as part of the kernel,
information about which module the symbol belongs to is lost.

To save this it is possible to add the module name to the alias name.
It's not very pretty, but it's possible for now.

Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Alex Gaynor <alex.gaynor@gmail.com>
Cc: rust-for-linux@vger.kernel.org
Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
 include/linux/module.h   | 14 +++++++++++++-
 rust/kernel/device_id.rs |  8 ++++----
 scripts/mod/file2alias.c | 18 ++++++++++++++----
 3 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index 4689852d7b18..32e98200b2f4 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -243,10 +243,22 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
 /* What your module does. */
 #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
 
+/*
+ * Format: __mod_device_table__kmod_<modname>__<type>__<name>
+ * Parts of the string `__kmod_` and `__` are used as delimiters when parsing
+ * a symbol in file2alias.c
+ */
+#define __mod_device_table(type, name)	\
+	__PASTE(__mod_device_table__,	\
+	__PASTE(__KBUILD_MODNAME,	\
+	__PASTE(__,			\
+	__PASTE(type,			\
+	__PASTE(__, name)))))
+
 #ifdef MODULE
 /* Creates an alias so file2alias.c can find device table. */
 #define MODULE_DEVICE_TABLE(type, name)					\
-static typeof(name) __mod_device_table__##type##__##name		\
+static typeof(name) __mod_device_table(type, name)			\
   __attribute__ ((used, alias(__stringify(name))))
 #else  /* !MODULE */
 #define MODULE_DEVICE_TABLE(type, name)
diff --git a/rust/kernel/device_id.rs b/rust/kernel/device_id.rs
index 0a4eb56d98f2..365d8f544844 100644
--- a/rust/kernel/device_id.rs
+++ b/rust/kernel/device_id.rs
@@ -154,10 +154,10 @@ macro_rules! module_device_table {
     ($table_type: literal, $module_table_name:ident, $table_name:ident) => {
         #[rustfmt::skip]
         #[export_name =
-            concat!("__mod_device_table__", $table_type,
-                    "__", module_path!(),
-                    "_", line!(),
-                    "_", stringify!($table_name))
+            concat!("__mod_device_table__", line!(),
+                    "__kmod_", module_path!(),
+                    "__", $table_type,
+                    "__", stringify!($table_name))
         ]
         static $module_table_name: [::core::mem::MaybeUninit<u8>; $table_name.raw_ids().size()] =
             unsafe { ::core::mem::transmute_copy($table_name.raw_ids()) };
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 00586119a25b..13021266a18f 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1476,8 +1476,8 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
 {
 	void *symval;
 	char *zeros = NULL;
-	const char *type, *name;
-	size_t typelen;
+	const char *type, *name, *modname;
+	size_t typelen, modnamelen;
 	static const char *prefix = "__mod_device_table__";
 
 	/* We're looking for a section relative symbol */
@@ -1488,10 +1488,20 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
 	if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT)
 		return;
 
-	/* All our symbols are of form __mod_device_table__<type>__<name>. */
+	/* All our symbols are of form __mod_device_table__kmod_<modname>__<type>__<name>. */
 	if (!strstarts(symname, prefix))
 		return;
-	type = symname + strlen(prefix);
+
+	modname = strstr(symname, "__kmod_");
+	if (!modname)
+		return;
+	modname += strlen("__kmod_");
+
+	type = strstr(modname, "__");
+	if (!type)
+		return;
+	modnamelen = type - modname;
+	type += strlen("__");
 
 	name = strstr(type, "__");
 	if (!name)
-- 
2.50.1


^ permalink raw reply related

* [PATCH v5 06/10] pinctrl: meson: Fix typo in device table macro
From: Alexey Gladkov @ 2025-07-24 13:49 UTC (permalink / raw)
  To: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier
  Cc: linux-kernel, linux-modules, linux-kbuild, Alexey Gladkov,
	Xianwei Zhao, Linus Walleij, Neil Armstrong, Kevin Hilman,
	linux-amlogic, linux-gpio, kernel test robot
In-Reply-To: <cover.1753354215.git.legion@kernel.org>

The typo when using the MODULE_DEVICE_TABLE macro was not noticeable
because the macro was defined only if the module was built as a separate
module.

Cc: Xianwei Zhao <xianwei.zhao@amlogic.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: linux-amlogic@lists.infradead.org
Cc: linux-gpio@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507220009.8HKbNP16-lkp@intel.com/
Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
 drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
index 385cc619df13..95525e66e5c0 100644
--- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
+++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
@@ -1023,7 +1023,7 @@ static const struct of_device_id aml_pctl_of_match[] = {
 	{ .compatible = "amlogic,pinctrl-a4", },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, aml_pctl_dt_match);
+MODULE_DEVICE_TABLE(of, aml_pctl_of_match);
 
 static struct platform_driver aml_pctl_driver = {
 	.driver = {
-- 
2.50.1


^ permalink raw reply related

* [PATCH v5 05/10] scsi: Always define blogic_pci_tbl structure
From: Alexey Gladkov @ 2025-07-24 13:49 UTC (permalink / raw)
  To: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier
  Cc: linux-kernel, linux-modules, linux-kbuild, Alexey Gladkov,
	Khalid Aziz, Martin K. Petersen, linux-scsi, James Bottomley
In-Reply-To: <cover.1753354215.git.legion@kernel.org>

The blogic_pci_tbl structure is used by the MODULE_DEVICE_TABLE macro.
There is no longer a need to protect it with the MODULE condition, since
this no longer causes the compiler to warn about an unused variable.

Cc: Khalid Aziz <khalid@gonehiking.org>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Suggested-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
 drivers/scsi/BusLogic.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index 1f100270cd38..08e12a3d6703 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -3715,7 +3715,6 @@ static void __exit blogic_exit(void)
 
 __setup("BusLogic=", blogic_setup);
 
-#ifdef MODULE
 /*static const struct pci_device_id blogic_pci_tbl[] = {
 	{ PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
@@ -3731,7 +3730,6 @@ static const struct pci_device_id blogic_pci_tbl[] = {
 	{PCI_DEVICE(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT)},
 	{0, },
 };
-#endif
 MODULE_DEVICE_TABLE(pci, blogic_pci_tbl);
 
 module_init(blogic_init);
-- 
2.50.1


^ permalink raw reply related

* [PATCH v5 04/10] kbuild: extract modules.builtin.modinfo from vmlinux.unstripped
From: Alexey Gladkov @ 2025-07-24 13:49 UTC (permalink / raw)
  To: Masahiro Yamada, Petr Pavlu, Luis Chamberlain, Sami Tolvanen,
	Daniel Gomez, Nathan Chancellor, Nicolas Schier
  Cc: linux-kernel, linux-modules, linux-kbuild, Alexey Gladkov
In-Reply-To: <cover.1753354215.git.legion@kernel.org>

From: Masahiro Yamada <masahiroy@kernel.org>

Currently, we assume all the data for modules.builtin.modinfo are
available in vmlinux.o.

This makes it impossible for modpost, which is invoked after vmlinux.o,
to add additional module info.

This commit moves the modules.builtin.modinfo rule after modpost.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
 scripts/Makefile.vmlinux   | 26 ++++++++++++++++++++++++++
 scripts/Makefile.vmlinux_o | 26 +-------------------------
 2 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
index e2ceeb9e168d..fdab5aa90215 100644
--- a/scripts/Makefile.vmlinux
+++ b/scripts/Makefile.vmlinux
@@ -96,6 +96,32 @@ targets += vmlinux
 vmlinux: vmlinux.unstripped FORCE
 	$(call if_changed,strip_relocs)
 
+# modules.builtin.modinfo
+# ---------------------------------------------------------------------------
+
+OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary
+
+targets += modules.builtin.modinfo
+modules.builtin.modinfo: vmlinux.unstripped FORCE
+	$(call if_changed,objcopy)
+
+# modules.builtin
+# ---------------------------------------------------------------------------
+
+__default: modules.builtin
+
+# The second line aids cases where multiple modules share the same object.
+
+quiet_cmd_modules_builtin = GEN     $@
+      cmd_modules_builtin = \
+	tr '\0' '\n' < $< | \
+	sed -n 's/^[[:alnum:]:_]*\.file=//p' | \
+	tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$$/.ko/' > $@
+
+targets += modules.builtin
+modules.builtin: modules.builtin.modinfo FORCE
+	$(call if_changed,modules_builtin)
+
 # modules.builtin.ranges
 # ---------------------------------------------------------------------------
 ifdef CONFIG_BUILTIN_MODULE_RANGES
diff --git a/scripts/Makefile.vmlinux_o b/scripts/Makefile.vmlinux_o
index b024ffb3e201..23c8751285d7 100644
--- a/scripts/Makefile.vmlinux_o
+++ b/scripts/Makefile.vmlinux_o
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
 PHONY := __default
-__default: vmlinux.o modules.builtin.modinfo modules.builtin
+__default: vmlinux.o
 
 include include/config/auto.conf
 include $(srctree)/scripts/Kbuild.include
@@ -73,30 +73,6 @@ vmlinux.o: $(initcalls-lds) vmlinux.a $(KBUILD_VMLINUX_LIBS) FORCE
 
 targets += vmlinux.o
 
-# modules.builtin.modinfo
-# ---------------------------------------------------------------------------
-
-OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary
-
-targets += modules.builtin.modinfo
-modules.builtin.modinfo: vmlinux.o FORCE
-	$(call if_changed,objcopy)
-
-# modules.builtin
-# ---------------------------------------------------------------------------
-
-# The second line aids cases where multiple modules share the same object.
-
-quiet_cmd_modules_builtin = GEN     $@
-      cmd_modules_builtin = \
-	tr '\0' '\n' < $< | \
-	sed -n 's/^[[:alnum:]:_]*\.file=//p' | \
-	tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$$/.ko/' > $@
-
-targets += modules.builtin
-modules.builtin: modules.builtin.modinfo FORCE
-	$(call if_changed,modules_builtin)
-
 # Add FORCE to the prerequisites of a target to force it to be always rebuilt.
 # ---------------------------------------------------------------------------
 
-- 
2.50.1


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox