[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <FF2ED6EB-3080-4C9C-AF4B-A95EC8C8DF82@linux.ibm.com>
Date: Wed, 22 Oct 2025 20:02:16 +0530
From: Venkat <venkat88@...ux.ibm.com>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: x86@...nel.org, LKML <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>,
Alexander Stein <alexander.stein@...tq-group.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Mark Brown <broonie@...nel.org>,
Cosmin Tanislav <demonsingur@...il.com>
Subject: Re: [PATCH] module: Fix device table module aliases
> On 20 Oct 2025, at 11:23 PM, Josh Poimboeuf <jpoimboe@...nel.org> wrote:
>
> Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
> __KBUILD_MODNAME") inadvertently broke module alias generation for
> modules which rely on MODULE_DEVICE_TABLE().
>
> It removed the "kmod_" prefix from __KBUILD_MODNAME, which caused
> MODULE_DEVICE_TABLE() to generate a symbol name which no longer matched
> the format expected by handle_moddevtable() in scripts/mod/file2alias.c.
>
> As a result, modpost failed to find the device tables, leading to
> missing module aliases.
>
> Fix this by explicitly adding the "kmod_" string within the
> MODULE_DEVICE_TABLE() macro itself, restoring the symbol name to the
> format expected by file2alias.c.
IBM CI has also encountered this issue. I have tested this patch and it fixes the same.
Report link: https://lore.kernel.org/all/cdf7c458-b28f-4657-8708-1f820369baa6@linux.ibm.com/
Please add below tags.
Reported-by: Venkat Rao Bagalkote <venkat88@...ux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@...ux.ibm.com>
Regards,
Venkat.
> Fixes: 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME")
> Reported-by: Alexander Stein <alexander.stein@...tq-group.com>
> Reported-by: Marek Szyprowski <m.szyprowski@...sung.com>
> Reported-by: Mark Brown <broonie@...nel.org>
> Reported-by: Cosmin Tanislav <demonsingur@...il.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
> ---
> include/linux/module.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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) \
> --
> 2.51.0
>
Powered by blists - more mailing lists