Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Jul 2017 04:34:24 +0000 (21:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Jul 2017 04:34:24 +0000 (21:34 -0700)
Pull sparc fixes from David Miller:

 - Fix symbol version generation for assembler on sparc, from
   Nagarathnam Muthusamy.

 - Fix compound page handling in gup_huge_pmd(), from Nitin Gupta.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc64: Fix gup_huge_pmd
  Adding the type of exported symbols
  sed regex in Makefile.build requires line break between exported symbols
  Adding asm-prototypes.h for genksyms to generate crc

arch/sparc/include/asm/asm-prototypes.h [new file with mode: 0644]
arch/sparc/lib/atomic_64.S
arch/sparc/lib/checksum_64.S
arch/sparc/lib/csum_copy.S
arch/sparc/lib/memscan_64.S
arch/sparc/lib/memset.S
arch/sparc/mm/gup.c

diff --git a/arch/sparc/include/asm/asm-prototypes.h b/arch/sparc/include/asm/asm-prototypes.h
new file mode 100644 (file)
index 0000000..d381e11
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
+ */
+
+#include <asm/xor.h>
+#include <asm/checksum.h>
+#include <asm/trap_block.h>
+#include <asm/uaccess.h>
+#include <asm/atomic.h>
+#include <asm/ftrace.h>
+#include <asm/cacheflush.h>
+#include <asm/oplib.h>
+#include <linux/atomic.h>
+
+void *__memscan_zero(void *, size_t);
+void *__memscan_generic(void *, int, size_t);
+void *__bzero(void *, size_t);
+void VISenter(void); /* Dummy prototype to supress warning */
+#undef memcpy
+#undef memset
+void *memcpy(void *dest, const void *src, size_t n);
+void *memset(void *s, int c, size_t n);
+typedef int TItype __attribute__((mode(TI)));
+TItype __multi3(TItype a, TItype b);
index 1c6a1bde51388ea0402bc4271f796d5935dda4fb..ce17c3094ba6d90afa7dca890f9891b067efdd8d 100644 (file)
@@ -62,19 +62,23 @@ ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */    \
 ENDPROC(atomic_fetch_##op);                                            \
 EXPORT_SYMBOL(atomic_fetch_##op);
 
-#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
+ATOMIC_OP(add)
+ATOMIC_OP_RETURN(add)
+ATOMIC_FETCH_OP(add)
 
-ATOMIC_OPS(add)
-ATOMIC_OPS(sub)
+ATOMIC_OP(sub)
+ATOMIC_OP_RETURN(sub)
+ATOMIC_FETCH_OP(sub)
 
-#undef ATOMIC_OPS
-#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_FETCH_OP(op)
+ATOMIC_OP(and)
+ATOMIC_FETCH_OP(and)
 
-ATOMIC_OPS(and)
-ATOMIC_OPS(or)
-ATOMIC_OPS(xor)
+ATOMIC_OP(or)
+ATOMIC_FETCH_OP(or)
+
+ATOMIC_OP(xor)
+ATOMIC_FETCH_OP(xor)
 
-#undef ATOMIC_OPS
 #undef ATOMIC_FETCH_OP
 #undef ATOMIC_OP_RETURN
 #undef ATOMIC_OP
@@ -124,19 +128,23 @@ ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */        \
 ENDPROC(atomic64_fetch_##op);                                          \
 EXPORT_SYMBOL(atomic64_fetch_##op);
 
-#define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op)
+ATOMIC64_OP(add)
+ATOMIC64_OP_RETURN(add)
+ATOMIC64_FETCH_OP(add)
+
+ATOMIC64_OP(sub)
+ATOMIC64_OP_RETURN(sub)
+ATOMIC64_FETCH_OP(sub)
 
-ATOMIC64_OPS(add)
-ATOMIC64_OPS(sub)
+ATOMIC64_OP(and)
+ATOMIC64_FETCH_OP(and)
 
-#undef ATOMIC64_OPS
-#define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_FETCH_OP(op)
+ATOMIC64_OP(or)
+ATOMIC64_FETCH_OP(or)
 
-ATOMIC64_OPS(and)
-ATOMIC64_OPS(or)
-ATOMIC64_OPS(xor)
+ATOMIC64_OP(xor)
+ATOMIC64_FETCH_OP(xor)
 
-#undef ATOMIC64_OPS
 #undef ATOMIC64_FETCH_OP
 #undef ATOMIC64_OP_RETURN
 #undef ATOMIC64_OP
index f6732174fe6bdcceeb4228e64a92e2357cd81e00..6cfa521f444d1138b7bb2067e2e65dd4dd9d37f5 100644 (file)
@@ -38,6 +38,7 @@ csum_partial_fix_alignment:
 
        .align          32
        .globl          csum_partial
+       .type           csum_partial,#function
        EXPORT_SYMBOL(csum_partial)
 csum_partial:          /* %o0=buff, %o1=len, %o2=sum */
        prefetch        [%o0 + 0x000], #n_reads
index 0ecbafc30fd00e21cd7bd453d5e09d99349b8a82..b1051e77c49acd06074689249d7058c5205151c1 100644 (file)
@@ -65,6 +65,7 @@
         add            %o5, %o4, %o4
 
        .globl          FUNC_NAME
+       .type           FUNC_NAME,#function
        EXPORT_SYMBOL(FUNC_NAME)
 FUNC_NAME:             /* %o0=src, %o1=dst, %o2=len, %o3=sum */
        LOAD(prefetch, %o0 + 0x000, #n_reads)
index daa96f4b03e6007fbc415a70514f3f56be8a4ef1..5efee1f4be366f3b9f24c6b434523653664ae26f 100644 (file)
@@ -14,6 +14,8 @@
        .text
        .align  32
        .globl          __memscan_zero, __memscan_generic
+       .type           __memscan_zero,#function
+       .type           __memscan_generic,#function
        .globl          memscan
        EXPORT_SYMBOL(__memscan_zero)
        EXPORT_SYMBOL(__memscan_generic)
index bb539b42b088ace45ecf2d1419ee808986f12d72..e23338dbfc43ac1a3b8ed7de2b99697774ccc3de 100644 (file)
@@ -63,6 +63,7 @@
 __bzero_begin:
 
        .globl  __bzero
+       .type   __bzero,#function
        .globl  memset
        EXPORT_SYMBOL(__bzero)
        EXPORT_SYMBOL(memset)
index cd0e32bbcb1de0f6b16bce4ccd3f8b89acaa18b9..f80cfc64c55ba2b975cf5c3c0fe4fb72da316de9 100644 (file)
@@ -78,8 +78,8 @@ static int gup_huge_pmd(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
                return 0;
 
        refs = 0;
-       head = pmd_page(pmd);
-       page = head + ((addr & ~PMD_MASK) >> PAGE_SHIFT);
+       page = pmd_page(pmd) + ((addr & ~PMD_MASK) >> PAGE_SHIFT);
+       head = compound_head(page);
        do {
                VM_BUG_ON(compound_head(page) != head);
                pages[*nr] = page;