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