linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/1] asm prototypes for modversions on x86
@ 2016-12-11  0:52 Adam Borowski
  2016-12-11  1:09 ` [PATCH v3 1/1] x86/kbuild: enable modversions for symbols exported from asm Adam Borowski
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Borowski @ 2016-12-11  0:52 UTC (permalink / raw)
  To: linux-kbuild, linux-kernel, Michal Marek, Greg Kroah-Hartman,
	Arnd Bergmann, Ingo Molnar, Nicholas Piggin

Hi!
After Linus' revert of Arnd's modversions patch, it looks like we're back to
wanting asm-prototypes.h at least in the short term.  Things are much better
than before -- instead of failing to load modules there's just a scary
warning, but I still believe that no scary warning is better :)

Users will be stressed, waste their time looking for answer, etc -- and the
short-term fix is quite well researched and tested.  It's for x86 only, but
with arm ppc arm64 already dealt with, that handles about 99.9% of machines.

So I think it'd be good if you could apply this -- ideally for 4.9, if not
then at least 4.10.

There _is_ a modification since the last posted version: Ben Hutchings
pointed out that I missed one 486-only symbol.  Not surprising no one found
this during testing...

The diff from v2 is:
+#ifndef CONFIG_X86_CMPXCHG64
+extern void cmpxchg8b_emu(void);
+#endif

Note that this is already carried by Debian (Ben Hutchings' tree), so a
mainline fix for 4.9 would matter only for other distributions, not sure
which if any want to release with 4.9.


Meow!
-- 
u-boot problems can be solved with the help of your old SCSI manuals, the
parts that deal with goat termination.  You need a black-handled knife, and
an appropriate set of candles (number and color matters).  Or was it a
silver-handled knife?  Crap, need to look that up.

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

* [PATCH v3 1/1] x86/kbuild: enable modversions for symbols exported from asm
  2016-12-11  0:52 [PATCH v3 0/1] asm prototypes for modversions on x86 Adam Borowski
@ 2016-12-11  1:09 ` Adam Borowski
  2016-12-13 23:39   ` Michal Marek
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Borowski @ 2016-12-11  1:09 UTC (permalink / raw)
  To: linux-kbuild, linux-kernel, Michal Marek, Greg Kroah-Hartman,
	Arnd Bergmann, Ingo Molnar, Nicholas Piggin
  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.

With f27c2f6 reverting 8ab2ae6 ("default exported asm symbols to zero") we
produce a scary warning on x86, this commit fixes that.

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 <peter@lekensteyn.nl>
Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
 arch/x86/include/asm/asm-prototypes.h | 16 ++++++++++++++++
 include/asm-generic/asm-prototypes.h  |  7 +++++++
 2 files changed, 23 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 000000000000..44b8762fa0c7
--- /dev/null
+++ b/arch/x86/include/asm/asm-prototypes.h
@@ -0,0 +1,16 @@
+#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>
+
+#ifndef CONFIG_X86_CMPXCHG64
+extern void cmpxchg8b_emu(void);
+#endif
diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h
new file mode 100644
index 000000000000..df13637e4017
--- /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.11.0

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

* Re: [PATCH v3 1/1] x86/kbuild: enable modversions for symbols exported from asm
  2016-12-11  1:09 ` [PATCH v3 1/1] x86/kbuild: enable modversions for symbols exported from asm Adam Borowski
@ 2016-12-13 23:39   ` Michal Marek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Marek @ 2016-12-13 23:39 UTC (permalink / raw)
  To: Adam Borowski
  Cc: linux-kbuild, linux-kernel, Greg Kroah-Hartman, Arnd Bergmann,
	Ingo Molnar, Nicholas Piggin

Dne 11.12.2016 v 02:09 Adam Borowski napsal(a):
> 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.
> 
> With f27c2f6 reverting 8ab2ae6 ("default exported asm symbols to zero") we
> produce a scary warning on x86, this commit fixes that.
> 
> 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 <peter@lekensteyn.nl>
> Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>

Applied to kbuild.git#kbuild now.

Michal

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

end of thread, other threads:[~2016-12-13 23:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-11  0:52 [PATCH v3 0/1] asm prototypes for modversions on x86 Adam Borowski
2016-12-11  1:09 ` [PATCH v3 1/1] x86/kbuild: enable modversions for symbols exported from asm Adam Borowski
2016-12-13 23:39   ` Michal Marek

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