linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 'kbuild' merge before 4.9-rc1 breaks build and boot
       [not found]     ` <20161107213907.GB18092@al>
@ 2016-11-08  1:33       ` Nicholas Piggin
  2016-11-20 18:26         ` Peter Wu
  0 siblings, 1 reply; 16+ messages in thread
From: Nicholas Piggin @ 2016-11-08  1:33 UTC (permalink / raw)
  To: Peter Wu
  Cc: Vince Weaver, Michal Marek, Al Viro, Oliver Hartkopp,
	linux-kernel, linux-kbuild, linux-arch

On Mon, 7 Nov 2016 22:39:07 +0100
Peter Wu <peter@lekensteyn.nl> wrote:

> On Mon, Nov 07, 2016 at 02:10:12PM -0500, Vince Weaver wrote:
> > On Thu, 27 Oct 2016, Peter Wu wrote:
> >   
> > > I can confirm Olivers issue, the current mainline kernel fails to boot
> > > on kernels with CONFIG_MODVERSIONS=y. Bisection points to:
> > > 
> > >     commit 784d5699eddc55878627da20d3fe0c8542e2f1a2
> > >     Author: Al Viro <viro@zeniv.linux.org.uk>
> > >     Date:   Mon Jan 11 11:04:34 2016 -0500  
> > > > WARNING: "memset" [sound/usb/snd-usbmidi-lib.ko] has no CRC!
> > > > WARNING: "__fentry__" [sound/usb/snd-usbmidi-lib.ko] has no CRC!
> > > > WARNING: "memcpy" [sound/usb/snd-usbmidi-lib.ko] has no CRC!
> > > > WARNING: "__sw_hweight32" [sound/usb/snd-usbmidi-lib.ko] has no CRC!  
> > 
> > Has any progress been made with this problem?
> > 
> > I'm also encountering it on my debian-unstable box on any kernel more 
> > recent than 4.9-rc1 (up to and including 4.9-rc4).  I am glad someone 
> > managed to isolate it as I was unable to get a clean bisect.
> > 
> > Vince  
> 
> The original kbuild issue went in via
> merge commit 84d69848c97faab0c25aa2667b273404d2e2a64a which notes:
> 
>  - EXPORT_SYMBOL for asm source by Al Viro.
> 
>    This does bring a regression, because genksyms no longer generates
>    checksums for these symbols (CONFIG_MODVERSIONS). Nick Piggin is
>    working on a patch to fix this.
> 
>    Plus, we are talking about functions like strcpy(), which rarely
>    change prototypes.
> 
> Adding Nicholas in the cc, hopefully he can give a status update.

I think Michal has everything needed now for the kbuild bits. The arch
specific patches can go via arch trees quite easily (there is no hard
dependency either way). This is the kbuild bit:

https://git.kernel.org/cgit/linux/kernel/git/mmarek/kbuild.git/commit/?h=rc-fixes&id=4efca4ed05cbdfd13ec3e8cb623fb77d6e4ab187

And it also needs this incremental bit not in Michal's tree yet:

---
 scripts/Makefile.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 3e223c2..05c6bb4 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -332,7 +332,7 @@ cmd_gensymtypes_S =                                                         \
     (echo "\#include <linux/kernel.h>" ;                                    \
      echo "\#include <asm/asm-prototypes.h>" ;                              \
     $(CPP) $(a_flags) $< |                                                  \
-     grep ^___EXPORT_SYMBOL |                                               \
+     grep ___EXPORT_SYMBOL |                                                \
      sed 's/___EXPORT_SYMBOL \([a-zA-Z0-9_]*\),.*/EXPORT_SYMBOL(\1);/' ) |  \
     $(CPP) -D__GENKSYMS__ $(c_flags) -xc - |                                \
     $(GENKSYMS) $(if $(1), -T $(2))                                         \
-- 
2.9.3

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

* Re: 'kbuild' merge before 4.9-rc1 breaks build and boot
  2016-11-08  1:33       ` 'kbuild' merge before 4.9-rc1 breaks build and boot Nicholas Piggin
@ 2016-11-20 18:26         ` Peter Wu
  2016-11-20 18:26           ` Peter Wu
  2016-11-21  5:49           ` Nicholas Piggin
  0 siblings, 2 replies; 16+ messages in thread
From: Peter Wu @ 2016-11-20 18:26 UTC (permalink / raw)
  To: Nicholas Piggin
  Cc: Vince Weaver, Michal Marek, Al Viro, Oliver Hartkopp,
	linux-kernel, linux-kbuild, linux-arch, regressions

Hi Nicholas,

Current git master (v4.9-rc5-364-g77079b1) with the latest kbuild fixes
is still failing to load modules when built with CONFIG_MODVERSIONS=y on
x86_64 using GCC 6.2.1.

It can still be reproduced with make defconfig, then enabling
CONFIG_MODVERSIONS=y. The build output contains:

    WARNING: "memcpy" [net/netfilter/nf_nat.ko] has no CRC!
    WARNING: "memmove" [net/netfilter/nf_nat.ko] has no CRC!
    WARNING: "_copy_to_user" [fs/efivarfs/efivarfs.ko] has no CRC!
    WARNING: "memcpy" [fs/efivarfs/efivarfs.ko] has no CRC!
    WARNING: "_copy_from_user" [fs/efivarfs/efivarfs.ko] has no CRC!

    $ grep 000000 Module.symvers
    0x00000000	phys_base	vmlinux	EXPORT_SYMBOL
    0x00000000	memmove	vmlinux	EXPORT_SYMBOL
    0x00000000	__copy_user_nocache	vmlinux	EXPORT_SYMBOL
    0x00000000	__get_user_4	vmlinux	EXPORT_SYMBOL
    0x00000000	__put_user_4	vmlinux	EXPORT_SYMBOL
    0x00000000	__memcpy	vmlinux	EXPORT_SYMBOL
    0x00000000	memset	vmlinux	EXPORT_SYMBOL
    0x00000000	__sw_hweight64	vmlinux	EXPORT_SYMBOL
    0x00000000	__sw_hweight32	vmlinux	EXPORT_SYMBOL
    0x00000000	memcpy_mcsafe_unrolled	vmlinux	EXPORT_SYMBOL_GPL
    0x00000000	memcpy	vmlinux	EXPORT_SYMBOL
    0x00000000	copy_user_enhanced_fast_string	vmlinux	EXPORT_SYMBOL
    0x00000000	clear_page	vmlinux	EXPORT_SYMBOL
    0x00000000	__put_user_2	vmlinux	EXPORT_SYMBOL
    0x00000000	__get_user_2	vmlinux	EXPORT_SYMBOL
    0x00000000	copy_page	vmlinux	EXPORT_SYMBOL
    0x00000000	copy_user_generic_string	vmlinux	EXPORT_SYMBOL
    0x00000000	_copy_to_user	vmlinux	EXPORT_SYMBOL
    0x00000000	__memmove	vmlinux	EXPORT_SYMBOL
    0x00000000	empty_zero_page	vmlinux	EXPORT_SYMBOL
    0x00000000	__get_user_8	vmlinux	EXPORT_SYMBOL
    0x00000000	__put_user_8	vmlinux	EXPORT_SYMBOL
    0x00000000	_copy_from_user	vmlinux	EXPORT_SYMBOL
    0x00000000	native_load_gs_index	vmlinux	EXPORT_SYMBOL
    0x00000000	__memset	vmlinux	EXPORT_SYMBOL
    0x00000000	__put_user_1	vmlinux	EXPORT_SYMBOL
    0x00000000	__get_user_1	vmlinux	EXPORT_SYMBOL
    0x00000000	copy_user_generic_unrolled	vmlinux	EXPORT_SYMBOL

Kind regards,
Peter

On Tue, Nov 08, 2016 at 12:33:34PM +1100, Nicholas Piggin wrote:
> On Mon, 7 Nov 2016 22:39:07 +0100
> Peter Wu <peter@lekensteyn.nl> wrote:
> 
> > On Mon, Nov 07, 2016 at 02:10:12PM -0500, Vince Weaver wrote:
> > > On Thu, 27 Oct 2016, Peter Wu wrote:
> > >   
> > > > I can confirm Olivers issue, the current mainline kernel fails to boot
> > > > on kernels with CONFIG_MODVERSIONS=y. Bisection points to:
> > > > 
> > > >     commit 784d5699eddc55878627da20d3fe0c8542e2f1a2
> > > >     Author: Al Viro <viro@zeniv.linux.org.uk>
> > > >     Date:   Mon Jan 11 11:04:34 2016 -0500  
> > > > > WARNING: "memset" [sound/usb/snd-usbmidi-lib.ko] has no CRC!
> > > > > WARNING: "__fentry__" [sound/usb/snd-usbmidi-lib.ko] has no CRC!
> > > > > WARNING: "memcpy" [sound/usb/snd-usbmidi-lib.ko] has no CRC!
> > > > > WARNING: "__sw_hweight32" [sound/usb/snd-usbmidi-lib.ko] has no CRC!  
> > > 
> > > Has any progress been made with this problem?
> > > 
> > > I'm also encountering it on my debian-unstable box on any kernel more 
> > > recent than 4.9-rc1 (up to and including 4.9-rc4).  I am glad someone 
> > > managed to isolate it as I was unable to get a clean bisect.
> > > 
> > > Vince  
> > 
> > The original kbuild issue went in via
> > merge commit 84d69848c97faab0c25aa2667b273404d2e2a64a which notes:
> > 
> >  - EXPORT_SYMBOL for asm source by Al Viro.
> > 
> >    This does bring a regression, because genksyms no longer generates
> >    checksums for these symbols (CONFIG_MODVERSIONS). Nick Piggin is
> >    working on a patch to fix this.
> > 
> >    Plus, we are talking about functions like strcpy(), which rarely
> >    change prototypes.
> > 
> > Adding Nicholas in the cc, hopefully he can give a status update.
> 
> I think Michal has everything needed now for the kbuild bits. The arch
> specific patches can go via arch trees quite easily (there is no hard
> dependency either way). This is the kbuild bit:
> 
> https://git.kernel.org/cgit/linux/kernel/git/mmarek/kbuild.git/commit/?h=rc-fixes&id=4efca4ed05cbdfd13ec3e8cb623fb77d6e4ab187
> 
> And it also needs this incremental bit not in Michal's tree yet:
> 
> ---
>  scripts/Makefile.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 3e223c2..05c6bb4 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -332,7 +332,7 @@ cmd_gensymtypes_S =                                                         \
>      (echo "\#include <linux/kernel.h>" ;                                    \
>       echo "\#include <asm/asm-prototypes.h>" ;                              \
>      $(CPP) $(a_flags) $< |                                                  \
> -     grep ^___EXPORT_SYMBOL |                                               \
> +     grep ___EXPORT_SYMBOL |                                                \
>       sed 's/___EXPORT_SYMBOL \([a-zA-Z0-9_]*\),.*/EXPORT_SYMBOL(\1);/' ) |  \
>      $(CPP) -D__GENKSYMS__ $(c_flags) -xc - |                                \
>      $(GENKSYMS) $(if $(1), -T $(2))                                         \
> -- 
> 2.9.3
> 

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

* Re: 'kbuild' merge before 4.9-rc1 breaks build and boot
  2016-11-20 18:26         ` Peter Wu
@ 2016-11-20 18:26           ` Peter Wu
  2016-11-21  5:49           ` Nicholas Piggin
  1 sibling, 0 replies; 16+ messages in thread
From: Peter Wu @ 2016-11-20 18:26 UTC (permalink / raw)
  To: Nicholas Piggin
  Cc: Vince Weaver, Michal Marek, Al Viro, Oliver Hartkopp,
	linux-kernel, linux-kbuild, linux-arch, regressions

Hi Nicholas,

Current git master (v4.9-rc5-364-g77079b1) with the latest kbuild fixes
is still failing to load modules when built with CONFIG_MODVERSIONS=y on
x86_64 using GCC 6.2.1.

It can still be reproduced with make defconfig, then enabling
CONFIG_MODVERSIONS=y. The build output contains:

    WARNING: "memcpy" [net/netfilter/nf_nat.ko] has no CRC!
    WARNING: "memmove" [net/netfilter/nf_nat.ko] has no CRC!
    WARNING: "_copy_to_user" [fs/efivarfs/efivarfs.ko] has no CRC!
    WARNING: "memcpy" [fs/efivarfs/efivarfs.ko] has no CRC!
    WARNING: "_copy_from_user" [fs/efivarfs/efivarfs.ko] has no CRC!

    $ grep 000000 Module.symvers
    0x00000000	phys_base	vmlinux	EXPORT_SYMBOL
    0x00000000	memmove	vmlinux	EXPORT_SYMBOL
    0x00000000	__copy_user_nocache	vmlinux	EXPORT_SYMBOL
    0x00000000	__get_user_4	vmlinux	EXPORT_SYMBOL
    0x00000000	__put_user_4	vmlinux	EXPORT_SYMBOL
    0x00000000	__memcpy	vmlinux	EXPORT_SYMBOL
    0x00000000	memset	vmlinux	EXPORT_SYMBOL
    0x00000000	__sw_hweight64	vmlinux	EXPORT_SYMBOL
    0x00000000	__sw_hweight32	vmlinux	EXPORT_SYMBOL
    0x00000000	memcpy_mcsafe_unrolled	vmlinux	EXPORT_SYMBOL_GPL
    0x00000000	memcpy	vmlinux	EXPORT_SYMBOL
    0x00000000	copy_user_enhanced_fast_string	vmlinux	EXPORT_SYMBOL
    0x00000000	clear_page	vmlinux	EXPORT_SYMBOL
    0x00000000	__put_user_2	vmlinux	EXPORT_SYMBOL
    0x00000000	__get_user_2	vmlinux	EXPORT_SYMBOL
    0x00000000	copy_page	vmlinux	EXPORT_SYMBOL
    0x00000000	copy_user_generic_string	vmlinux	EXPORT_SYMBOL
    0x00000000	_copy_to_user	vmlinux	EXPORT_SYMBOL
    0x00000000	__memmove	vmlinux	EXPORT_SYMBOL
    0x00000000	empty_zero_page	vmlinux	EXPORT_SYMBOL
    0x00000000	__get_user_8	vmlinux	EXPORT_SYMBOL
    0x00000000	__put_user_8	vmlinux	EXPORT_SYMBOL
    0x00000000	_copy_from_user	vmlinux	EXPORT_SYMBOL
    0x00000000	native_load_gs_index	vmlinux	EXPORT_SYMBOL
    0x00000000	__memset	vmlinux	EXPORT_SYMBOL
    0x00000000	__put_user_1	vmlinux	EXPORT_SYMBOL
    0x00000000	__get_user_1	vmlinux	EXPORT_SYMBOL
    0x00000000	copy_user_generic_unrolled	vmlinux	EXPORT_SYMBOL

Kind regards,
Peter

On Tue, Nov 08, 2016 at 12:33:34PM +1100, Nicholas Piggin wrote:
> On Mon, 7 Nov 2016 22:39:07 +0100
> Peter Wu <peter@lekensteyn.nl> wrote:
> 
> > On Mon, Nov 07, 2016 at 02:10:12PM -0500, Vince Weaver wrote:
> > > On Thu, 27 Oct 2016, Peter Wu wrote:
> > >   
> > > > I can confirm Olivers issue, the current mainline kernel fails to boot
> > > > on kernels with CONFIG_MODVERSIONS=y. Bisection points to:
> > > > 
> > > >     commit 784d5699eddc55878627da20d3fe0c8542e2f1a2
> > > >     Author: Al Viro <viro@zeniv.linux.org.uk>
> > > >     Date:   Mon Jan 11 11:04:34 2016 -0500  
> > > > > WARNING: "memset" [sound/usb/snd-usbmidi-lib.ko] has no CRC!
> > > > > WARNING: "__fentry__" [sound/usb/snd-usbmidi-lib.ko] has no CRC!
> > > > > WARNING: "memcpy" [sound/usb/snd-usbmidi-lib.ko] has no CRC!
> > > > > WARNING: "__sw_hweight32" [sound/usb/snd-usbmidi-lib.ko] has no CRC!  
> > > 
> > > Has any progress been made with this problem?
> > > 
> > > I'm also encountering it on my debian-unstable box on any kernel more 
> > > recent than 4.9-rc1 (up to and including 4.9-rc4).  I am glad someone 
> > > managed to isolate it as I was unable to get a clean bisect.
> > > 
> > > Vince  
> > 
> > The original kbuild issue went in via
> > merge commit 84d69848c97faab0c25aa2667b273404d2e2a64a which notes:
> > 
> >  - EXPORT_SYMBOL for asm source by Al Viro.
> > 
> >    This does bring a regression, because genksyms no longer generates
> >    checksums for these symbols (CONFIG_MODVERSIONS). Nick Piggin is
> >    working on a patch to fix this.
> > 
> >    Plus, we are talking about functions like strcpy(), which rarely
> >    change prototypes.
> > 
> > Adding Nicholas in the cc, hopefully he can give a status update.
> 
> I think Michal has everything needed now for the kbuild bits. The arch
> specific patches can go via arch trees quite easily (there is no hard
> dependency either way). This is the kbuild bit:
> 
> https://git.kernel.org/cgit/linux/kernel/git/mmarek/kbuild.git/commit/?h=rc-fixes&id=4efca4ed05cbdfd13ec3e8cb623fb77d6e4ab187
> 
> And it also needs this incremental bit not in Michal's tree yet:
> 
> ---
>  scripts/Makefile.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 3e223c2..05c6bb4 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -332,7 +332,7 @@ cmd_gensymtypes_S =                                                         \
>      (echo "\#include <linux/kernel.h>" ;                                    \
>       echo "\#include <asm/asm-prototypes.h>" ;                              \
>      $(CPP) $(a_flags) $< |                                                  \
> -     grep ^___EXPORT_SYMBOL |                                               \
> +     grep ___EXPORT_SYMBOL |                                                \
>       sed 's/___EXPORT_SYMBOL \([a-zA-Z0-9_]*\),.*/EXPORT_SYMBOL(\1);/' ) |  \
>      $(CPP) -D__GENKSYMS__ $(c_flags) -xc - |                                \
>      $(GENKSYMS) $(if $(1), -T $(2))                                         \
> -- 
> 2.9.3
> 

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

* Re: 'kbuild' merge before 4.9-rc1 breaks build and boot
  2016-11-20 18:26         ` Peter Wu
  2016-11-20 18:26           ` Peter Wu
@ 2016-11-21  5:49           ` Nicholas Piggin
  2016-11-21  5:49             ` Nicholas Piggin
  2016-11-21  6:39             ` [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86 Adam Borowski
  1 sibling, 2 replies; 16+ messages in thread
From: Nicholas Piggin @ 2016-11-21  5:49 UTC (permalink / raw)
  To: Peter Wu
  Cc: Vince Weaver, Michal Marek, Al Viro, Oliver Hartkopp,
	linux-kernel, linux-kbuild, linux-arch, regressions,
	Adam Borowski

On Sun, 20 Nov 2016 19:26:23 +0100
Peter Wu <peter@lekensteyn.nl> wrote:

> Hi Nicholas,
> 
> Current git master (v4.9-rc5-364-g77079b1) with the latest kbuild fixes
> is still failing to load modules when built with CONFIG_MODVERSIONS=y on
> x86_64 using GCC 6.2.1.
> 
> It can still be reproduced with make defconfig, then enabling
> CONFIG_MODVERSIONS=y. The build output contains:
> 
>     WARNING: "memcpy" [net/netfilter/nf_nat.ko] has no CRC!
>     WARNING: "memmove" [net/netfilter/nf_nat.ko] has no CRC!
>     WARNING: "_copy_to_user" [fs/efivarfs/efivarfs.ko] has no CRC!
>     WARNING: "memcpy" [fs/efivarfs/efivarfs.ko] has no CRC!
>     WARNING: "_copy_from_user" [fs/efivarfs/efivarfs.ko] has no CRC!

Hi Peter,

Sorry it's taken some time, bear with us. The arch specific patches need
to be merged now. Adam, what is the status of your patch? Please submit
to x86 maintainers if you haven't already.

Thanks,
Nick

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

* Re: 'kbuild' merge before 4.9-rc1 breaks build and boot
  2016-11-21  5:49           ` Nicholas Piggin
@ 2016-11-21  5:49             ` Nicholas Piggin
  2016-11-21  6:39             ` [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86 Adam Borowski
  1 sibling, 0 replies; 16+ messages in thread
From: Nicholas Piggin @ 2016-11-21  5:49 UTC (permalink / raw)
  To: Peter Wu
  Cc: Vince Weaver, Michal Marek, Al Viro, Oliver Hartkopp,
	linux-kernel, linux-kbuild, linux-arch, regressions,
	Adam Borowski

On Sun, 20 Nov 2016 19:26:23 +0100
Peter Wu <peter@lekensteyn.nl> wrote:

> Hi Nicholas,
> 
> Current git master (v4.9-rc5-364-g77079b1) with the latest kbuild fixes
> is still failing to load modules when built with CONFIG_MODVERSIONS=y on
> x86_64 using GCC 6.2.1.
> 
> It can still be reproduced with make defconfig, then enabling
> CONFIG_MODVERSIONS=y. The build output contains:
> 
>     WARNING: "memcpy" [net/netfilter/nf_nat.ko] has no CRC!
>     WARNING: "memmove" [net/netfilter/nf_nat.ko] has no CRC!
>     WARNING: "_copy_to_user" [fs/efivarfs/efivarfs.ko] has no CRC!
>     WARNING: "memcpy" [fs/efivarfs/efivarfs.ko] has no CRC!
>     WARNING: "_copy_from_user" [fs/efivarfs/efivarfs.ko] has no CRC!

Hi Peter,

Sorry it's taken some time, bear with us. The arch specific patches need
to be merged now. Adam, what is the status of your patch? Please submit
to x86 maintainers if you haven't already.

Thanks,
Nick

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

* [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86
  2016-11-21  5:49           ` Nicholas Piggin
  2016-11-21  5:49             ` Nicholas Piggin
@ 2016-11-21  6:39             ` Adam Borowski
  2016-11-21  6:39               ` Adam Borowski
  2016-11-21  7:27               ` Nicholas Piggin
  1 sibling, 2 replies; 16+ messages in thread
From: Adam Borowski @ 2016-11-21  6:39 UTC (permalink / raw)
  To: Nicholas Piggin, Peter Wu, Vince Weaver, Michal Marek, Al Viro,
	Oliver Hartkopp, linux-kernel, linux-kbuild, linux-arch,
	regressions, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Arnd Bergmann
  Cc: Adam Borowski

Nicholas Piggin wrote:
> Architectures will need to have an include/asm/asm-prototypes.h that
> defines or #include<>s C-style prototypes for exported asm functions.
> We can do an asm-generic version for the common ones like memset so
> there's not a lot of pointless duplication there.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Tested-by: Kalle Valo <kvalo@codeaurora.org>
---
 arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
 include/asm-generic/asm-prototypes.h  |  7 +++++++
 2 files changed, 19 insertions(+)
 create mode 100644 arch/x86/include/asm/asm-prototypes.h
 create mode 100644 include/asm-generic/asm-prototypes.h

diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
new file mode 100644
index 0000000..ae87224
--- /dev/null
+++ b/arch/x86/include/asm/asm-prototypes.h
@@ -0,0 +1,12 @@
+#include <asm/ftrace.h>
+#include <asm/uaccess.h>
+#include <asm/string.h>
+#include <asm/page.h>
+#include <asm/checksum.h>
+
+#include <asm-generic/asm-prototypes.h>
+
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/special_insns.h>
+#include <asm/preempt.h>
diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
new file mode 100644
index 0000000..df13637
--- /dev/null
+++ b/include/asm-generic/asm-prototypes.h
@@ -0,0 +1,7 @@
+#include <linux/bitops.h>
+extern void *__memset(void *, int, __kernel_size_t);
+extern void *__memcpy(void *, const void *, __kernel_size_t);
+extern void *__memmove(void *, const void *, __kernel_size_t);
+extern void *memset(void *, int, __kernel_size_t);
+extern void *memcpy(void *, const void *, __kernel_size_t);
+extern void *memmove(void *, const void *, __kernel_size_t);
-- 
2.10.2

Nicholas Piggin wrote:
> On Sun, 20 Nov 2016 19:26:23 +0100 Peter Wu <peter@lekensteyn.nl> wrote:
>
>> Current git master (v4.9-rc5-364-g77079b1) with the latest kbuild fixes
>> is still failing to load modules when built with CONFIG_MODVERSIONS=y on
>> x86_64 using GCC 6.2.1.
>>
>> It can still be reproduced with make defconfig, then enabling
>> CONFIG_MODVERSIONS=y. The build output contains:
>>
>>     WARNING: "memcpy" [net/netfilter/nf_nat.ko] has no CRC!
>>     WARNING: "memmove" [net/netfilter/nf_nat.ko] has no CRC!
>>     WARNING: "_copy_to_user" [fs/efivarfs/efivarfs.ko] has no CRC!
>>     WARNING: "memcpy" [fs/efivarfs/efivarfs.ko] has no CRC!
>>     WARNING: "_copy_from_user" [fs/efivarfs/efivarfs.ko] has no CRC!
>
> Sorry it's taken some time, bear with us. The arch specific patches need
> to be merged now. Adam, what is the status of your patch? Please submit
> to x86 maintainers if you haven't already.

I've re-checked against 4.9-rc6.

It'd probably fit better with kbuild parts, but it's up to you to decide;
I'm sending to x86 guys as you wish.


Meow!

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

* [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86
  2016-11-21  6:39             ` [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86 Adam Borowski
@ 2016-11-21  6:39               ` Adam Borowski
  2016-11-21  7:27               ` Nicholas Piggin
  1 sibling, 0 replies; 16+ messages in thread
From: Adam Borowski @ 2016-11-21  6:39 UTC (permalink / raw)
  To: Nicholas Piggin, Peter Wu, Vince Weaver, Michal Marek, Al Viro,
	Oliver Hartkopp, linux-kernel, linux-kbuild, linux-arch,
	regressions, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Arnd Bergmann
  Cc: Adam Borowski

Nicholas Piggin wrote:
> Architectures will need to have an include/asm/asm-prototypes.h that
> defines or #include<>s C-style prototypes for exported asm functions.
> We can do an asm-generic version for the common ones like memset so
> there's not a lot of pointless duplication there.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Tested-by: Kalle Valo <kvalo@codeaurora.org>
---
 arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
 include/asm-generic/asm-prototypes.h  |  7 +++++++
 2 files changed, 19 insertions(+)
 create mode 100644 arch/x86/include/asm/asm-prototypes.h
 create mode 100644 include/asm-generic/asm-prototypes.h

diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
new file mode 100644
index 0000000..ae87224
--- /dev/null
+++ b/arch/x86/include/asm/asm-prototypes.h
@@ -0,0 +1,12 @@
+#include <asm/ftrace.h>
+#include <asm/uaccess.h>
+#include <asm/string.h>
+#include <asm/page.h>
+#include <asm/checksum.h>
+
+#include <asm-generic/asm-prototypes.h>
+
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/special_insns.h>
+#include <asm/preempt.h>
diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
new file mode 100644
index 0000000..df13637
--- /dev/null
+++ b/include/asm-generic/asm-prototypes.h
@@ -0,0 +1,7 @@
+#include <linux/bitops.h>
+extern void *__memset(void *, int, __kernel_size_t);
+extern void *__memcpy(void *, const void *, __kernel_size_t);
+extern void *__memmove(void *, const void *, __kernel_size_t);
+extern void *memset(void *, int, __kernel_size_t);
+extern void *memcpy(void *, const void *, __kernel_size_t);
+extern void *memmove(void *, const void *, __kernel_size_t);
-- 
2.10.2

Nicholas Piggin wrote:
> On Sun, 20 Nov 2016 19:26:23 +0100 Peter Wu <peter@lekensteyn.nl> wrote:
>
>> Current git master (v4.9-rc5-364-g77079b1) with the latest kbuild fixes
>> is still failing to load modules when built with CONFIG_MODVERSIONS=y on
>> x86_64 using GCC 6.2.1.
>>
>> It can still be reproduced with make defconfig, then enabling
>> CONFIG_MODVERSIONS=y. The build output contains:
>>
>>     WARNING: "memcpy" [net/netfilter/nf_nat.ko] has no CRC!
>>     WARNING: "memmove" [net/netfilter/nf_nat.ko] has no CRC!
>>     WARNING: "_copy_to_user" [fs/efivarfs/efivarfs.ko] has no CRC!
>>     WARNING: "memcpy" [fs/efivarfs/efivarfs.ko] has no CRC!
>>     WARNING: "_copy_from_user" [fs/efivarfs/efivarfs.ko] has no CRC!
>
> Sorry it's taken some time, bear with us. The arch specific patches need
> to be merged now. Adam, what is the status of your patch? Please submit
> to x86 maintainers if you haven't already.

I've re-checked against 4.9-rc6.

It'd probably fit better with kbuild parts, but it's up to you to decide;
I'm sending to x86 guys as you wish.


Meow!

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

* Re: [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86
  2016-11-21  6:39             ` [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86 Adam Borowski
  2016-11-21  6:39               ` Adam Borowski
@ 2016-11-21  7:27               ` Nicholas Piggin
  2016-11-21  8:00                 ` Peter Wu
  2016-11-21 14:52                 ` [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm Adam Borowski
  1 sibling, 2 replies; 16+ messages in thread
From: Nicholas Piggin @ 2016-11-21  7:27 UTC (permalink / raw)
  To: Adam Borowski
  Cc: Peter Wu, Vince Weaver, Michal Marek, Al Viro, Oliver Hartkopp,
	linux-kernel, linux-kbuild, linux-arch, regressions,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann

Hi Adam,

Thanks. I'd suggest doing x86: or x86/kbuild: prefix for the patch. Also
possibly consider describing what the patch does at a higher level in your
subject line, e.g.:

  x86/kbuild: enable modversions for symbols exported from asm

Also, it wouldn't hurt to add a little changelog of your own. Describe
problem then solution, e.g.,

  Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
  modversion support for symbols exported from asm files. Architectures
  must include C-style declarations for those symbols in asm/asm-prototypes.h
  in order for them to be versioned.

  Add these declarations for x86, and an architecture-independent file that
  can be used for common symbols.

(if you want to use that as-is or rewrite it, no problem).

You can add Acked-by: Nicholas Piggin <npiggin@gmail.com>

Also it's not a big deal, but if you redo the patch, you could consider
splitting it into two (first add the generic header, then the x86 header),
but both can go via the x86 tree.

Thanks,
Nick

On Mon, 21 Nov 2016 07:39:45 +0100
Adam Borowski <kilobyte@angband.pl> wrote:

> Nicholas Piggin wrote:
> > Architectures will need to have an include/asm/asm-prototypes.h that
> > defines or #include<>s C-style prototypes for exported asm functions.
> > We can do an asm-generic version for the common ones like memset so
> > there's not a lot of pointless duplication there.  
> 
> Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> Tested-by: Kalle Valo <kvalo@codeaurora.org>
> ---
>  arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
>  include/asm-generic/asm-prototypes.h  |  7 +++++++
>  2 files changed, 19 insertions(+)
>  create mode 100644 arch/x86/include/asm/asm-prototypes.h
>  create mode 100644 include/asm-generic/asm-prototypes.h
> 
> diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
> new file mode 100644
> index 0000000..ae87224
> --- /dev/null
> +++ b/arch/x86/include/asm/asm-prototypes.h
> @@ -0,0 +1,12 @@
> +#include <asm/ftrace.h>
> +#include <asm/uaccess.h>
> +#include <asm/string.h>
> +#include <asm/page.h>
> +#include <asm/checksum.h>
> +
> +#include <asm-generic/asm-prototypes.h>
> +
> +#include <asm/page.h>
> +#include <asm/pgtable.h>
> +#include <asm/special_insns.h>
> +#include <asm/preempt.h>
> diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
> new file mode 100644
> index 0000000..df13637
> --- /dev/null
> +++ b/include/asm-generic/asm-prototypes.h
> @@ -0,0 +1,7 @@
> +#include <linux/bitops.h>
> +extern void *__memset(void *, int, __kernel_size_t);
> +extern void *__memcpy(void *, const void *, __kernel_size_t);
> +extern void *__memmove(void *, const void *, __kernel_size_t);
> +extern void *memset(void *, int, __kernel_size_t);
> +extern void *memcpy(void *, const void *, __kernel_size_t);
> +extern void *memmove(void *, const void *, __kernel_size_t);

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

* Re: [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86
  2016-11-21  7:27               ` Nicholas Piggin
@ 2016-11-21  8:00                 ` Peter Wu
  2016-11-21  8:00                   ` Peter Wu
  2016-11-21 14:52                 ` [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm Adam Borowski
  1 sibling, 1 reply; 16+ messages in thread
From: Peter Wu @ 2016-11-21  8:00 UTC (permalink / raw)
  To: Nicholas Piggin
  Cc: Adam Borowski, Vince Weaver, Michal Marek, Al Viro,
	Oliver Hartkopp, linux-kernel, linux-kbuild, linux-arch,
	regressions, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Arnd Bergmann

On Mon, Nov 21, 2016 at 06:27:14PM +1100, Nicholas Piggin wrote:
> Hi Adam,
> 
> Thanks. I'd suggest doing x86: or x86/kbuild: prefix for the patch. Also
> possibly consider describing what the patch does at a higher level in your
> subject line, e.g.:
> 
>   x86/kbuild: enable modversions for symbols exported from asm
> 
> Also, it wouldn't hurt to add a little changelog of your own. Describe
> problem then solution, e.g.,
> 
>   Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
>   modversion support for symbols exported from asm files. Architectures
>   must include C-style declarations for those symbols in asm/asm-prototypes.h
>   in order for them to be versioned.
> 
>   Add these declarations for x86, and an architecture-independent file that
>   can be used for common symbols.
> 
> (if you want to use that as-is or rewrite it, no problem).
> 
> You can add Acked-by: Nicholas Piggin <npiggin@gmail.com>

Hi Adam, Nicholas,

Thanks for the patch! I have confirmed that this fixes the defconfig and
the normal .config build I use for debugging, so:

Tested-by: Peter Wu <oeter@lekensteyn.nl>

It might also be worth to mention in the changelog the user impact,
namely that kernels may fail to load modules at all when
CONFIG_MODVERSIONS=y.

Kind regards,
Peter

> Also it's not a big deal, but if you redo the patch, you could consider
> splitting it into two (first add the generic header, then the x86 header),
> but both can go via the x86 tree.
> 
> Thanks,
> Nick
> 
> On Mon, 21 Nov 2016 07:39:45 +0100
> Adam Borowski <kilobyte@angband.pl> wrote:
> 
> > Nicholas Piggin wrote:
> > > Architectures will need to have an include/asm/asm-prototypes.h that
> > > defines or #include<>s C-style prototypes for exported asm functions.
> > > We can do an asm-generic version for the common ones like memset so
> > > there's not a lot of pointless duplication there.  
> > 
> > Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> > Tested-by: Kalle Valo <kvalo@codeaurora.org>
> > ---
> >  arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
> >  include/asm-generic/asm-prototypes.h  |  7 +++++++
> >  2 files changed, 19 insertions(+)
> >  create mode 100644 arch/x86/include/asm/asm-prototypes.h
> >  create mode 100644 include/asm-generic/asm-prototypes.h
> > 
> > diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
> > new file mode 100644
> > index 0000000..ae87224
> > --- /dev/null
> > +++ b/arch/x86/include/asm/asm-prototypes.h
> > @@ -0,0 +1,12 @@
> > +#include <asm/ftrace.h>
> > +#include <asm/uaccess.h>
> > +#include <asm/string.h>
> > +#include <asm/page.h>
> > +#include <asm/checksum.h>
> > +
> > +#include <asm-generic/asm-prototypes.h>
> > +
> > +#include <asm/page.h>
> > +#include <asm/pgtable.h>
> > +#include <asm/special_insns.h>
> > +#include <asm/preempt.h>
> > diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
> > new file mode 100644
> > index 0000000..df13637
> > --- /dev/null
> > +++ b/include/asm-generic/asm-prototypes.h
> > @@ -0,0 +1,7 @@
> > +#include <linux/bitops.h>
> > +extern void *__memset(void *, int, __kernel_size_t);
> > +extern void *__memcpy(void *, const void *, __kernel_size_t);
> > +extern void *__memmove(void *, const void *, __kernel_size_t);
> > +extern void *memset(void *, int, __kernel_size_t);
> > +extern void *memcpy(void *, const void *, __kernel_size_t);
> > +extern void *memmove(void *, const void *, __kernel_size_t);
> 

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

* Re: [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86
  2016-11-21  8:00                 ` Peter Wu
@ 2016-11-21  8:00                   ` Peter Wu
  0 siblings, 0 replies; 16+ messages in thread
From: Peter Wu @ 2016-11-21  8:00 UTC (permalink / raw)
  To: Nicholas Piggin
  Cc: Adam Borowski, Vince Weaver, Michal Marek, Al Viro,
	Oliver Hartkopp, linux-kernel, linux-kbuild, linux-arch,
	regressions, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Arnd Bergmann

On Mon, Nov 21, 2016 at 06:27:14PM +1100, Nicholas Piggin wrote:
> Hi Adam,
> 
> Thanks. I'd suggest doing x86: or x86/kbuild: prefix for the patch. Also
> possibly consider describing what the patch does at a higher level in your
> subject line, e.g.:
> 
>   x86/kbuild: enable modversions for symbols exported from asm
> 
> Also, it wouldn't hurt to add a little changelog of your own. Describe
> problem then solution, e.g.,
> 
>   Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
>   modversion support for symbols exported from asm files. Architectures
>   must include C-style declarations for those symbols in asm/asm-prototypes.h
>   in order for them to be versioned.
> 
>   Add these declarations for x86, and an architecture-independent file that
>   can be used for common symbols.
> 
> (if you want to use that as-is or rewrite it, no problem).
> 
> You can add Acked-by: Nicholas Piggin <npiggin@gmail.com>

Hi Adam, Nicholas,

Thanks for the patch! I have confirmed that this fixes the defconfig and
the normal .config build I use for debugging, so:

Tested-by: Peter Wu <oeter@lekensteyn.nl>

It might also be worth to mention in the changelog the user impact,
namely that kernels may fail to load modules at all when
CONFIG_MODVERSIONS=y.

Kind regards,
Peter

> Also it's not a big deal, but if you redo the patch, you could consider
> splitting it into two (first add the generic header, then the x86 header),
> but both can go via the x86 tree.
> 
> Thanks,
> Nick
> 
> On Mon, 21 Nov 2016 07:39:45 +0100
> Adam Borowski <kilobyte@angband.pl> wrote:
> 
> > Nicholas Piggin wrote:
> > > Architectures will need to have an include/asm/asm-prototypes.h that
> > > defines or #include<>s C-style prototypes for exported asm functions.
> > > We can do an asm-generic version for the common ones like memset so
> > > there's not a lot of pointless duplication there.  
> > 
> > Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> > Tested-by: Kalle Valo <kvalo@codeaurora.org>
> > ---
> >  arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
> >  include/asm-generic/asm-prototypes.h  |  7 +++++++
> >  2 files changed, 19 insertions(+)
> >  create mode 100644 arch/x86/include/asm/asm-prototypes.h
> >  create mode 100644 include/asm-generic/asm-prototypes.h
> > 
> > diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
> > new file mode 100644
> > index 0000000..ae87224
> > --- /dev/null
> > +++ b/arch/x86/include/asm/asm-prototypes.h
> > @@ -0,0 +1,12 @@
> > +#include <asm/ftrace.h>
> > +#include <asm/uaccess.h>
> > +#include <asm/string.h>
> > +#include <asm/page.h>
> > +#include <asm/checksum.h>
> > +
> > +#include <asm-generic/asm-prototypes.h>
> > +
> > +#include <asm/page.h>
> > +#include <asm/pgtable.h>
> > +#include <asm/special_insns.h>
> > +#include <asm/preempt.h>
> > diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
> > new file mode 100644
> > index 0000000..df13637
> > --- /dev/null
> > +++ b/include/asm-generic/asm-prototypes.h
> > @@ -0,0 +1,7 @@
> > +#include <linux/bitops.h>
> > +extern void *__memset(void *, int, __kernel_size_t);
> > +extern void *__memcpy(void *, const void *, __kernel_size_t);
> > +extern void *__memmove(void *, const void *, __kernel_size_t);
> > +extern void *memset(void *, int, __kernel_size_t);
> > +extern void *memcpy(void *, const void *, __kernel_size_t);
> > +extern void *memmove(void *, const void *, __kernel_size_t);
> 

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

* [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm
  2016-11-21  7:27               ` Nicholas Piggin
  2016-11-21  8:00                 ` Peter Wu
@ 2016-11-21 14:52                 ` Adam Borowski
  2016-11-21 14:52                   ` Adam Borowski
                                     ` (2 more replies)
  1 sibling, 3 replies; 16+ messages in thread
From: Adam Borowski @ 2016-11-21 14:52 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann,
	Nicholas Piggin, Peter Wu, Vince Weaver, Michal Marek, Al Viro,
	Oliver Hartkopp, linux-kernel, linux-kbuild, linux-arch,
	regressions
  Cc: Adam Borowski

Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
modversion support for symbols exported from asm files. Architectures
must include C-style declarations for those symbols in asm/asm-prototypes.h
in order for them to be versioned.

Add these declarations for x86, and an architecture-independent file that
can be used for common symbols.

User impact: kernels may fail to load modules at all when
CONFIG_MODVERSIONS=y.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Tested-by: Kalle Valo <kvalo@codeaurora.org>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Peter Wu <oeter@lekensteyn.nl>
---
 arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
 include/asm-generic/asm-prototypes.h  |  7 +++++++
 2 files changed, 19 insertions(+)
 create mode 100644 arch/x86/include/asm/asm-prototypes.h
 create mode 100644 include/asm-generic/asm-prototypes.h

diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
new file mode 100644
index 0000000..ae87224
--- /dev/null
+++ b/arch/x86/include/asm/asm-prototypes.h
@@ -0,0 +1,12 @@
+#include <asm/ftrace.h>
+#include <asm/uaccess.h>
+#include <asm/string.h>
+#include <asm/page.h>
+#include <asm/checksum.h>
+
+#include <asm-generic/asm-prototypes.h>
+
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/special_insns.h>
+#include <asm/preempt.h>
diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
new file mode 100644
index 0000000..df13637
--- /dev/null
+++ b/include/asm-generic/asm-prototypes.h
@@ -0,0 +1,7 @@
+#include <linux/bitops.h>
+extern void *__memset(void *, int, __kernel_size_t);
+extern void *__memcpy(void *, const void *, __kernel_size_t);
+extern void *__memmove(void *, const void *, __kernel_size_t);
+extern void *memset(void *, int, __kernel_size_t);
+extern void *memcpy(void *, const void *, __kernel_size_t);
+extern void *memmove(void *, const void *, __kernel_size_t);
-- 
2.10.2

Now with a better description, provided by Nick Piggin (thanks!), and a
remark about user impact.

This version doesn't split the patch between x86 vs generic parts, would you
guys prefer that?

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

* [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm
  2016-11-21 14:52                 ` [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm Adam Borowski
@ 2016-11-21 14:52                   ` Adam Borowski
  2016-11-21 15:04                   ` Peter Wu
  2016-11-21 16:49                   ` Oliver Hartkopp
  2 siblings, 0 replies; 16+ messages in thread
From: Adam Borowski @ 2016-11-21 14:52 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann,
	Nicholas Piggin, Peter Wu, Vince Weaver, Michal Marek, Al Viro,
	Oliver Hartkopp, linux-kernel, linux-kbuild, linux-arch,
	regressions
  Cc: Adam Borowski

Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
modversion support for symbols exported from asm files. Architectures
must include C-style declarations for those symbols in asm/asm-prototypes.h
in order for them to be versioned.

Add these declarations for x86, and an architecture-independent file that
can be used for common symbols.

User impact: kernels may fail to load modules at all when
CONFIG_MODVERSIONS=y.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Tested-by: Kalle Valo <kvalo@codeaurora.org>
Acked-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Peter Wu <oeter@lekensteyn.nl>
---
 arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
 include/asm-generic/asm-prototypes.h  |  7 +++++++
 2 files changed, 19 insertions(+)
 create mode 100644 arch/x86/include/asm/asm-prototypes.h
 create mode 100644 include/asm-generic/asm-prototypes.h

diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
new file mode 100644
index 0000000..ae87224
--- /dev/null
+++ b/arch/x86/include/asm/asm-prototypes.h
@@ -0,0 +1,12 @@
+#include <asm/ftrace.h>
+#include <asm/uaccess.h>
+#include <asm/string.h>
+#include <asm/page.h>
+#include <asm/checksum.h>
+
+#include <asm-generic/asm-prototypes.h>
+
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/special_insns.h>
+#include <asm/preempt.h>
diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
new file mode 100644
index 0000000..df13637
--- /dev/null
+++ b/include/asm-generic/asm-prototypes.h
@@ -0,0 +1,7 @@
+#include <linux/bitops.h>
+extern void *__memset(void *, int, __kernel_size_t);
+extern void *__memcpy(void *, const void *, __kernel_size_t);
+extern void *__memmove(void *, const void *, __kernel_size_t);
+extern void *memset(void *, int, __kernel_size_t);
+extern void *memcpy(void *, const void *, __kernel_size_t);
+extern void *memmove(void *, const void *, __kernel_size_t);
-- 
2.10.2

Now with a better description, provided by Nick Piggin (thanks!), and a
remark about user impact.

This version doesn't split the patch between x86 vs generic parts, would you
guys prefer that?

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

* Re: [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm
  2016-11-21 14:52                 ` [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm Adam Borowski
  2016-11-21 14:52                   ` Adam Borowski
@ 2016-11-21 15:04                   ` Peter Wu
  2016-11-21 15:04                     ` Peter Wu
  2016-11-21 16:49                   ` Oliver Hartkopp
  2 siblings, 1 reply; 16+ messages in thread
From: Peter Wu @ 2016-11-21 15:04 UTC (permalink / raw)
  To: Adam Borowski
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann,
	Nicholas Piggin, Vince Weaver, Michal Marek, Al Viro,
	Oliver Hartkopp, linux-kernel, linux-kbuild, linux-arch,
	regressions

On Mon, Nov 21, 2016 at 03:52:20PM +0100, Adam Borowski wrote:
> Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
> modversion support for symbols exported from asm files. Architectures
> must include C-style declarations for those symbols in asm/asm-prototypes.h
> in order for them to be versioned.
> 
> Add these declarations for x86, and an architecture-independent file that
> can be used for common symbols.
> 
> User impact: kernels may fail to load modules at all when
> CONFIG_MODVERSIONS=y.
> 
> Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> Tested-by: Kalle Valo <kvalo@codeaurora.org>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Tested-by: Peter Wu <oeter@lekensteyn.nl>

Typo: oeter@.. -> peter@..

> ---
>  arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
>  include/asm-generic/asm-prototypes.h  |  7 +++++++
>  2 files changed, 19 insertions(+)
>  create mode 100644 arch/x86/include/asm/asm-prototypes.h
>  create mode 100644 include/asm-generic/asm-prototypes.h
> 
> diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
> new file mode 100644
> index 0000000..ae87224
> --- /dev/null
> +++ b/arch/x86/include/asm/asm-prototypes.h
> @@ -0,0 +1,12 @@
> +#include <asm/ftrace.h>
> +#include <asm/uaccess.h>
> +#include <asm/string.h>
> +#include <asm/page.h>
> +#include <asm/checksum.h>
> +
> +#include <asm-generic/asm-prototypes.h>
> +
> +#include <asm/page.h>
> +#include <asm/pgtable.h>
> +#include <asm/special_insns.h>
> +#include <asm/preempt.h>
> diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
> new file mode 100644
> index 0000000..df13637
> --- /dev/null
> +++ b/include/asm-generic/asm-prototypes.h
> @@ -0,0 +1,7 @@
> +#include <linux/bitops.h>
> +extern void *__memset(void *, int, __kernel_size_t);
> +extern void *__memcpy(void *, const void *, __kernel_size_t);
> +extern void *__memmove(void *, const void *, __kernel_size_t);
> +extern void *memset(void *, int, __kernel_size_t);
> +extern void *memcpy(void *, const void *, __kernel_size_t);
> +extern void *memmove(void *, const void *, __kernel_size_t);
> -- 
> 2.10.2
> 
> Now with a better description, provided by Nick Piggin (thanks!), and a
> remark about user impact.
> 
> This version doesn't split the patch between x86 vs generic parts, would you
> guys prefer that?

From an observer POV: based on the git log include/asm-generic/
arch/x86/include/asm/, a split up seems quite common.

By the way, to make the description and discussion closer, you might
want to structure your mail like this:

    [patch description]
    ---
    [discussion]
    ---
    [actual patch]

When applying the patch, the text after the first "---" is automatically
dropped.

Thanks!

Kind regards,
Peter

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

* Re: [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm
  2016-11-21 15:04                   ` Peter Wu
@ 2016-11-21 15:04                     ` Peter Wu
  0 siblings, 0 replies; 16+ messages in thread
From: Peter Wu @ 2016-11-21 15:04 UTC (permalink / raw)
  To: Adam Borowski
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Arnd Bergmann,
	Nicholas Piggin, Vince Weaver, Michal Marek, Al Viro,
	Oliver Hartkopp, linux-kernel, linux-kbuild, linux-arch,
	regressions

On Mon, Nov 21, 2016 at 03:52:20PM +0100, Adam Borowski wrote:
> Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
> modversion support for symbols exported from asm files. Architectures
> must include C-style declarations for those symbols in asm/asm-prototypes.h
> in order for them to be versioned.
> 
> Add these declarations for x86, and an architecture-independent file that
> can be used for common symbols.
> 
> User impact: kernels may fail to load modules at all when
> CONFIG_MODVERSIONS=y.
> 
> Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> Tested-by: Kalle Valo <kvalo@codeaurora.org>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Tested-by: Peter Wu <oeter@lekensteyn.nl>

Typo: oeter@.. -> peter@..

> ---
>  arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
>  include/asm-generic/asm-prototypes.h  |  7 +++++++
>  2 files changed, 19 insertions(+)
>  create mode 100644 arch/x86/include/asm/asm-prototypes.h
>  create mode 100644 include/asm-generic/asm-prototypes.h
> 
> diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
> new file mode 100644
> index 0000000..ae87224
> --- /dev/null
> +++ b/arch/x86/include/asm/asm-prototypes.h
> @@ -0,0 +1,12 @@
> +#include <asm/ftrace.h>
> +#include <asm/uaccess.h>
> +#include <asm/string.h>
> +#include <asm/page.h>
> +#include <asm/checksum.h>
> +
> +#include <asm-generic/asm-prototypes.h>
> +
> +#include <asm/page.h>
> +#include <asm/pgtable.h>
> +#include <asm/special_insns.h>
> +#include <asm/preempt.h>
> diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
> new file mode 100644
> index 0000000..df13637
> --- /dev/null
> +++ b/include/asm-generic/asm-prototypes.h
> @@ -0,0 +1,7 @@
> +#include <linux/bitops.h>
> +extern void *__memset(void *, int, __kernel_size_t);
> +extern void *__memcpy(void *, const void *, __kernel_size_t);
> +extern void *__memmove(void *, const void *, __kernel_size_t);
> +extern void *memset(void *, int, __kernel_size_t);
> +extern void *memcpy(void *, const void *, __kernel_size_t);
> +extern void *memmove(void *, const void *, __kernel_size_t);
> -- 
> 2.10.2
> 
> Now with a better description, provided by Nick Piggin (thanks!), and a
> remark about user impact.
> 
> This version doesn't split the patch between x86 vs generic parts, would you
> guys prefer that?

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

* Re: [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm
  2016-11-21 14:52                 ` [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm Adam Borowski
  2016-11-21 14:52                   ` Adam Borowski
  2016-11-21 15:04                   ` Peter Wu
@ 2016-11-21 16:49                   ` Oliver Hartkopp
  2016-11-21 16:49                     ` Oliver Hartkopp
  2 siblings, 1 reply; 16+ messages in thread
From: Oliver Hartkopp @ 2016-11-21 16:49 UTC (permalink / raw)
  To: Adam Borowski, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Arnd Bergmann, Nicholas Piggin, Peter Wu, Vince Weaver,
	Michal Marek, Al Viro, linux-kernel, linux-kbuild, linux-arch,
	regressions



On 11/21/2016 03:52 PM, Adam Borowski wrote:
> Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
> modversion support for symbols exported from asm files. Architectures
> must include C-style declarations for those symbols in asm/asm-prototypes.h
> in order for them to be versioned.
>
> Add these declarations for x86, and an architecture-independent file that
> can be used for common symbols.
>
> User impact: kernels may fail to load modules at all when
> CONFIG_MODVERSIONS=y.

late but great :-)

Thanks for fixing this!

Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>

(if you like)

Regards,
Oliver

>
> Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> Tested-by: Kalle Valo <kvalo@codeaurora.org>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Tested-by: Peter Wu <oeter@lekensteyn.nl>
> ---
>  arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
>  include/asm-generic/asm-prototypes.h  |  7 +++++++
>  2 files changed, 19 insertions(+)
>  create mode 100644 arch/x86/include/asm/asm-prototypes.h
>  create mode 100644 include/asm-generic/asm-prototypes.h
>
> diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
> new file mode 100644
> index 0000000..ae87224
> --- /dev/null
> +++ b/arch/x86/include/asm/asm-prototypes.h
> @@ -0,0 +1,12 @@
> +#include <asm/ftrace.h>
> +#include <asm/uaccess.h>
> +#include <asm/string.h>
> +#include <asm/page.h>
> +#include <asm/checksum.h>
> +
> +#include <asm-generic/asm-prototypes.h>
> +
> +#include <asm/page.h>
> +#include <asm/pgtable.h>
> +#include <asm/special_insns.h>
> +#include <asm/preempt.h>
> diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
> new file mode 100644
> index 0000000..df13637
> --- /dev/null
> +++ b/include/asm-generic/asm-prototypes.h
> @@ -0,0 +1,7 @@
> +#include <linux/bitops.h>
> +extern void *__memset(void *, int, __kernel_size_t);
> +extern void *__memcpy(void *, const void *, __kernel_size_t);
> +extern void *__memmove(void *, const void *, __kernel_size_t);
> +extern void *memset(void *, int, __kernel_size_t);
> +extern void *memcpy(void *, const void *, __kernel_size_t);
> +extern void *memmove(void *, const void *, __kernel_size_t);
>

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

* Re: [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm
  2016-11-21 16:49                   ` Oliver Hartkopp
@ 2016-11-21 16:49                     ` Oliver Hartkopp
  0 siblings, 0 replies; 16+ messages in thread
From: Oliver Hartkopp @ 2016-11-21 16:49 UTC (permalink / raw)
  To: Adam Borowski, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Arnd Bergmann, Nicholas Piggin, Peter Wu, Vince Weaver,
	Michal Marek, Al Viro, linux-kernel, linux-kbuild, linux-arch,
	regressions



On 11/21/2016 03:52 PM, Adam Borowski wrote:
> Commit 4efca4ed ("kbuild: modversions for EXPORT_SYMBOL() for asm") adds
> modversion support for symbols exported from asm files. Architectures
> must include C-style declarations for those symbols in asm/asm-prototypes.h
> in order for them to be versioned.
>
> Add these declarations for x86, and an architecture-independent file that
> can be used for common symbols.
>
> User impact: kernels may fail to load modules at all when
> CONFIG_MODVERSIONS=y.

late but great :-)

Thanks for fixing this!

Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>

(if you like)

Regards,
Oliver

>
> Signed-off-by: Adam Borowski <kilobyte@angband.pl>
> Tested-by: Kalle Valo <kvalo@codeaurora.org>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>
> Tested-by: Peter Wu <oeter@lekensteyn.nl>
> ---
>  arch/x86/include/asm/asm-prototypes.h | 12 ++++++++++++
>  include/asm-generic/asm-prototypes.h  |  7 +++++++
>  2 files changed, 19 insertions(+)
>  create mode 100644 arch/x86/include/asm/asm-prototypes.h
>  create mode 100644 include/asm-generic/asm-prototypes.h
>
> diff --git a/arch/x86/include/asm/asm-prototypes.h b/arch/x86/include/asm/asm-prototypes.h
> new file mode 100644
> index 0000000..ae87224
> --- /dev/null
> +++ b/arch/x86/include/asm/asm-prototypes.h
> @@ -0,0 +1,12 @@
> +#include <asm/ftrace.h>
> +#include <asm/uaccess.h>
> +#include <asm/string.h>
> +#include <asm/page.h>
> +#include <asm/checksum.h>
> +
> +#include <asm-generic/asm-prototypes.h>
> +
> +#include <asm/page.h>
> +#include <asm/pgtable.h>
> +#include <asm/special_insns.h>
> +#include <asm/preempt.h>
> diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
> new file mode 100644
> index 0000000..df13637
> --- /dev/null
> +++ b/include/asm-generic/asm-prototypes.h
> @@ -0,0 +1,7 @@
> +#include <linux/bitops.h>
> +extern void *__memset(void *, int, __kernel_size_t);
> +extern void *__memcpy(void *, const void *, __kernel_size_t);
> +extern void *__memmove(void *, const void *, __kernel_size_t);
> +extern void *memset(void *, int, __kernel_size_t);
> +extern void *memcpy(void *, const void *, __kernel_size_t);
> +extern void *memmove(void *, const void *, __kernel_size_t);
>

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

end of thread, other threads:[~2016-11-21 16:54 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4c04b846-3da8-dc42-4fa6-30f72a5c2437@hartkopp.net>
     [not found] ` <20161027154202.GE27017@al>
     [not found]   ` <alpine.DEB.2.20.1611071408040.24418@macbook-air>
     [not found]     ` <20161107213907.GB18092@al>
2016-11-08  1:33       ` 'kbuild' merge before 4.9-rc1 breaks build and boot Nicholas Piggin
2016-11-20 18:26         ` Peter Wu
2016-11-20 18:26           ` Peter Wu
2016-11-21  5:49           ` Nicholas Piggin
2016-11-21  5:49             ` Nicholas Piggin
2016-11-21  6:39             ` [PATCH resend] kbuild: provide include/asm/asm-prototypes.h for x86 Adam Borowski
2016-11-21  6:39               ` Adam Borowski
2016-11-21  7:27               ` Nicholas Piggin
2016-11-21  8:00                 ` Peter Wu
2016-11-21  8:00                   ` Peter Wu
2016-11-21 14:52                 ` [PATCH reworded] x86/kbuild: enable modversions for symbols exported from asm Adam Borowski
2016-11-21 14:52                   ` Adam Borowski
2016-11-21 15:04                   ` Peter Wu
2016-11-21 15:04                     ` Peter Wu
2016-11-21 16:49                   ` Oliver Hartkopp
2016-11-21 16:49                     ` Oliver Hartkopp

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).