get rid of padding, switch to RAW_COPY_USER
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 5 Apr 2017 22:56:55 +0000 (18:56 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 6 Apr 2017 23:35:51 +0000 (19:35 -0400)
Merced is fucked, so what else is new?

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/ia64/Kconfig
arch/ia64/include/asm/uaccess.h
arch/ia64/lib/memcpy_mck.S

index 18ca6a9ce566cc3b8463d22ecfe3e27c25fc24f7..0ed0e44856b261f51ff43f97e252a7f1fb40e2d4 100644 (file)
@@ -53,6 +53,7 @@ config IA64
        select ARCH_USE_CMPXCHG_LOCKREF
        select HAVE_ARCH_AUDITSYSCALL
        select HAVE_ARCH_HARDENED_USERCOPY
+       select ARCH_HAS_RAW_COPY_USER
        default y
        help
          The Itanium Processor Family is Intel's 64-bit successor to
index bd159723dfdedbaec68069ac5939961b51169e49..82a7646c4416a515813db5429e3a59e64c14207d 100644 (file)
@@ -235,46 +235,19 @@ extern unsigned long __must_check __copy_user (void __user *to, const void __use
                                               unsigned long count);
 
 static inline unsigned long
-__copy_to_user (void __user *to, const void *from, unsigned long count)
+raw_copy_to_user(void __user *to, const void *from, unsigned long count)
 {
-       check_object_size(from, count, true);
-
        return __copy_user(to, (__force void __user *) from, count);
 }
 
 static inline unsigned long
-__copy_from_user (void *to, const void __user *from, unsigned long count)
+raw_copy_from_user(void *to, const void __user *from, unsigned long count)
 {
-       check_object_size(to, count, false);
-
        return __copy_user((__force void __user *) to, from, count);
 }
 
-#define __copy_to_user_inatomic                __copy_to_user
-#define __copy_from_user_inatomic      __copy_from_user
-#define copy_to_user(to, from, n)                                                      \
-({                                                                                     \
-       void __user *__cu_to = (to);                                                    \
-       const void *__cu_from = (from);                                                 \
-       long __cu_len = (n);                                                            \
-                                                                                       \
-       if (__access_ok(__cu_to, __cu_len)) {                                           \
-               check_object_size(__cu_from, __cu_len, true);                   \
-               __cu_len = __copy_user(__cu_to, (__force void __user *)  __cu_from, __cu_len);  \
-       }                                                                               \
-       __cu_len;                                                                       \
-})
-
-static inline unsigned long
-copy_from_user(void *to, const void __user *from, unsigned long n)
-{
-       check_object_size(to, n, false);
-       if (likely(__access_ok(from, n)))
-               n = __copy_user((__force void __user *) to, from, n);
-       else
-               memset(to, 0, n);
-       return n;
-}
+#define INLINE_COPY_FROM_USER
+#define INLINE_COPY_TO_USER
 
 extern unsigned long __do_clear_user (void __user *, unsigned long);
 
index b264b6a7967b425b7add3311b542cbb64ca0b41b..bbbadc478f5b6642e2f75a5bc3798a45a7470555 100644 (file)
@@ -556,9 +556,6 @@ EK(.ex_handler,  (p17)      st8     [dst1]=r39,8);                                          \
 #define D      r22
 #define F      r28
 
-#define memset_arg0    r32
-#define memset_arg2    r33
-
 #define saved_retval   loc0
 #define saved_rtlink   loc1
 #define saved_pfs_stack        loc2
@@ -622,7 +619,7 @@ EK(.ex_handler,  (p17)      st8     [dst1]=r39,8);                                          \
  *     (faulting_addr - orig_dst)      -> len to faulting st address
  * B = (cur_dst - orig_dst)            -> len copied so far
  * C = A - B                           -> len need to be copied
- * D = orig_len - A                    -> len need to be zeroed
+ * D = orig_len - A                    -> len need to be left along
  */
 (p6)   sub     A = F, saved_in0
 (p7)   sub     A = F, saved_in1
@@ -638,9 +635,6 @@ EK(.ex_handler,  (p17)      st8     [dst1]=r39,8);                                          \
        sub     D = saved_in2, A
        ;;
        cmp.gt  p8,p0=C,r0              // more than 1 byte?
-       add     memset_arg0=saved_in0, A
-(p6)   mov     memset_arg2=0           // copy_to_user should not call memset
-(p7)   mov     memset_arg2=D           // copy_from_user need to have kbuf zeroed
        mov     r8=0
        mov     saved_retval = D
        mov     saved_rtlink = b0
@@ -652,11 +646,6 @@ EK(.ex_handler,  (p17)     st8     [dst1]=r39,8);                                          \
        ;;
 
        add     saved_retval=saved_retval,r8    // above might return non-zero value
-       cmp.gt  p8,p0=memset_arg2,r0    // more than 1 byte?
-       mov     out0=memset_arg0        // *s
-       mov     out1=r0                 // c
-       mov     out2=memset_arg2        // n
-(p8)   br.call.sptk.few b0=memset
        ;;
 
        mov     retval=saved_retval