linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] kbuild: two minor updates for Documentation/kbuild/modules.rst
@ 2019-10-03 10:29 Masahiro Yamada
  2019-10-03 10:29 ` [PATCH 2/4] modpost: do not parse vmlinux for external module builds Masahiro Yamada
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Masahiro Yamada @ 2019-10-03 10:29 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Masahiro Yamada, Jonathan Corbet, Michal Marek,
	linux-doc, linux-kernel

Capitalize the first word in the sentence.

Use obj-m instead of obj-y. obj-y still works, but we have no built-in
objects in external module builds. So, obj-m is better IMHO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Documentation/kbuild/modules.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/kbuild/modules.rst b/Documentation/kbuild/modules.rst
index d2ae799237fd..dd1d2a0688e8 100644
--- a/Documentation/kbuild/modules.rst
+++ b/Documentation/kbuild/modules.rst
@@ -501,7 +501,7 @@ build.
 --- 6.3 Symbols From Another External Module
 
 	Sometimes, an external module uses exported symbols from
-	another external module. kbuild needs to have full knowledge of
+	another external module. Kbuild needs to have full knowledge of
 	all symbols to avoid spitting out warnings about undefined
 	symbols. Three solutions exist for this situation.
 
@@ -521,7 +521,7 @@ build.
 		The top-level kbuild file would then look like::
 
 			#./Kbuild (or ./Makefile):
-				obj-y := foo/ bar/
+				obj-m := foo/ bar/
 
 		And executing::
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/4] modpost: do not parse vmlinux for external module builds
  2019-10-03 10:29 [PATCH 1/4] kbuild: two minor updates for Documentation/kbuild/modules.rst Masahiro Yamada
@ 2019-10-03 10:29 ` Masahiro Yamada
  2019-10-03 10:29 ` [PATCH 3/4] kbuild: do not read $(KBUILD_EXTMOD)/Module.symvers Masahiro Yamada
  2019-10-03 10:29 ` [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers Masahiro Yamada
  2 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2019-10-03 10:29 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Sam Ravnborg, Masahiro Yamada, Michal Marek, linux-kernel

When building external modules, $(objtree)/Module.symvers is scanned
for symbol information of vmlinux and in-tree modules.

Additionally, vmlinux is parsed if it exists in $(objtree)/.
This is totally redundant since all the necessary information is
contained in $(objtree)/Module.symvers.

Do not parse vmlinux at all for external module builds. This makes
sense because vmlinux is deleted by 'make clean'.

'make clean' leaves all the build artifacts for building external
modules. vmlinux is unneeded for that.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Makefile.modpost | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 952fff485546..72109d201196 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -67,8 +67,12 @@ __modpost:
 
 else
 
+MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T -
+
+ifeq ($(KBUILD_EXTMOD),)
+MODPOST += $(wildcard vmlinux)
+else
 # When building external modules load the Kbuild file to retrieve EXTRA_SYMBOLS info
-ifneq ($(KBUILD_EXTMOD),)
 
 # set src + obj - they may be used when building the .mod.c file
 obj := $(KBUILD_EXTMOD)
@@ -79,8 +83,6 @@ include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \
              $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile)
 endif
 
-MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - $(wildcard vmlinux)
-
 # find all modules listed in modules.order
 modules := $(sort $(shell cat $(MODORDER)))
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/4] kbuild: do not read $(KBUILD_EXTMOD)/Module.symvers
  2019-10-03 10:29 [PATCH 1/4] kbuild: two minor updates for Documentation/kbuild/modules.rst Masahiro Yamada
  2019-10-03 10:29 ` [PATCH 2/4] modpost: do not parse vmlinux for external module builds Masahiro Yamada
@ 2019-10-03 10:29 ` Masahiro Yamada
  2019-10-03 10:29 ` [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers Masahiro Yamada
  2 siblings, 0 replies; 10+ messages in thread
From: Masahiro Yamada @ 2019-10-03 10:29 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Masahiro Yamada, Jonathan Corbet, Michal Marek,
	linux-doc, linux-kernel

Since commit 040fcc819a2e ("kbuild: improved modversioning support for
external modules"), the external module build reads Module.symvers in
the directory of the module itself, then dumps symbols back into it.
It accumulates stale symbols in the file when you build an external
module incrementally.

The idea behind it was, as the commit log explained, you can copy
Modules.symvers from one module to another when you need to pass symbol
information between two modules. However, the manual copy of the file
sounds questionable to me, and containing stale symbols is a downside.

Some time later, commit 0d96fb20b7ed ("kbuild: Add new Kbuild variable
KBUILD_EXTRA_SYMBOLS") introduced a saner approach.

So, this commit removes the former one. Going forward, the external
module build dumps symbols into Module.symvers to be carried via
KBUILD_EXTRA_SYMBOLS, but never reads it automatically.

With the -I option removed, there is no one to set the external_module
flag unless KBUILD_EXTRA_SYMBOLS is passed. Now the -i option does it
instead.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Documentation/kbuild/modules.rst | 13 +++++--------
 scripts/Makefile.modpost         |  1 -
 scripts/mod/modpost.c            |  9 ++-------
 3 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/Documentation/kbuild/modules.rst b/Documentation/kbuild/modules.rst
index dd1d2a0688e8..4c74f683bb2b 100644
--- a/Documentation/kbuild/modules.rst
+++ b/Documentation/kbuild/modules.rst
@@ -492,18 +492,15 @@ build.
 	to the symbols from the kernel to check if all external symbols
 	are defined. This is done in the MODPOST step. modpost obtains
 	the symbols by reading Module.symvers from the kernel source
-	tree. If a Module.symvers file is present in the directory
-	where the external module is being built, this file will be
-	read too. During the MODPOST step, a new Module.symvers file
-	will be written containing all exported symbols that were not
-	defined in the kernel.
+	tree. During the MODPOST step, a new Module.symvers file will be
+	written containing all exported symbols from that external module.
 
 --- 6.3 Symbols From Another External Module
 
 	Sometimes, an external module uses exported symbols from
 	another external module. Kbuild needs to have full knowledge of
 	all symbols to avoid spitting out warnings about undefined
-	symbols. Three solutions exist for this situation.
+	symbols. Two solutions exist for this situation.
 
 	NOTE: The method with a top-level kbuild file is recommended
 	but may be impractical in certain situations.
@@ -543,8 +540,8 @@ build.
 		all symbols defined and not part of the kernel.
 
 	Use "make" variable KBUILD_EXTRA_SYMBOLS
-		If it is impractical to copy Module.symvers from
-		another module, you can assign a space separated list
+		If it is impractical to add a top-level kbuild file,
+		you can assign a space separated list
 		of files to KBUILD_EXTRA_SYMBOLS in your build file.
 		These files will be loaded by modpost during the
 		initialization of its symbol tables.
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 72109d201196..01c0a992d293 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -50,7 +50,6 @@ MODPOST = scripts/mod/modpost						\
 	$(if $(CONFIG_MODVERSIONS),-m)					\
 	$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a)			\
 	$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile)			\
-	$(if $(KBUILD_EXTMOD),-I $(modulesymfile))			\
 	$(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS)))	\
 	$(if $(KBUILD_EXTMOD),-o $(modulesymfile))			\
 	$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E)			\
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 936d3ad23c83..5234555cf550 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2540,7 +2540,7 @@ int main(int argc, char **argv)
 {
 	struct module *mod;
 	struct buffer buf = { };
-	char *kernel_read = NULL, *module_read = NULL;
+	char *kernel_read = NULL;
 	char *dump_write = NULL, *files_source = NULL;
 	int opt;
 	int err;
@@ -2548,13 +2548,10 @@ int main(int argc, char **argv)
 	struct ext_sym_list *extsym_iter;
 	struct ext_sym_list *extsym_start = NULL;
 
-	while ((opt = getopt(argc, argv, "i:I:e:mnsT:o:awEd")) != -1) {
+	while ((opt = getopt(argc, argv, "i:e:mnsT:o:awEd")) != -1) {
 		switch (opt) {
 		case 'i':
 			kernel_read = optarg;
-			break;
-		case 'I':
-			module_read = optarg;
 			external_module = 1;
 			break;
 		case 'e':
@@ -2599,8 +2596,6 @@ int main(int argc, char **argv)
 
 	if (kernel_read)
 		read_dump(kernel_read, 1);
-	if (module_read)
-		read_dump(module_read, 0);
 	while (extsym_start) {
 		read_dump(extsym_start->file, 0);
 		extsym_iter = extsym_start->next;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers
  2019-10-03 10:29 [PATCH 1/4] kbuild: two minor updates for Documentation/kbuild/modules.rst Masahiro Yamada
  2019-10-03 10:29 ` [PATCH 2/4] modpost: do not parse vmlinux for external module builds Masahiro Yamada
  2019-10-03 10:29 ` [PATCH 3/4] kbuild: do not read $(KBUILD_EXTMOD)/Module.symvers Masahiro Yamada
@ 2019-10-03 10:29 ` Masahiro Yamada
  2019-10-31 16:51   ` Jeff Moyer
  2 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2019-10-03 10:29 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Sam Ravnborg, Masahiro Yamada, Michal Marek, linux-kernel

Now that there is no overwrap between symbols from ELF files and
ones from Module.symvers.

So, the 'exported twice' warning should be reported irrespective
of where the symbol in question came from. Only the exceptional case
is when __crc_<sym> symbol appears before __ksymtab_<sym>. This
typically occurs for EXPORT_SYMBOL in .S files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/mod/modpost.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 5234555cf550..6ca38d10efc5 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2457,7 +2457,6 @@ static void read_dump(const char *fname, unsigned int kernel)
 		s = sym_add_exported(symname, namespace, mod,
 				     export_no(export));
 		s->kernel    = kernel;
-		s->preloaded = 1;
 		s->is_static = 0;
 		sym_update_crc(symname, mod, crc, export_no(export));
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers
  2019-10-03 10:29 ` [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers Masahiro Yamada
@ 2019-10-31 16:51   ` Jeff Moyer
  2019-11-01  1:13     ` Masahiro Yamada
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Moyer @ 2019-10-31 16:51 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Sam Ravnborg, Michal Marek, linux-kernel,
	dan.j.williams, linux-nvdimm

Masahiro Yamada <yamada.masahiro@socionext.com> writes:

> Now that there is no overwrap between symbols from ELF files and
> ones from Module.symvers.
>
> So, the 'exported twice' warning should be reported irrespective
> of where the symbol in question came from. Only the exceptional case
> is when __crc_<sym> symbol appears before __ksymtab_<sym>. This
> typically occurs for EXPORT_SYMBOL in .S files.

Hi, Masahiro,

After apply this patch, I get the following modpost warnings when doing:

$ make M=tools/tesing/nvdimm
...
  Building modules, stage 2.
  MODPOST 12 modules
WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_lock' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_unlock' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
WARNING: tools/testing/nvdimm/libnvdimm: 'is_nvdimm_bus_locked' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
WARNING: tools/testing/nvdimm/libnvdimm: 'devm_nvdimm_memremap' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
WARNING: tools/testing/nvdimm/libnvdimm: 'nd_fletcher64' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
WARNING: tools/testing/nvdimm/libnvdimm: 'to_nd_desc' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
WARNING: tools/testing/nvdimm/libnvdimm: 'to_nvdimm_bus_dev' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
...

There are a lot of these warnings.  :)  If I revert this patch, no
complaints.

Cheers,
Jeff


>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  scripts/mod/modpost.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 5234555cf550..6ca38d10efc5 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -2457,7 +2457,6 @@ static void read_dump(const char *fname, unsigned int kernel)
>  		s = sym_add_exported(symname, namespace, mod,
>  				     export_no(export));
>  		s->kernel    = kernel;
> -		s->preloaded = 1;
>  		s->is_static = 0;
>  		sym_update_crc(symname, mod, crc, export_no(export));
>  	}


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers
  2019-10-31 16:51   ` Jeff Moyer
@ 2019-11-01  1:13     ` Masahiro Yamada
  2019-11-01 18:52       ` Jeff Moyer
  0 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2019-11-01  1:13 UTC (permalink / raw)
  To: Jeff Moyer
  Cc: Linux Kbuild mailing list, Sam Ravnborg, Michal Marek,
	Linux Kernel Mailing List, Dan Williams, linux-nvdimm

On Fri, Nov 1, 2019 at 1:51 AM Jeff Moyer <jmoyer@redhat.com> wrote:
>
> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
>
> > Now that there is no overwrap between symbols from ELF files and
> > ones from Module.symvers.
> >
> > So, the 'exported twice' warning should be reported irrespective
> > of where the symbol in question came from. Only the exceptional case
> > is when __crc_<sym> symbol appears before __ksymtab_<sym>. This
> > typically occurs for EXPORT_SYMBOL in .S files.
>
> Hi, Masahiro,
>
> After apply this patch, I get the following modpost warnings when doing:
>
> $ make M=tools/tesing/nvdimm
> ...
>   Building modules, stage 2.
>   MODPOST 12 modules
> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_lock' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_unlock' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> WARNING: tools/testing/nvdimm/libnvdimm: 'is_nvdimm_bus_locked' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> WARNING: tools/testing/nvdimm/libnvdimm: 'devm_nvdimm_memremap' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> WARNING: tools/testing/nvdimm/libnvdimm: 'nd_fletcher64' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nd_desc' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nvdimm_bus_dev' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> ...
>
> There are a lot of these warnings.  :)

These warnings are correct since
drivers/nvdimm/Makefile and
tools/testing/nvdimm/Kbuild
compile the same files.




>  If I revert this patch, no
> complaints.
>
> Cheers,
> Jeff
>
>
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> >  scripts/mod/modpost.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> > index 5234555cf550..6ca38d10efc5 100644
> > --- a/scripts/mod/modpost.c
> > +++ b/scripts/mod/modpost.c
> > @@ -2457,7 +2457,6 @@ static void read_dump(const char *fname, unsigned int kernel)
> >               s = sym_add_exported(symname, namespace, mod,
> >                                    export_no(export));
> >               s->kernel    = kernel;
> > -             s->preloaded = 1;
> >               s->is_static = 0;
> >               sym_update_crc(symname, mod, crc, export_no(export));
> >       }
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers
  2019-11-01  1:13     ` Masahiro Yamada
@ 2019-11-01 18:52       ` Jeff Moyer
  2019-11-04  3:11         ` Masahiro Yamada
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Moyer @ 2019-11-01 18:52 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kbuild mailing list, Sam Ravnborg, Michal Marek,
	Linux Kernel Mailing List, Dan Williams, linux-nvdimm

Masahiro Yamada <yamada.masahiro@socionext.com> writes:

> On Fri, Nov 1, 2019 at 1:51 AM Jeff Moyer <jmoyer@redhat.com> wrote:
>>
>> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
>>
>> > Now that there is no overwrap between symbols from ELF files and
>> > ones from Module.symvers.
>> >
>> > So, the 'exported twice' warning should be reported irrespective
>> > of where the symbol in question came from. Only the exceptional case
>> > is when __crc_<sym> symbol appears before __ksymtab_<sym>. This
>> > typically occurs for EXPORT_SYMBOL in .S files.
>>
>> Hi, Masahiro,
>>
>> After apply this patch, I get the following modpost warnings when doing:
>>
>> $ make M=tools/tesing/nvdimm
>> ...
>>   Building modules, stage 2.
>>   MODPOST 12 modules
>> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_lock' exported
>> twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_unlock'
>> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'is_nvdimm_bus_locked'
>> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'devm_nvdimm_memremap'
>> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'nd_fletcher64' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nd_desc' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nvdimm_bus_dev'
>> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
>> ...
>>
>> There are a lot of these warnings.  :)
>
> These warnings are correct since
> drivers/nvdimm/Makefile and
> tools/testing/nvdimm/Kbuild
> compile the same files.

Yeah, but that's by design.  Is there a way to silence these warnings?

-Jeff


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers
  2019-11-01 18:52       ` Jeff Moyer
@ 2019-11-04  3:11         ` Masahiro Yamada
  2019-11-04  6:43           ` Dan Williams
  0 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2019-11-04  3:11 UTC (permalink / raw)
  To: Jeff Moyer
  Cc: Linux Kbuild mailing list, Sam Ravnborg, Michal Marek,
	Linux Kernel Mailing List, Dan Williams, linux-nvdimm

On Sat, Nov 2, 2019 at 3:52 AM Jeff Moyer <jmoyer@redhat.com> wrote:
>
> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
>
> > On Fri, Nov 1, 2019 at 1:51 AM Jeff Moyer <jmoyer@redhat.com> wrote:
> >>
> >> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> >>
> >> > Now that there is no overwrap between symbols from ELF files and
> >> > ones from Module.symvers.
> >> >
> >> > So, the 'exported twice' warning should be reported irrespective
> >> > of where the symbol in question came from. Only the exceptional case
> >> > is when __crc_<sym> symbol appears before __ksymtab_<sym>. This
> >> > typically occurs for EXPORT_SYMBOL in .S files.
> >>
> >> Hi, Masahiro,
> >>
> >> After apply this patch, I get the following modpost warnings when doing:
> >>
> >> $ make M=tools/tesing/nvdimm
> >> ...
> >>   Building modules, stage 2.
> >>   MODPOST 12 modules
> >> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_lock' exported
> >> twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> >> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_unlock'
> >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> >> WARNING: tools/testing/nvdimm/libnvdimm: 'is_nvdimm_bus_locked'
> >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> >> WARNING: tools/testing/nvdimm/libnvdimm: 'devm_nvdimm_memremap'
> >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> >> WARNING: tools/testing/nvdimm/libnvdimm: 'nd_fletcher64' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> >> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nd_desc' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> >> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nvdimm_bus_dev'
> >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> >> ...
> >>
> >> There are a lot of these warnings.  :)
> >
> > These warnings are correct since
> > drivers/nvdimm/Makefile and
> > tools/testing/nvdimm/Kbuild
> > compile the same files.
>
> Yeah, but that's by design.  Is there a way to silence these warnings?
>
> -Jeff
>

"rm -f Module.symvers; make M=tools/testing/nvdimm" ?

I'd like the _design_ fixed though.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers
  2019-11-04  3:11         ` Masahiro Yamada
@ 2019-11-04  6:43           ` Dan Williams
  2019-11-04 18:47             ` Dan Williams
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Williams @ 2019-11-04  6:43 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Jeff Moyer, Linux Kbuild mailing list, Sam Ravnborg,
	Michal Marek, Linux Kernel Mailing List, linux-nvdimm

On Sun, Nov 3, 2019 at 7:12 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> On Sat, Nov 2, 2019 at 3:52 AM Jeff Moyer <jmoyer@redhat.com> wrote:
> >
> > Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> >
> > > On Fri, Nov 1, 2019 at 1:51 AM Jeff Moyer <jmoyer@redhat.com> wrote:
> > >>
> > >> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> > >>
> > >> > Now that there is no overwrap between symbols from ELF files and
> > >> > ones from Module.symvers.
> > >> >
> > >> > So, the 'exported twice' warning should be reported irrespective
> > >> > of where the symbol in question came from. Only the exceptional case
> > >> > is when __crc_<sym> symbol appears before __ksymtab_<sym>. This
> > >> > typically occurs for EXPORT_SYMBOL in .S files.
> > >>
> > >> Hi, Masahiro,
> > >>
> > >> After apply this patch, I get the following modpost warnings when doing:
> > >>
> > >> $ make M=tools/tesing/nvdimm
> > >> ...
> > >>   Building modules, stage 2.
> > >>   MODPOST 12 modules
> > >> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_lock' exported
> > >> twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > >> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_unlock'
> > >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > >> WARNING: tools/testing/nvdimm/libnvdimm: 'is_nvdimm_bus_locked'
> > >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > >> WARNING: tools/testing/nvdimm/libnvdimm: 'devm_nvdimm_memremap'
> > >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > >> WARNING: tools/testing/nvdimm/libnvdimm: 'nd_fletcher64' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > >> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nd_desc' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > >> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nvdimm_bus_dev'
> > >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > >> ...
> > >>
> > >> There are a lot of these warnings.  :)
> > >
> > > These warnings are correct since
> > > drivers/nvdimm/Makefile and
> > > tools/testing/nvdimm/Kbuild
> > > compile the same files.
> >
> > Yeah, but that's by design.  Is there a way to silence these warnings?
> >
> > -Jeff
> >
>
> "rm -f Module.symvers; make M=tools/testing/nvdimm" ?
>
> I'd like the _design_ fixed though.

This design is deliberate. The goal is to re-build the typical nvdimm
modules, but link them against mocked version of core kernel symbols.
This enables the nvdimm unit tests which have been there for years and
pre-date Kunit. That said, deleting Module.symvers seems a simple
enough workaround.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers
  2019-11-04  6:43           ` Dan Williams
@ 2019-11-04 18:47             ` Dan Williams
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Williams @ 2019-11-04 18:47 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Jeff Moyer, Linux Kbuild mailing list, Sam Ravnborg,
	Michal Marek, Linux Kernel Mailing List, linux-nvdimm

On Sun, Nov 3, 2019 at 10:43 PM Dan Williams <dan.j.williams@intel.com> wrote:
>
> On Sun, Nov 3, 2019 at 7:12 PM Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> >
> > On Sat, Nov 2, 2019 at 3:52 AM Jeff Moyer <jmoyer@redhat.com> wrote:
> > >
> > > Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> > >
> > > > On Fri, Nov 1, 2019 at 1:51 AM Jeff Moyer <jmoyer@redhat.com> wrote:
> > > >>
> > > >> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> > > >>
> > > >> > Now that there is no overwrap between symbols from ELF files and
> > > >> > ones from Module.symvers.
> > > >> >
> > > >> > So, the 'exported twice' warning should be reported irrespective
> > > >> > of where the symbol in question came from. Only the exceptional case
> > > >> > is when __crc_<sym> symbol appears before __ksymtab_<sym>. This
> > > >> > typically occurs for EXPORT_SYMBOL in .S files.
> > > >>
> > > >> Hi, Masahiro,
> > > >>
> > > >> After apply this patch, I get the following modpost warnings when doing:
> > > >>
> > > >> $ make M=tools/tesing/nvdimm
> > > >> ...
> > > >>   Building modules, stage 2.
> > > >>   MODPOST 12 modules
> > > >> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_lock' exported
> > > >> twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > > >> WARNING: tools/testing/nvdimm/libnvdimm: 'nvdimm_bus_unlock'
> > > >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > > >> WARNING: tools/testing/nvdimm/libnvdimm: 'is_nvdimm_bus_locked'
> > > >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > > >> WARNING: tools/testing/nvdimm/libnvdimm: 'devm_nvdimm_memremap'
> > > >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > > >> WARNING: tools/testing/nvdimm/libnvdimm: 'nd_fletcher64' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > > >> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nd_desc' exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > > >> WARNING: tools/testing/nvdimm/libnvdimm: 'to_nvdimm_bus_dev'
> > > >> exported twice. Previous export was in drivers/nvdimm/libnvdimm.ko
> > > >> ...
> > > >>
> > > >> There are a lot of these warnings.  :)
> > > >
> > > > These warnings are correct since
> > > > drivers/nvdimm/Makefile and
> > > > tools/testing/nvdimm/Kbuild
> > > > compile the same files.
> > >
> > > Yeah, but that's by design.  Is there a way to silence these warnings?
> > >
> > > -Jeff
> > >
> >
> > "rm -f Module.symvers; make M=tools/testing/nvdimm" ?
> >
> > I'd like the _design_ fixed though.
>
> This design is deliberate. The goal is to re-build the typical nvdimm
> modules, but link them against mocked version of core kernel symbols.
> This enables the nvdimm unit tests which have been there for years and
> pre-date Kunit. That said, deleting Module.symvers seems a simple
> enough workaround.

This workaround triggers:

  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

Which is a regression from the previous working state.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-11-04 18:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-03 10:29 [PATCH 1/4] kbuild: two minor updates for Documentation/kbuild/modules.rst Masahiro Yamada
2019-10-03 10:29 ` [PATCH 2/4] modpost: do not parse vmlinux for external module builds Masahiro Yamada
2019-10-03 10:29 ` [PATCH 3/4] kbuild: do not read $(KBUILD_EXTMOD)/Module.symvers Masahiro Yamada
2019-10-03 10:29 ` [PATCH 4/4] modpost: do not set ->preloaded for symbols from Module.symvers Masahiro Yamada
2019-10-31 16:51   ` Jeff Moyer
2019-11-01  1:13     ` Masahiro Yamada
2019-11-01 18:52       ` Jeff Moyer
2019-11-04  3:11         ` Masahiro Yamada
2019-11-04  6:43           ` Dan Williams
2019-11-04 18:47             ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).