summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 00:08:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-09 00:08:34 -0400
commit2b49350b16fa3171136d7cf351ac7e9e6673b8f2 (patch)
treefaccf2e838b415951db5de3b199abbf2697aab26
parent4d2fa8b44b891f0da5ceda3e5a1402ccf0ab6f26 (diff)
parent5ccd3bd992cf668b5a6fa1713da7b443a35e2930 (diff)
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: - Add a "cut here" to make it clearer where oops dumps should be cut from - we already have a marker for the end of the dumps. - Add logging severity to show_pte() - Drop unnecessary common-page-size linker flag - Errata workarounds for Cortex A12 857271, Cortex A17 857272 and Cortex A7 814220. - Remove some unused variables that had started to provoke a compiler warning. * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8863/1: stm32: select ARM errata 814220 ARM: 8862/1: errata: 814220-B-Cache maintenance by set/way operations can execute out of order ARM: 8865/1: mm: remove unused variables ARM: 8864/1: Add workaround for I-Cache line size mismatch between CPU cores ARM: 8861/1: errata: Workaround errata A12 857271 / A17 857272 ARM: 8860/1: VDSO: Drop implicit common-page-size linker flag ARM: arrange show_pte() to issue severity-based messages ARM: add "8<--- cut here ---" to kernel dumps
-rw-r--r--arch/arm/Kconfig30
-rw-r--r--arch/arm/configs/exynos_defconfig1
-rw-r--r--arch/arm/include/asm/bug.h2
-rw-r--r--arch/arm/include/asm/cacheflush.h7
-rw-r--r--arch/arm/kernel/smp.c1
-rw-r--r--arch/arm/kernel/traps.c3
-rw-r--r--arch/arm/mach-stm32/Kconfig1
-rw-r--r--arch/arm/mm/Kconfig8
-rw-r--r--arch/arm/mm/cache-v7.S16
-rw-r--r--arch/arm/mm/fault.c20
-rw-r--r--arch/arm/mm/init.c22
-rw-r--r--arch/arm/mm/mm.h2
-rw-r--r--arch/arm/mm/proc-v7.S10
-rw-r--r--arch/arm/vdso/Makefile3
14 files changed, 107 insertions, 19 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 8869742a85df..c87cc9a6fb3c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1175,6 +1175,14 @@ config ARM_ERRATA_825619
1175 DMB NSHST or DMB ISHST instruction followed by a mix of Cacheable 1175 DMB NSHST or DMB ISHST instruction followed by a mix of Cacheable
1176 and Device/Strongly-Ordered loads and stores might cause deadlock 1176 and Device/Strongly-Ordered loads and stores might cause deadlock
1177 1177
1178config ARM_ERRATA_857271
1179 bool "ARM errata: A12: CPU might deadlock under some very rare internal conditions"
1180 depends on CPU_V7
1181 help
1182 This option enables the workaround for the 857271 Cortex-A12
1183 (all revs) erratum. Under very rare timing conditions, the CPU might
1184 hang. The workaround is expected to have a < 1% performance impact.
1185
1178config ARM_ERRATA_852421 1186config ARM_ERRATA_852421
1179 bool "ARM errata: A17: DMB ST might fail to create order between stores" 1187 bool "ARM errata: A17: DMB ST might fail to create order between stores"
1180 depends on CPU_V7 1188 depends on CPU_V7
@@ -1196,6 +1204,16 @@ config ARM_ERRATA_852423
1196 config option from the A12 erratum due to the way errata are checked 1204 config option from the A12 erratum due to the way errata are checked
1197 for and handled. 1205 for and handled.
1198 1206
1207config ARM_ERRATA_857272
1208 bool "ARM errata: A17: CPU might deadlock under some very rare internal conditions"
1209 depends on CPU_V7
1210 help
1211 This option enables the workaround for the 857272 Cortex-A17 erratum.
1212 This erratum is not known to be fixed in any A17 revision.
1213 This is identical to Cortex-A12 erratum 857271. It is a separate
1214 config option from the A12 erratum due to the way errata are checked
1215 for and handled.
1216
1199endmenu 1217endmenu
1200 1218
1201source "arch/arm/common/Kconfig" 1219source "arch/arm/common/Kconfig"
@@ -1232,6 +1250,18 @@ config PCI_HOST_ITE8152
1232 default y 1250 default y
1233 select DMABOUNCE 1251 select DMABOUNCE
1234 1252
1253config ARM_ERRATA_814220
1254 bool "ARM errata: Cache maintenance by set/way operations can execute out of order"
1255 depends on CPU_V7
1256 help
1257 The v7 ARM states that all cache and branch predictor maintenance
1258 operations that do not specify an address execute, relative to
1259 each other, in program order.
1260 However, because of this erratum, an L2 set/way cache maintenance
1261 operation can overtake an L1 set/way cache maintenance operation.
1262 This ERRATA only affected the Cortex-A7 and present in r0p2, r0p3,
1263 r0p4, r0p5.
1264
1235endmenu 1265endmenu
1236 1266
1237menu "Kernel Features" 1267menu "Kernel Features"
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
index c95c54284da2..9b959afaaa12 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -9,6 +9,7 @@ CONFIG_MODULE_UNLOAD=y
9CONFIG_PARTITION_ADVANCED=y 9CONFIG_PARTITION_ADVANCED=y
10CONFIG_ARCH_EXYNOS=y 10CONFIG_ARCH_EXYNOS=y
11CONFIG_ARCH_EXYNOS3=y 11CONFIG_ARCH_EXYNOS3=y
12CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND=y
12CONFIG_SMP=y 13CONFIG_SMP=y
13CONFIG_BIG_LITTLE=y 14CONFIG_BIG_LITTLE=y
14CONFIG_NR_CPUS=8 15CONFIG_NR_CPUS=8
diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index 36c951dd23b8..deef4d0cb3b5 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -85,7 +85,7 @@ void hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int,
85extern asmlinkage void c_backtrace(unsigned long fp, int pmode); 85extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
86 86
87struct mm_struct; 87struct mm_struct;
88extern void show_pte(struct mm_struct *mm, unsigned long addr); 88void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr);
89extern void __show_regs(struct pt_regs *); 89extern void __show_regs(struct pt_regs *);
90 90
91#endif 91#endif
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index d6667b8cfca5..7114b9aa46b8 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -476,4 +476,11 @@ static inline void __sync_cache_range_r(volatile void *p, size_t size)
476void flush_uprobe_xol_access(struct page *page, unsigned long uaddr, 476void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
477 void *kaddr, unsigned long len); 477 void *kaddr, unsigned long len);
478 478
479
480#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
481void check_cpu_icache_size(int cpuid);
482#else
483static inline void check_cpu_icache_size(int cpuid) { }
484#endif
485
479#endif 486#endif
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index a137608cd197..aab8ba40ce38 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -372,6 +372,7 @@ static void smp_store_cpu_info(unsigned int cpuid)
372 cpu_info->cpuid = read_cpuid_id(); 372 cpu_info->cpuid = read_cpuid_id();
373 373
374 store_cpu_topology(cpuid); 374 store_cpu_topology(cpuid);
375 check_cpu_icache_size(cpuid);
375} 376}
376 377
377/* 378/*
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 7e2f1cba84e5..b6d6b1a6f156 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -722,10 +722,11 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
722 722
723#ifdef CONFIG_DEBUG_USER 723#ifdef CONFIG_DEBUG_USER
724 if (user_debug & UDBG_BADABORT) { 724 if (user_debug & UDBG_BADABORT) {
725 pr_err("8<--- cut here ---\n");
725 pr_err("[%d] %s: bad data abort: code %d instr 0x%08lx\n", 726 pr_err("[%d] %s: bad data abort: code %d instr 0x%08lx\n",
726 task_pid_nr(current), current->comm, code, instr); 727 task_pid_nr(current), current->comm, code, instr);
727 dump_instr(KERN_ERR, regs); 728 dump_instr(KERN_ERR, regs);
728 show_pte(current->mm, addr); 729 show_pte(KERN_ERR, current->mm, addr);
729 } 730 }
730#endif 731#endif
731 732
diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig
index 36e6c68c0b57..05d6b5aada80 100644
--- a/arch/arm/mach-stm32/Kconfig
+++ b/arch/arm/mach-stm32/Kconfig
@@ -44,6 +44,7 @@ if ARCH_MULTI_V7
44 44
45config MACH_STM32MP157 45config MACH_STM32MP157
46 bool "STMicroelectronics STM32MP157" 46 bool "STMicroelectronics STM32MP157"
47 select ARM_ERRATA_814220
47 default y 48 default y
48 49
49endif # ARMv7-A 50endif # ARMv7-A
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index b169e580bf82..cc798115aa9b 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -780,6 +780,14 @@ config CPU_ICACHE_DISABLE
780 Say Y here to disable the processor instruction cache. Unless 780 Say Y here to disable the processor instruction cache. Unless
781 you have a reason not to or are unsure, say N. 781 you have a reason not to or are unsure, say N.
782 782
783config CPU_ICACHE_MISMATCH_WORKAROUND
784 bool "Workaround for I-Cache line size mismatch between CPU cores"
785 depends on SMP && CPU_V7
786 help
787 Some big.LITTLE systems have I-Cache line size mismatch between
788 LITTLE and big cores. Say Y here to enable a workaround for
789 proper I-Cache support on such systems. If unsure, say N.
790
783config CPU_DCACHE_DISABLE 791config CPU_DCACHE_DISABLE
784 bool "Disable D-Cache (C-bit)" 792 bool "Disable D-Cache (C-bit)"
785 depends on (CPU_CP15 && !SMP) || CPU_V7M 793 depends on (CPU_CP15 && !SMP) || CPU_V7M
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index 8c83b4586883..0ee8fc4b4672 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -16,6 +16,14 @@
16 16
17#include "proc-macros.S" 17#include "proc-macros.S"
18 18
19#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
20.globl icache_size
21 .data
22 .align 2
23icache_size:
24 .long 64
25 .text
26#endif
19/* 27/*
20 * The secondary kernel init calls v7_flush_dcache_all before it enables 28 * The secondary kernel init calls v7_flush_dcache_all before it enables
21 * the L1; however, the L1 comes out of reset in an undefined state, so 29 * the L1; however, the L1 comes out of reset in an undefined state, so
@@ -160,6 +168,9 @@ loop2:
160skip: 168skip:
161 add r10, r10, #2 @ increment cache number 169 add r10, r10, #2 @ increment cache number
162 cmp r3, r10 170 cmp r3, r10
171#ifdef CONFIG_ARM_ERRATA_814220
172 dsb
173#endif
163 bgt flush_levels 174 bgt flush_levels
164finished: 175finished:
165 mov r10, #0 @ switch back to cache level 0 176 mov r10, #0 @ switch back to cache level 0
@@ -281,7 +292,12 @@ ENTRY(v7_coherent_user_range)
281 cmp r12, r1 292 cmp r12, r1
282 blo 1b 293 blo 1b
283 dsb ishst 294 dsb ishst
295#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
296 ldr r3, =icache_size
297 ldr r2, [r3, #0]
298#else
284 icache_line_size r2, r3 299 icache_line_size r2, r3
300#endif
285 sub r3, r2, #1 301 sub r3, r2, #1
286 bic r12, r0, r3 302 bic r12, r0, r3
2872: 3032:
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 0048eadd0681..ec83c8fca62d 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -53,17 +53,16 @@ static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
53 * This is useful to dump out the page tables associated with 53 * This is useful to dump out the page tables associated with
54 * 'addr' in mm 'mm'. 54 * 'addr' in mm 'mm'.
55 */ 55 */
56void show_pte(struct mm_struct *mm, unsigned long addr) 56void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr)
57{ 57{
58 pgd_t *pgd; 58 pgd_t *pgd;
59 59
60 if (!mm) 60 if (!mm)
61 mm = &init_mm; 61 mm = &init_mm;
62 62
63 pr_alert("pgd = %p\n", mm->pgd); 63 printk("%spgd = %p\n", lvl, mm->pgd);
64 pgd = pgd_offset(mm, addr); 64 pgd = pgd_offset(mm, addr);
65 pr_alert("[%08lx] *pgd=%08llx", 65 printk("%s[%08lx] *pgd=%08llx", lvl, addr, (long long)pgd_val(*pgd));
66 addr, (long long)pgd_val(*pgd));
67 66
68 do { 67 do {
69 pud_t *pud; 68 pud_t *pud;
@@ -118,7 +117,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
118 pr_cont("\n"); 117 pr_cont("\n");
119} 118}
120#else /* CONFIG_MMU */ 119#else /* CONFIG_MMU */
121void show_pte(struct mm_struct *mm, unsigned long addr) 120void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr)
122{ } 121{ }
123#endif /* CONFIG_MMU */ 122#endif /* CONFIG_MMU */
124 123
@@ -139,11 +138,12 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
139 * No handler, we'll have to terminate things with extreme prejudice. 138 * No handler, we'll have to terminate things with extreme prejudice.
140 */ 139 */
141 bust_spinlocks(1); 140 bust_spinlocks(1);
141 pr_alert("8<--- cut here ---\n");
142 pr_alert("Unable to handle kernel %s at virtual address %08lx\n", 142 pr_alert("Unable to handle kernel %s at virtual address %08lx\n",
143 (addr < PAGE_SIZE) ? "NULL pointer dereference" : 143 (addr < PAGE_SIZE) ? "NULL pointer dereference" :
144 "paging request", addr); 144 "paging request", addr);
145 145
146 show_pte(mm, addr); 146 show_pte(KERN_ALERT, mm, addr);
147 die("Oops", regs, fsr); 147 die("Oops", regs, fsr);
148 bust_spinlocks(0); 148 bust_spinlocks(0);
149 do_exit(SIGKILL); 149 do_exit(SIGKILL);
@@ -164,9 +164,10 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
164#ifdef CONFIG_DEBUG_USER 164#ifdef CONFIG_DEBUG_USER
165 if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) || 165 if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) ||
166 ((user_debug & UDBG_BUS) && (sig == SIGBUS))) { 166 ((user_debug & UDBG_BUS) && (sig == SIGBUS))) {
167 printk(KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n", 167 pr_err("8<--- cut here ---\n");
168 pr_err("%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n",
168 tsk->comm, sig, addr, fsr); 169 tsk->comm, sig, addr, fsr);
169 show_pte(tsk->mm, addr); 170 show_pte(KERN_ERR, tsk->mm, addr);
170 show_regs(regs); 171 show_regs(regs);
171 } 172 }
172#endif 173#endif
@@ -553,9 +554,10 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
553 if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs)) 554 if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs))
554 return; 555 return;
555 556
557 pr_alert("8<--- cut here ---\n");
556 pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n", 558 pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n",
557 inf->name, fsr, addr); 559 inf->name, fsr, addr);
558 show_pte(current->mm, addr); 560 show_pte(KERN_ALERT, current->mm, addr);
559 561
560 arm_notify_die("", regs, inf->sig, inf->code, (void __user *)addr, 562 arm_notify_die("", regs, inf->sig, inf->code, (void __user *)addr,
561 fsr, 0); 563 fsr, 0);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 749a5a6f6143..4920a206dce9 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -239,6 +239,22 @@ static void __init arm_initrd_init(void)
239#endif 239#endif
240} 240}
241 241
242#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
243void check_cpu_icache_size(int cpuid)
244{
245 u32 size, ctr;
246
247 asm("mrc p15, 0, %0, c0, c0, 1" : "=r" (ctr));
248
249 size = 1 << ((ctr & 0xf) + 2);
250 if (cpuid != 0 && icache_size != size)
251 pr_info("CPU%u: detected I-Cache line size mismatch, workaround enabled\n",
252 cpuid);
253 if (icache_size > size)
254 icache_size = size;
255}
256#endif
257
242void __init arm_memblock_init(const struct machine_desc *mdesc) 258void __init arm_memblock_init(const struct machine_desc *mdesc)
243{ 259{
244 /* Register the kernel text, kernel data and initrd with memblock. */ 260 /* Register the kernel text, kernel data and initrd with memblock. */
@@ -447,12 +463,6 @@ static void __init free_highpages(void)
447 */ 463 */
448void __init mem_init(void) 464void __init mem_init(void)
449{ 465{
450#ifdef CONFIG_HAVE_TCM
451 /* These pointers are filled in on TCM detection */
452 extern u32 dtcm_end;
453 extern u32 itcm_end;
454#endif
455
456 set_max_mapnr(pfn_to_page(max_pfn) - mem_map); 466 set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
457 467
458 /* this will put all unused low memory onto the freelists */ 468 /* this will put all unused low memory onto the freelists */
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index 6b045c6653ea..941356d95a67 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -8,6 +8,8 @@
8/* the upper-most page table pointer */ 8/* the upper-most page table pointer */
9extern pmd_t *top_pmd; 9extern pmd_t *top_pmd;
10 10
11extern int icache_size;
12
11/* 13/*
12 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture 14 * 0xffff8000 to 0xffffffff is reserved for any ARM architecture
13 * specific hacks for copying pages efficiently, while 0xffff4000 15 * specific hacks for copying pages efficiently, while 0xffff4000
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 83741c31757d..c4e8006a1a8c 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -389,6 +389,11 @@ __ca12_errata:
389 orr r10, r10, #1 << 24 @ set bit #24 389 orr r10, r10, #1 << 24 @ set bit #24
390 mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register 390 mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register
391#endif 391#endif
392#ifdef CONFIG_ARM_ERRATA_857271
393 mrc p15, 0, r10, c15, c0, 1 @ read diagnostic register
394 orr r10, r10, #3 << 10 @ set bits #10 and #11
395 mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register
396#endif
392 b __errata_finish 397 b __errata_finish
393 398
394__ca17_errata: 399__ca17_errata:
@@ -404,6 +409,11 @@ __ca17_errata:
404 orrle r10, r10, #1 << 12 @ set bit #12 409 orrle r10, r10, #1 << 12 @ set bit #12
405 mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register 410 mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register
406#endif 411#endif
412#ifdef CONFIG_ARM_ERRATA_857272
413 mrc p15, 0, r10, c15, c0, 1 @ read diagnostic register
414 orr r10, r10, #3 << 10 @ set bits #10 and #11
415 mcr p15, 0, r10, c15, c0, 1 @ write diagnostic register
416#endif
407 b __errata_finish 417 b __errata_finish
408 418
409__v7_pj4b_setup: 419__v7_pj4b_setup:
diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile
index 1f5ec9741e6d..ca85df247775 100644
--- a/arch/arm/vdso/Makefile
+++ b/arch/arm/vdso/Makefile
@@ -12,8 +12,7 @@ ccflags-y += -DDISABLE_BRANCH_PROFILING
12 12
13ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8 13ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8
14ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \ 14ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
15 -z max-page-size=4096 -z common-page-size=4096 \ 15 -z max-page-size=4096 -nostdlib -shared $(ldflags-y) \
16 -nostdlib -shared $(ldflags-y) \
17 $(call ld-option, --hash-style=sysv) \ 16 $(call ld-option, --hash-style=sysv) \
18 $(call ld-option, --build-id) \ 17 $(call ld-option, --build-id) \
19 -T 18 -T