Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 11 Apr 2016 00:48:17 +0000 (17:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 11 Apr 2016 00:48:17 +0000 (17:48 -0700)
Pull ARM fixes from Russell King:
 "A couple of small fixes, and wiring up the new syscalls which appeared
  during the merge window"

* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  ARM: 8550/1: protect idiv patching against undefined gcc behavior
  ARM: wire up preadv2 and pwritev2 syscalls
  ARM: SMP enable of cache maintanence broadcast

arch/arm/include/asm/unistd.h
arch/arm/include/uapi/asm/unistd.h
arch/arm/kernel/calls.S
arch/arm/kernel/setup.c
arch/arm/mm/proc-v7.S

index 7b84657fba3577ea3d29ecf1b93e3267feecbb59..194b6992338920680c14c46326999791e33defa6 100644 (file)
@@ -19,7 +19,7 @@
  * This may need to be greater than __NR_last_syscall+1 in order to
  * account for the padding in the syscall table
  */
-#define __NR_syscalls  (392)
+#define __NR_syscalls  (396)
 
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_GETHOSTNAME
index 5dd2528e9e45e369d0879185291e6981dbea15e4..2cb9dc770e1d41e8867f949e1ef13e028568a3d3 100644 (file)
 #define __NR_membarrier                        (__NR_SYSCALL_BASE+389)
 #define __NR_mlock2                    (__NR_SYSCALL_BASE+390)
 #define __NR_copy_file_range           (__NR_SYSCALL_BASE+391)
+#define __NR_preadv2                   (__NR_SYSCALL_BASE+392)
+#define __NR_pwritev2                  (__NR_SYSCALL_BASE+393)
 
 /*
  * The following SWIs are ARM private.
index dfc7cd6851ad4bbd09b11ae94ee6056f691b1fcb..703fa0f3cd8f812907b47ac7c84646ff3e3aff94 100644 (file)
                CALL(sys_execveat)
                CALL(sys_userfaultfd)
                CALL(sys_membarrier)
-               CALL(sys_mlock2)
+/* 390 */      CALL(sys_mlock2)
                CALL(sys_copy_file_range)
+               CALL(sys_preadv2)
+               CALL(sys_pwritev2)
 #ifndef syscalls_counted
 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
 #define syscalls_counted
index 139791ed473d5264682c004ea2ea7af8ddd28f5d..a28fce0bdbbe11b7a950a3a0943f8362d7124b87 100644 (file)
@@ -430,11 +430,13 @@ static void __init patch_aeabi_idiv(void)
        pr_info("CPU: div instructions available: patching division code\n");
 
        fn_addr = ((uintptr_t)&__aeabi_uidiv) & ~1;
+       asm ("" : "+g" (fn_addr));
        ((u32 *)fn_addr)[0] = udiv_instruction();
        ((u32 *)fn_addr)[1] = bx_lr_instruction();
        flush_icache_range(fn_addr, fn_addr + 8);
 
        fn_addr = ((uintptr_t)&__aeabi_idiv) & ~1;
+       asm ("" : "+g" (fn_addr));
        ((u32 *)fn_addr)[0] = sdiv_instruction();
        ((u32 *)fn_addr)[1] = bx_lr_instruction();
        flush_icache_range(fn_addr, fn_addr + 8);
index 0f8963a7e7d9db28465c63a2bab69a615fb6a2cb..6fcaac8e200f888e18207ae6cdfeca8adc000c5e 100644 (file)
@@ -281,12 +281,12 @@ __v7_ca17mp_setup:
        bl      v7_invalidate_l1
        ldmia   r12, {r1-r6, lr}
 #ifdef CONFIG_SMP
+       orr     r10, r10, #(1 << 6)             @ Enable SMP/nAMP mode
        ALT_SMP(mrc     p15, 0, r0, c1, c0, 1)
-       ALT_UP(mov      r0, #(1 << 6))          @ fake it for UP
-       tst     r0, #(1 << 6)                   @ SMP/nAMP mode enabled?
-       orreq   r0, r0, #(1 << 6)               @ Enable SMP/nAMP mode
-       orreq   r0, r0, r10                     @ Enable CPU-specific SMP bits
-       mcreq   p15, 0, r0, c1, c0, 1
+       ALT_UP(mov      r0, r10)                @ fake it for UP
+       orr     r10, r10, r0                    @ Set required bits
+       teq     r10, r0                         @ Were they already set?
+       mcrne   p15, 0, r10, c1, c0, 1          @ No, update register
 #endif
        b       __v7_setup_cont