stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Kochetkov <al.kochet@gmail.com>
To: linux@arm.linux.org.uk, stable@vger.kernel.org
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Subject: [PATCH] ARM: invalidate L1 before enabling coherency
Date: Sat, 15 Aug 2015 14:50:39 +0400	[thread overview]
Message-ID: <1439635839-8001-2-git-send-email-al.kochet@gmail.com> (raw)
In-Reply-To: <1439635839-8001-1-git-send-email-al.kochet@gmail.com>

From: Russell King <rmk+kernel@arm.linux.org.uk>

commit bac51ad9d14f6baed3730ef53bedc1eb2238563a 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: 02b4e2756e01 ("ARM: v7 setup function should invalidate L1 cache")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/mm/proc-v7.S |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 75ae721..7911f14 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -268,7 +268,10 @@ __v7_ca15mp_setup:
 __v7_b15mp_setup:
 __v7_ca17mp_setup:
 	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
 	ALT_SMP(mrc	p15, 0, r0, c1, c0, 1)
 	ALT_UP(mov	r0, #(1 << 6))		@ fake it for UP
@@ -277,7 +280,7 @@ __v7_ca17mp_setup:
 	orreq	r0, r0, r10			@ Enable CPU-specific SMP bits
 	mcreq	p15, 0, r0, c1, c0, 1
 #endif
-	b	__v7_setup
+	b	__v7_setup_cont
 
 __v7_pj4b_setup:
 #ifdef CONFIG_CPU_PJ4B
@@ -335,10 +338,11 @@ __v7_pj4b_setup:
 
 __v7_setup:
 	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
-	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
 	and	r10, r0, #0xff000000		@ ARM?
 	teq	r10, #0x41000000
@@ -460,7 +464,7 @@ ENDPROC(__v7_setup)
 
 	.align	2
 __v7_setup_stack:
-	.space	4 * 11				@ 11 registers
+	.space	4 * 7				@ 12 registers
 
 	__INITDATA
 
-- 
1.7.9.5


  reply	other threads:[~2015-08-15 10:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-15  0:32 [PATCH 0/3] Patches to apply to v4.1-stable Alexander Kochetkov
2015-08-15  0:32 ` [PATCH 1/3] ARM: 8385/1: VDSO: group link options Alexander Kochetkov
2015-08-19 21:05   ` Nathan Lynch
2015-08-15  0:32 ` [PATCH 2/3] ARM: 8384/1: VDSO: force use of BFD linker Alexander Kochetkov
2015-08-15  0:32 ` [PATCH 3/3] ARM: v7 setup function should invalidate L1 cache Alexander Kochetkov
2015-08-15  8:00   ` Russell King - ARM Linux
2015-08-15 10:50     ` Alexander Kochetkov
2015-08-15 10:50       ` Alexander Kochetkov [this message]
2015-09-11  6:11 ` [PATCH 0/3] Patches to apply to v4.1-stable Greg KH
2015-09-12 11:59   ` Alexander Kochetkov
2015-09-12 15:51     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439635839-8001-2-git-send-email-al.kochet@gmail.com \
    --to=al.kochet@gmail.com \
    --cc=linux@arm.linux.org.uk \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).