Skip to content

Commit 5ccd3bd

Browse files
author
Russell King
committed
Merge branches 'fixes' and 'misc'
Fix up the conflict between "VDSO: Drop implicit common-page-size linker flag" and "vdso: pass --be8 to linker if necessary" Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2 parents c5d0e49 + f785b42 commit 5ccd3bd

14 files changed

Lines changed: 107 additions & 19 deletions

File tree

‎arch/arm/Kconfig‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,14 @@ config ARM_ERRATA_825619
11751175
DMB NSHST or DMB ISHST instruction followed by a mix of Cacheable
11761176
and Device/Strongly-Ordered loads and stores might cause deadlock
11771177

1178+
config 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+
11781186
config ARM_ERRATA_852421
11791187
bool "ARM errata: A17: DMB ST might fail to create order between stores"
11801188
depends on CPU_V7
@@ -1196,6 +1204,16 @@ config ARM_ERRATA_852423
11961204
config option from the A12 erratum due to the way errata are checked
11971205
for and handled.
11981206

1207+
config 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+
11991217
endmenu
12001218

12011219
source "arch/arm/common/Kconfig"
@@ -1232,6 +1250,18 @@ config PCI_HOST_ITE8152
12321250
default y
12331251
select DMABOUNCE
12341252

1253+
config 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+
12351265
endmenu
12361266

12371267
menu "Kernel Features"

‎arch/arm/configs/exynos_defconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CONFIG_MODULE_UNLOAD=y
99
CONFIG_PARTITION_ADVANCED=y
1010
CONFIG_ARCH_EXYNOS=y
1111
CONFIG_ARCH_EXYNOS3=y
12+
CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND=y
1213
CONFIG_SMP=y
1314
CONFIG_BIG_LITTLE=y
1415
CONFIG_NR_CPUS=8

‎arch/arm/include/asm/bug.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int,
8585
extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
8686

8787
struct mm_struct;
88-
extern void show_pte(struct mm_struct *mm, unsigned long addr);
88+
void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr);
8989
extern void __show_regs(struct pt_regs *);
9090

9191
#endif

‎arch/arm/include/asm/cacheflush.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,4 +479,11 @@ static inline void __sync_cache_range_r(volatile void *p, size_t size)
479479
void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
480480
void *kaddr, unsigned long len);
481481

482+
483+
#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
484+
void check_cpu_icache_size(int cpuid);
485+
#else
486+
static inline void check_cpu_icache_size(int cpuid) { }
487+
#endif
488+
482489
#endif

‎arch/arm/kernel/smp.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ static void smp_store_cpu_info(unsigned int cpuid)
375375
cpu_info->cpuid = read_cpuid_id();
376376

377377
store_cpu_topology(cpuid);
378+
check_cpu_icache_size(cpuid);
378379
}
379380

380381
/*

‎arch/arm/kernel/traps.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,10 +725,11 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
725725

726726
#ifdef CONFIG_DEBUG_USER
727727
if (user_debug & UDBG_BADABORT) {
728+
pr_err("8<--- cut here ---\n");
728729
pr_err("[%d] %s: bad data abort: code %d instr 0x%08lx\n",
729730
task_pid_nr(current), current->comm, code, instr);
730731
dump_instr(KERN_ERR, regs);
731-
show_pte(current->mm, addr);
732+
show_pte(KERN_ERR, current->mm, addr);
732733
}
733734
#endif
734735

‎arch/arm/mach-stm32/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ if ARCH_MULTI_V7
4444

4545
config MACH_STM32MP157
4646
bool "STMicroelectronics STM32MP157"
47+
select ARM_ERRATA_814220
4748
default y
4849

4950
endif # ARMv7-A

‎arch/arm/mm/Kconfig‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,14 @@ config CPU_ICACHE_DISABLE
780780
Say Y here to disable the processor instruction cache. Unless
781781
you have a reason not to or are unsure, say N.
782782

783+
config 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+
783791
config CPU_DCACHE_DISABLE
784792
bool "Disable D-Cache (C-bit)"
785793
depends on (CPU_CP15 && !SMP) || CPU_V7M

‎arch/arm/mm/cache-v7.S‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919

2020
#include "proc-macros.S"
2121

22+
#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
23+
.globl icache_size
24+
.data
25+
.align 2
26+
icache_size:
27+
.long 64
28+
.text
29+
#endif
2230
/*
2331
* The secondary kernel init calls v7_flush_dcache_all before it enables
2432
* the L1; however, the L1 comes out of reset in an undefined state, so
@@ -163,6 +171,9 @@ loop2:
163171
skip:
164172
add r10, r10, #2 @ increment cache number
165173
cmp r3, r10
174+
#ifdef CONFIG_ARM_ERRATA_814220
175+
dsb
176+
#endif
166177
bgt flush_levels
167178
finished:
168179
mov r10, #0 @ switch back to cache level 0
@@ -284,7 +295,12 @@ ENTRY(v7_coherent_user_range)
284295
cmp r12, r1
285296
blo 1b
286297
dsb ishst
298+
#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
299+
ldr r3, =icache_size
300+
ldr r2, [r3, #0]
301+
#else
287302
icache_line_size r2, r3
303+
#endif
288304
sub r3, r2, #1
289305
bic r12, r0, r3
290306
2:

‎arch/arm/mm/fault.c‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,16 @@ static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
5656
* This is useful to dump out the page tables associated with
5757
* 'addr' in mm 'mm'.
5858
*/
59-
void show_pte(struct mm_struct *mm, unsigned long addr)
59+
void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr)
6060
{
6161
pgd_t *pgd;
6262

6363
if (!mm)
6464
mm = &init_mm;
6565

66-
pr_alert("pgd = %p\n", mm->pgd);
66+
printk("%spgd = %p\n", lvl, mm->pgd);
6767
pgd = pgd_offset(mm, addr);
68-
pr_alert("[%08lx] *pgd=%08llx",
69-
addr, (long long)pgd_val(*pgd));
68+
printk("%s[%08lx] *pgd=%08llx", lvl, addr, (long long)pgd_val(*pgd));
7069

7170
do {
7271
pud_t *pud;
@@ -121,7 +120,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
121120
pr_cont("\n");
122121
}
123122
#else /* CONFIG_MMU */
124-
void show_pte(struct mm_struct *mm, unsigned long addr)
123+
void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr)
125124
{ }
126125
#endif /* CONFIG_MMU */
127126

@@ -142,11 +141,12 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
142141
* No handler, we'll have to terminate things with extreme prejudice.
143142
*/
144143
bust_spinlocks(1);
144+
pr_alert("8<--- cut here ---\n");
145145
pr_alert("Unable to handle kernel %s at virtual address %08lx\n",
146146
(addr < PAGE_SIZE) ? "NULL pointer dereference" :
147147
"paging request", addr);
148148

149-
show_pte(mm, addr);
149+
show_pte(KERN_ALERT, mm, addr);
150150
die("Oops", regs, fsr);
151151
bust_spinlocks(0);
152152
do_exit(SIGKILL);
@@ -167,9 +167,10 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
167167
#ifdef CONFIG_DEBUG_USER
168168
if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) ||
169169
((user_debug & UDBG_BUS) && (sig == SIGBUS))) {
170-
printk(KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n",
170+
pr_err("8<--- cut here ---\n");
171+
pr_err("%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n",
171172
tsk->comm, sig, addr, fsr);
172-
show_pte(tsk->mm, addr);
173+
show_pte(KERN_ERR, tsk->mm, addr);
173174
show_regs(regs);
174175
}
175176
#endif
@@ -556,9 +557,10 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
556557
if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs))
557558
return;
558559

560+
pr_alert("8<--- cut here ---\n");
559561
pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n",
560562
inf->name, fsr, addr);
561-
show_pte(current->mm, addr);
563+
show_pte(KERN_ALERT, current->mm, addr);
562564

563565
arm_notify_die("", regs, inf->sig, inf->code, (void __user *)addr,
564566
fsr, 0);

0 commit comments

Comments
 (0)