[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ycrgjcczkgt6morojzfpkjyg4ehrm5ova2hzzxy2dxv23hhyre@nf5bltmr4lxm>
Date: Mon, 20 Oct 2025 10:22:35 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: Alexander Stein <alexander.stein@...tq-group.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Petr Mladek <pmladek@...e.com>, Miroslav Benes <mbenes@...e.cz>,
Joe Lawrence <joe.lawrence@...hat.com>, live-patching@...r.kernel.org, Song Liu <song@...nel.org>,
laokz <laokz@...mail.com>, Jiri Kosina <jikos@...nel.org>,
Marcos Paulo de Souza <mpdesouza@...e.com>, Weinan Liu <wnliu@...gle.com>,
Fazla Mehrab <a.mehrab@...edance.com>, Chen Zhongjin <chenzhongjin@...wei.com>,
Puranjay Mohan <puranjay@...nel.org>, Dylan Hatch <dylanbhatch@...gle.com>,
Peter Zijlstra <peterz@...radead.org>, Masahiro Yamada <masahiroy@...nel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>, Mark Brown <broonie@...nel.org>,
Cosmin Tanislav <demonsingur@...il.com>
Subject: Re: [PATCH v4 08/63] kbuild: Remove 'kmod_' prefix from
__KBUILD_MODNAME
On Mon, Oct 20, 2025 at 02:20:35PM +0200, Alexander Stein wrote:
> Hi,
>
> Am Mittwoch, 17. September 2025, 18:03:16 CEST schrieb Josh Poimboeuf:
> > In preparation for the objtool klp diff subcommand, remove the arbitrary
> > 'kmod_' prefix from __KBUILD_MODNAME and instead add it explicitly in
> > the __initcall_id() macro.
> >
> > This change supports the standardization of "unique" symbol naming by
> > ensuring the non-unique portion of the name comes before the unique
> > part. That will enable objtool to properly correlate symbols across
> > builds.
> >
> > Cc: Masahiro Yamada <masahiroy@...nel.org>
> > Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
>
> Starting with this commit 6717e8f91db71 ("kbuild: Remove 'kmod_' prefix
> from __KBUILD_MODNAME") in next-20251020 I don't get any
> module aliases anymore.
> modinfo spi-fsl-dspi.ko returns:
> > filename: /work/repo/linux/build_arm64/drivers/spi/spi-fsl-dspi.ko
> > alias: platform:fsl-dspi
> > license: GPL
> > description: Freescale DSPI Controller Driver
> > depends:
> > intree: Y
> > name: spi_fsl_dspi
> > vermagic: 6.18.0-rc1+ SMP preempt mod_unload modversions aarch64
>
> but it should be like this:
> > filename: /work/repo/linux/build_arm64/drivers/spi/spi-fsl-dspi.ko
> > alias: platform:fsl-dspi
> > license: GPL
> > description: Freescale DSPI Controller Driver
> > alias: of:N*T*Cnxp,s32g2-dspiC*
Thanks, this patch broke the MODULE_DEVICE_TABLE() macro, as it no
longer produces the format expected by scripts/mod/file2alias.c.
I didn't see this in x86 testing since it doesn't have device tree.
I will post the following fix shortly:
diff --git a/include/linux/module.h b/include/linux/module.h
index e135cc79aceea..d80c3ea574726 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -251,10 +251,11 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
*/
#define __mod_device_table(type, name) \
__PASTE(__mod_device_table__, \
+ __PASTE(kmod_, \
__PASTE(__KBUILD_MODNAME, \
__PASTE(__, \
__PASTE(type, \
- __PASTE(__, name)))))
+ __PASTE(__, name))))))
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name) \
Powered by blists - more mailing lists