Commit 3a9570ea authored by Russell King's avatar Russell King Committed by Greg Kroah-Hartman

ARM: invalidate L1 before enabling coherency

commit bac51ad9 upstream.

We must invalidate the L1 cache before enabling coherency, otherwise
secondary CPUs can inject invalid cache lines into the coherent CPU
cluster, which could then be migrated to other CPUs.  This fixes a
recent regression with SoCFPGA randomly failing to boot.

Fixes: 02b4e275 ("ARM: v7 setup function should invalidate L1 cache")
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Cc: Alexander Kochetkov <al.kochet@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a3595b86
...@@ -268,7 +268,10 @@ __v7_ca15mp_setup: ...@@ -268,7 +268,10 @@ __v7_ca15mp_setup:
__v7_b15mp_setup: __v7_b15mp_setup:
__v7_ca17mp_setup: __v7_ca17mp_setup:
mov r10, #0 mov r10, #0
1: 1: adr r12, __v7_setup_stack @ the local stack
stmia r12, {r0-r5, lr} @ v7_invalidate_l1 touches r0-r6
bl v7_invalidate_l1
ldmia r12, {r0-r5, lr}
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
ALT_SMP(mrc p15, 0, r0, c1, c0, 1) ALT_SMP(mrc p15, 0, r0, c1, c0, 1)
ALT_UP(mov r0, #(1 << 6)) @ fake it for UP ALT_UP(mov r0, #(1 << 6)) @ fake it for UP
...@@ -277,7 +280,7 @@ __v7_ca17mp_setup: ...@@ -277,7 +280,7 @@ __v7_ca17mp_setup:
orreq r0, r0, r10 @ Enable CPU-specific SMP bits orreq r0, r0, r10 @ Enable CPU-specific SMP bits
mcreq p15, 0, r0, c1, c0, 1 mcreq p15, 0, r0, c1, c0, 1
#endif #endif
b __v7_setup b __v7_setup_cont
__v7_pj4b_setup: __v7_pj4b_setup:
#ifdef CONFIG_CPU_PJ4B #ifdef CONFIG_CPU_PJ4B
...@@ -335,10 +338,11 @@ __v7_pj4b_setup: ...@@ -335,10 +338,11 @@ __v7_pj4b_setup:
__v7_setup: __v7_setup:
adr r12, __v7_setup_stack @ the local stack adr r12, __v7_setup_stack @ the local stack
stmia r12, {r0-r5, r7, r9, r11, lr} stmia r12, {r0-r5, lr} @ v7_invalidate_l1 touches r0-r6
bl v7_invalidate_l1 bl v7_invalidate_l1
ldmia r12, {r0-r5, r7, r9, r11, lr} ldmia r12, {r0-r5, lr}
__v7_setup_cont:
mrc p15, 0, r0, c0, c0, 0 @ read main ID register mrc p15, 0, r0, c0, c0, 0 @ read main ID register
and r10, r0, #0xff000000 @ ARM? and r10, r0, #0xff000000 @ ARM?
teq r10, #0x41000000 teq r10, #0x41000000
...@@ -460,7 +464,7 @@ ENDPROC(__v7_setup) ...@@ -460,7 +464,7 @@ ENDPROC(__v7_setup)
.align 2 .align 2
__v7_setup_stack: __v7_setup_stack:
.space 4 * 11 @ 11 registers .space 4 * 7 @ 12 registers
__INITDATA __INITDATA
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment