Pull arm updates from Russell King: "Updates for 7.3: - add module description for kprobes testing module - remove references to CONFIG_CPU_ARM92x_CPU_IDLE options - expand comment in ARM's __switch_to() Also a number of fixes that missed 7.2: - disable broken eBPF on RiscPC - more BKPT fixes (guys, it's a *very* bad idea when everyone uses the BKPT instruction for their own differing purposes) - another preempt-rt fix, this time for siglock / CPU timers - fix another path where we try to send signals to processes with interrupts disabled - acquire mmap write lock for show_pte() with user faults" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux: ARM: 9480/1: entry: expand comment in __switch_to ARM: 9478/1: Remove references to removed CONFIG_CPU_ARM92x_CPU_IDLE options ARM: 9485/1: mm: acquire mmap write lock around show_pte() for user faults ARM: 9484/1: enable interrupts when unhandled user faults are triggered ARM: 9483/1: select HAVE_POSIX_CPU_TIMERS_TASK_WORK ARM: 9481/2: breakpoint: CFI breakpoints only on demand ARM: 9477/1: Disable broken eBPF JIT on the Risc PC ARM: 9473/1: kprobes: test: add MODULE_DESCRIPTION
Unified · Split
| @@ -99,7 +99,7 @@ config ARM · 98 unmodified lines | |||
| 99 | select HAVE_ARCH_TRACEHOOK | 99 | select HAVE_ARCH_TRACEHOOK |
| 100 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE if ARM_LPAE | 100 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE if ARM_LPAE |
| 101 | select HAVE_ARM_SMCCC if CPU_V7 | 101 | select HAVE_ARM_SMCCC if CPU_V7 |
| 102 | select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 | 102 | select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 && !CPU_32v3 |
| 103 | select HAVE_CONTEXT_TRACKING_USER | 103 | select HAVE_CONTEXT_TRACKING_USER |
| 104 | select HAVE_C_RECORDMCOUNT | 104 | select HAVE_C_RECORDMCOUNT |
| 105 | select HAVE_BUILDTIME_MCOUNT_SORT | 105 | select HAVE_BUILDTIME_MCOUNT_SORT |
| @@ -134,6 +134,7 @@ config ARM · 28 unmodified lines | |||
| 134 | select HAVE_PERF_EVENTS | 134 | select HAVE_PERF_EVENTS |
| 135 | select HAVE_PERF_REGS | 135 | select HAVE_PERF_REGS |
| 136 | select HAVE_PERF_USER_STACK_DUMP | 136 | select HAVE_PERF_USER_STACK_DUMP |
| 137 | select HAVE_POSIX_CPU_TIMERS_TASK_WORK | ||
| 137 | select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE | 138 | select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE |
| 138 | select HAVE_REGS_AND_STACK_ACCESS_API | 139 | select HAVE_REGS_AND_STACK_ACCESS_API |
| 139 | select HAVE_RSEQ | 140 | select HAVE_RSEQ |
| @@ -557,9 +557,16 @@ ENTRY(__switch_to) · 556 unmodified lines | |||
| 557 | ldmia r4, {r4 - sl, fp, ip, lr} @ Load all regs saved previously | 557 | ldmia r4, {r4 - sl, fp, ip, lr} @ Load all regs saved previously |
| 558 | #ifdef CONFIG_VMAP_STACK | 558 | #ifdef CONFIG_VMAP_STACK |
| 559 | @ | 559 | @ |
| 560 | @ Do a dummy read from the new stack while running from the old one so | 560 | @ For a non-lazy mm switch, check_vmalloc_seq() has ensured that |
| 561 | @ that we can rely on do_translation_fault() to fix up any stale PMD | 561 | @ that the active mm's page tables have mappings for the prev |
| 562 | @ entries covering the vmalloc region. | 562 | @ task's stack and the next task's stack. |
| 563 | @ | ||
| 564 | @ For a lazy mm switch the active mm's page tables have mappings | ||
| 565 | @ for the prev task's stack but might not have mappings for the | ||
| 566 | @ new task's stack. Do a dummy read from the new stack while | ||
| 567 | @ running from the old stack so that we can rely on | ||
| 568 | @ do_translation_fault() to populate missing PMD entries covering the | ||
| 569 | @ new task's stack in the old task's page tables. | ||
| 563 | @ | 570 | @ |
| 564 | ldr r2, [ip] | 571 | ldr r2, [ip] |
| 565 | #ifdef CONFIG_KASAN_VMALLOC | 572 | #ifdef CONFIG_KASAN_VMALLOC |
| @@ -929,10 +929,6 @@ static void hw_breakpoint_cfi_handler(struct pt_regs *regs) · 928 unmodified lines | |||
| 929 | break; | 929 | break; |
| 930 | } | 930 | } |
| 931 | } | 931 | } |
| 932 | #else | ||
| 933 | static void hw_breakpoint_cfi_handler(struct pt_regs *regs) | ||
| 934 | { | ||
| 935 | } | ||
| 936 | #endif | 932 | #endif |
| 937 | 933 | ||
| 938 | /* | 934 | /* |
| @@ -964,9 +960,14 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr, · 25 unmodified lines | |||
| 964 | case ARM_ENTRY_SYNC_WATCHPOINT: | 960 | case ARM_ENTRY_SYNC_WATCHPOINT: |
| 965 | watchpoint_handler(addr, fsr, regs); | 961 | watchpoint_handler(addr, fsr, regs); |
| 966 | break; | 962 | break; |
| 963 | #ifdef CONFIG_CFI | ||
| 967 | case ARM_ENTRY_CFI_BREAKPOINT: | 964 | case ARM_ENTRY_CFI_BREAKPOINT: |
| 968 | hw_breakpoint_cfi_handler(regs); | 965 | if (user_mode(regs)) |
| 966 | ret = 1; /* Don't handle userspace BKPT */ | ||
| 967 | else | ||
| 968 | hw_breakpoint_cfi_handler(regs); | ||
| 969 | break; | 969 | break; |
| 970 | #endif | ||
| 970 | default: | 971 | default: |
| 971 | ret = 1; /* Unhandled fault. */ | 972 | ret = 1; /* Unhandled fault. */ |
| 972 | } | 973 | } |
| @@ -181,7 +181,11 @@ __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig, · 180 unmodified lines | |||
| 181 | pr_err("8<--- cut here ---\n"); | 181 | pr_err("8<--- cut here ---\n"); |
| 182 | pr_err("%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n", | 182 | pr_err("%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n", |
| 183 | tsk->comm, sig, addr, fsr); | 183 | tsk->comm, sig, addr, fsr); |
| 184 | show_pte(KERN_ERR, tsk->mm, addr); | 184 | if (likely(addr < TASK_SIZE)) { |
| 185 | mmap_write_lock(tsk->mm); | ||
| 186 | show_pte(KERN_ERR, tsk->mm, addr); | ||
| 187 | mmap_write_unlock(tsk->mm); | ||
| 188 | } | ||
| 185 | show_regs(regs); | 189 | show_regs(regs); |
| 186 | } | 190 | } |
| 187 | #endif | 191 | #endif |
| @@ -633,10 +637,21 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) · 445 unmodified lines | |||
| 633 | if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs)) | 637 | if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs)) |
| 634 | return; | 638 | return; |
| 635 | 639 | ||
| 640 | if (likely(user_mode(regs))) | ||
| 641 | local_irq_enable(); | ||
| 642 | |||
| 636 | pr_alert("8<--- cut here ---\n"); | 643 | pr_alert("8<--- cut here ---\n"); |
| 637 | pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n", | 644 | pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n", |
| 638 | inf->name, fsr, addr); | 645 | inf->name, fsr, addr); |
| 639 | show_pte(KERN_ALERT, current->mm, addr); | 646 | if (likely(user_mode(regs))) { |
| 647 | if (addr < TASK_SIZE) { | ||
| 648 | mmap_write_lock(current->mm); | ||
| 649 | show_pte(KERN_ALERT, current->mm, addr); | ||
| 650 | mmap_write_unlock(current->mm); | ||
| 651 | } | ||
| 652 | } else { | ||
| 653 | show_pte(KERN_ALERT, current->mm, addr); | ||
| 654 | } | ||
| 640 | 655 | ||
| 641 | arm_notify_die("", regs, inf->sig, inf->code, (void __user *)addr, | 656 | arm_notify_die("", regs, inf->sig, inf->code, (void __user *)addr, |
| 642 | fsr, 0); | 657 | fsr, 0); |
| @@ -663,6 +678,9 @@ do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs) · 20 unmodified lines | |||
| 663 | if (!inf->fn(addr, ifsr | FSR_LNX_PF, regs)) | 678 | if (!inf->fn(addr, ifsr | FSR_LNX_PF, regs)) |
| 664 | return; | 679 | return; |
| 665 | 680 | ||
| 681 | if (likely(user_mode(regs))) | ||
| 682 | local_irq_enable(); | ||
| 683 | |||
| 666 | pr_alert("8<--- cut here ---\n"); | 684 | pr_alert("8<--- cut here ---\n"); |
| 667 | pr_alert("Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n", | 685 | pr_alert("Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n", |
| 668 | inf->name, ifsr, addr); | 686 | inf->name, ifsr, addr); |
| @@ -8,8 +8,6 @@ · 7 unmodified lines | |||
| 8 | * | 8 | * |
| 9 | * These are the low level assembler for performing cache and TLB | 9 | * These are the low level assembler for performing cache and TLB |
| 10 | * functions on the arm920. | 10 | * functions on the arm920. |
| 11 | * | ||
| 12 | * CONFIG_CPU_ARM920_CPU_IDLE -> nohlt | ||
| 13 | */ | 11 | */ |
| 14 | #include <linux/linkage.h> | 12 | #include <linux/linkage.h> |
| 15 | #include <linux/init.h> | 13 | #include <linux/init.h> |
| @@ -9,8 +9,6 @@ · 8 unmodified lines | |||
| 9 | * | 9 | * |
| 10 | * These are the low level assembler for performing cache and TLB | 10 | * These are the low level assembler for performing cache and TLB |
| 11 | * functions on the arm922. | 11 | * functions on the arm922. |
| 12 | * | ||
| 13 | * CONFIG_CPU_ARM922_CPU_IDLE -> nohlt | ||
| 14 | */ | 12 | */ |
| 15 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
| 16 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| @@ -15,8 +15,6 @@ · 14 unmodified lines | |||
| 15 | * These are the low level assembler for performing cache and TLB | 15 | * These are the low level assembler for performing cache and TLB |
| 16 | * functions on the arm925. | 16 | * functions on the arm925. |
| 17 | * | 17 | * |
| 18 | * CONFIG_CPU_ARM925_CPU_IDLE -> nohlt | ||
| 19 | * | ||
| 20 | * Some additional notes based on deciphering the TI TRM on OMAP-5910: | 18 | * Some additional notes based on deciphering the TI TRM on OMAP-5910: |
| 21 | * | 19 | * |
| 22 | * NOTE1: The TI925T Configuration Register bit "D-cache clean and flush | 20 | * NOTE1: The TI925T Configuration Register bit "D-cache clean and flush |
| @@ -8,8 +8,6 @@ · 7 unmodified lines | |||
| 8 | * | 8 | * |
| 9 | * These are the low level assembler for performing cache and TLB | 9 | * These are the low level assembler for performing cache and TLB |
| 10 | * functions on the arm926. | 10 | * functions on the arm926. |
| 11 | * | ||
| 12 | * CONFIG_CPU_ARM926_CPU_IDLE -> nohlt | ||
| 13 | */ | 11 | */ |
| 14 | #include <linux/linkage.h> | 12 | #include <linux/linkage.h> |
| 15 | #include <linux/init.h> | 13 | #include <linux/init.h> |
| @@ -1649,24 +1649,16 @@ out: · 1648 unmodified lines | |||
| 1649 | 1649 | ||
| 1650 | return ret; | 1650 | return ret; |
| 1651 | } | 1651 | } |
| 1652 | 1652 | late_initcall(run_all_tests); | |
| 1653 | 1653 | ||
| 1654 | /* | 1654 | /* |
| 1655 | * Module setup | 1655 | * Module setup |
| 1656 | */ | 1656 | */ |
| 1657 | 1657 | ||
| 1658 | #ifdef MODULE | ||
| 1659 | |||
| 1660 | static void __exit kprobe_test_exit(void) | 1658 | static void __exit kprobe_test_exit(void) |
| 1661 | { | 1659 | { |
| 1662 | } | 1660 | } |
| 1663 | |||
| 1664 | module_init(run_all_tests) | ||
| 1665 | module_exit(kprobe_test_exit) | 1661 | module_exit(kprobe_test_exit) |
| 1666 | MODULE_LICENSE("GPL"); | ||
| 1667 | 1662 | ||
| 1668 | #else /* !MODULE */ | 1663 | MODULE_DESCRIPTION("Test code for ARM kprobes"); |
| 1669 | 1664 | MODULE_LICENSE("GPL"); | |
| 1670 | late_initcall(run_all_tests); | ||
| 1671 | |||
| 1672 | #endif | ||