Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm

Pull ARM fixes from Russell King:
"Last merge window, we had some updates from Al cleaning up the signal
restart handling. These have caused some problems on ARM, and while
Al has some fixes, we have some concerns with Al's patches but we've
been unsuccesful with discussing this.

We have got to the point where we need to do something, and we've
decided that the best solution is to revert the appropriate commits
until Al is able to reply to us.

Also included here are four patches to fix warnings that I've noticed
in my build system, and one fix for kprobes test code."

* 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
ARM: fix warning caused by wrongly typed arm_dma_limit
ARM: fix warnings about atomic64_read
ARM: 7440/1: kprobes: only test 'sub pc, pc, #1b-2b+8-2' on ARMv6
ARM: 7441/1: perf: return -EOPNOTSUPP if requested mode exclusion is unavailable
ARM: 7443/1: Revert "new way of handling ERESTART_RESTARTBLOCK"
ARM: 7442/1: Revert "remove unused restart trampoline"
ARM: fix set_domain() macro
ARM: fix mach-versatile/pci.c warning

Changed files
+59 -28
arch
+1 -1
arch/arm/include/asm/atomic.h
··· 243 243 244 244 #define ATOMIC64_INIT(i) { (i) } 245 245 246 - static inline u64 atomic64_read(atomic64_t *v) 246 + static inline u64 atomic64_read(const atomic64_t *v) 247 247 { 248 248 u64 result; 249 249
+9 -9
arch/arm/include/asm/domain.h
··· 60 60 #ifndef __ASSEMBLY__ 61 61 62 62 #ifdef CONFIG_CPU_USE_DOMAINS 63 - #define set_domain(x) \ 64 - do { \ 65 - __asm__ __volatile__( \ 66 - "mcr p15, 0, %0, c3, c0 @ set domain" \ 67 - : : "r" (x)); \ 68 - isb(); \ 69 - } while (0) 63 + static inline void set_domain(unsigned val) 64 + { 65 + asm volatile( 66 + "mcr p15, 0, %0, c3, c0 @ set domain" 67 + : : "r" (val)); 68 + isb(); 69 + } 70 70 71 71 #define modify_domain(dom,type) \ 72 72 do { \ ··· 78 78 } while (0) 79 79 80 80 #else 81 - #define set_domain(x) do { } while (0) 82 - #define modify_domain(dom,type) do { } while (0) 81 + static inline void set_domain(unsigned val) { } 82 + static inline void modify_domain(unsigned dom, unsigned type) { } 83 83 #endif 84 84 85 85 /*
+1 -4
arch/arm/include/asm/thread_info.h
··· 148 148 #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ 149 149 #define TIF_SYSCALL_TRACE 8 150 150 #define TIF_SYSCALL_AUDIT 9 151 - #define TIF_SYSCALL_RESTARTSYS 10 152 151 #define TIF_POLLING_NRFLAG 16 153 152 #define TIF_USING_IWMMXT 17 154 153 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ ··· 163 164 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 164 165 #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) 165 166 #define _TIF_SECCOMP (1 << TIF_SECCOMP) 166 - #define _TIF_SYSCALL_RESTARTSYS (1 << TIF_SYSCALL_RESTARTSYS) 167 167 168 168 /* Checks for any syscall work in entry-common.S */ 169 - #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ 170 - _TIF_SYSCALL_RESTARTSYS) 169 + #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT) 171 170 172 171 /* 173 172 * Change these and you break ASM code in entry-common.S
+2 -2
arch/arm/kernel/kprobes-test-arm.c
··· 187 187 TEST_BF_R ("mov pc, r",0,2f,"") 188 188 TEST_BF_RR("mov pc, r",0,2f,", asl r",1,0,"") 189 189 TEST_BB( "sub pc, pc, #1b-2b+8") 190 - #if __LINUX_ARM_ARCH__ >= 6 191 - TEST_BB( "sub pc, pc, #1b-2b+8-2") /* UNPREDICTABLE before ARMv6 */ 190 + #if __LINUX_ARM_ARCH__ == 6 && !defined(CONFIG_CPU_V7) 191 + TEST_BB( "sub pc, pc, #1b-2b+8-2") /* UNPREDICTABLE before and after ARMv6 */ 192 192 #endif 193 193 TEST_BB_R( "sub pc, pc, r",14, 1f-2f+8,"") 194 194 TEST_BB_R( "rsb pc, r",14,1f-2f+8,", pc")
+1 -1
arch/arm/kernel/perf_event.c
··· 503 503 event_requires_mode_exclusion(&event->attr)) { 504 504 pr_debug("ARM performance counters do not support " 505 505 "mode exclusion\n"); 506 - return -EPERM; 506 + return -EOPNOTSUPP; 507 507 } 508 508 509 509 /*
-3
arch/arm/kernel/ptrace.c
··· 25 25 #include <linux/regset.h> 26 26 #include <linux/audit.h> 27 27 #include <linux/tracehook.h> 28 - #include <linux/unistd.h> 29 28 30 29 #include <asm/pgtable.h> 31 30 #include <asm/traps.h> ··· 917 918 audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, 918 919 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); 919 920 920 - if (why == 0 && test_and_clear_thread_flag(TIF_SYSCALL_RESTARTSYS)) 921 - scno = __NR_restart_syscall - __NR_SYSCALL_BASE; 922 921 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 923 922 return scno; 924 923
+40 -6
arch/arm/kernel/signal.c
··· 27 27 */ 28 28 #define SWI_SYS_SIGRETURN (0xef000000|(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE)) 29 29 #define SWI_SYS_RT_SIGRETURN (0xef000000|(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE)) 30 + #define SWI_SYS_RESTART (0xef000000|__NR_restart_syscall|__NR_OABI_SYSCALL_BASE) 30 31 31 32 /* 32 33 * With EABI, the syscall number has to be loaded into r7. ··· 45 44 const unsigned long sigreturn_codes[7] = { 46 45 MOV_R7_NR_SIGRETURN, SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN, 47 46 MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN, 47 + }; 48 + 49 + /* 50 + * Either we support OABI only, or we have EABI with the OABI 51 + * compat layer enabled. In the later case we don't know if 52 + * user space is EABI or not, and if not we must not clobber r7. 53 + * Always using the OABI syscall solves that issue and works for 54 + * all those cases. 55 + */ 56 + const unsigned long syscall_restart_code[2] = { 57 + SWI_SYS_RESTART, /* swi __NR_restart_syscall */ 58 + 0xe49df004, /* ldr pc, [sp], #4 */ 48 59 }; 49 60 50 61 /* ··· 605 592 case -ERESTARTNOHAND: 606 593 case -ERESTARTSYS: 607 594 case -ERESTARTNOINTR: 608 - case -ERESTART_RESTARTBLOCK: 609 595 regs->ARM_r0 = regs->ARM_ORIG_r0; 610 596 regs->ARM_pc = restart_addr; 597 + break; 598 + case -ERESTART_RESTARTBLOCK: 599 + regs->ARM_r0 = -EINTR; 611 600 break; 612 601 } 613 602 } ··· 626 611 * debugger has chosen to restart at a different PC. 627 612 */ 628 613 if (regs->ARM_pc == restart_addr) { 629 - if (retval == -ERESTARTNOHAND || 630 - retval == -ERESTART_RESTARTBLOCK 614 + if (retval == -ERESTARTNOHAND 631 615 || (retval == -ERESTARTSYS 632 616 && !(ka.sa.sa_flags & SA_RESTART))) { 633 617 regs->ARM_r0 = -EINTR; 634 618 regs->ARM_pc = continue_addr; 635 619 } 636 - clear_thread_flag(TIF_SYSCALL_RESTARTSYS); 637 620 } 638 621 639 622 handle_signal(signr, &ka, &info, regs); ··· 645 632 * ignore the restart. 646 633 */ 647 634 if (retval == -ERESTART_RESTARTBLOCK 648 - && regs->ARM_pc == restart_addr) 649 - set_thread_flag(TIF_SYSCALL_RESTARTSYS); 635 + && regs->ARM_pc == continue_addr) { 636 + if (thumb_mode(regs)) { 637 + regs->ARM_r7 = __NR_restart_syscall - __NR_SYSCALL_BASE; 638 + regs->ARM_pc -= 2; 639 + } else { 640 + #if defined(CONFIG_AEABI) && !defined(CONFIG_OABI_COMPAT) 641 + regs->ARM_r7 = __NR_restart_syscall; 642 + regs->ARM_pc -= 4; 643 + #else 644 + u32 __user *usp; 645 + 646 + regs->ARM_sp -= 4; 647 + usp = (u32 __user *)regs->ARM_sp; 648 + 649 + if (put_user(regs->ARM_pc, usp) == 0) { 650 + regs->ARM_pc = KERN_RESTART_CODE; 651 + } else { 652 + regs->ARM_sp += 4; 653 + force_sigsegv(0, current); 654 + } 655 + #endif 656 + } 657 + } 650 658 } 651 659 652 660 restore_saved_sigmask();
+2
arch/arm/kernel/signal.h
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 #define KERN_SIGRETURN_CODE (CONFIG_VECTORS_BASE + 0x00000500) 11 + #define KERN_RESTART_CODE (KERN_SIGRETURN_CODE + sizeof(sigreturn_codes)) 11 12 12 13 extern const unsigned long sigreturn_codes[7]; 14 + extern const unsigned long syscall_restart_code[2];
+2
arch/arm/kernel/traps.c
··· 820 820 */ 821 821 memcpy((void *)(vectors + KERN_SIGRETURN_CODE - CONFIG_VECTORS_BASE), 822 822 sigreturn_codes, sizeof(sigreturn_codes)); 823 + memcpy((void *)(vectors + KERN_RESTART_CODE - CONFIG_VECTORS_BASE), 824 + syscall_restart_code, sizeof(syscall_restart_code)); 823 825 824 826 flush_icache_range(vectors, vectors + PAGE_SIZE); 825 827 modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
-1
arch/arm/mach-versatile/pci.c
··· 339 339 static int __init versatile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 340 340 { 341 341 int irq; 342 - int devslot = PCI_SLOT(dev->devfn); 343 342 344 343 /* slot, pin, irq 345 344 * 24 1 27
+1 -1
arch/arm/mm/mm.h
··· 64 64 #ifdef CONFIG_ZONE_DMA 65 65 extern phys_addr_t arm_dma_limit; 66 66 #else 67 - #define arm_dma_limit ((u32)~0) 67 + #define arm_dma_limit ((phys_addr_t)~0) 68 68 #endif 69 69 70 70 extern phys_addr_t arm_lowmem_limit;