linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: proc-v7: pc phy addresses before disable MMU
@ 2011-09-24  8:02 Per Forlin
  2011-09-24  8:06 ` Russell King - ARM Linux
  2011-09-24  8:13 ` Mika Westerberg
  0 siblings, 2 replies; 12+ messages in thread
From: Per Forlin @ 2011-09-24  8:02 UTC (permalink / raw)
  To: linux-arm-kernel

PC runs virtual addresses when calling cpu_v7_reset(). The MMU
is switched off and "mov pc, r0" sets pc back to
virtual addresses even though the MMU is switched off.
This will result in a crash if the pipeline delay after
MMU disable is one instruction. To prevent this set PC
to physical addresses before disabling the MMU.

Signed-off-by: Per Fransson <per.xx.fransson@stericsson.com>
Signed-off-by: Per Forlin <per.forlin@stericsson.com>
---
 arch/arm/mm/proc-v7.S |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 9049c07..f26e831 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -64,6 +64,7 @@ ENDPROC(cpu_v7_proc_fin)
  */
 	.align	5
 ENTRY(cpu_v7_reset)
+	sub	pc, pc, #PAGE_OFFSET+4		@ go to physical addresses
 	mrc	p15, 0, r1, c1, c0, 0		@ ctrl register
 	bic	r1, r1, #0x1			@ ...............m
  THUMB(	bic	r1, r1, #1 << 30 )		@ SCTLR.TE (Thumb exceptions)
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-10-03 14:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-24  8:02 [PATCH] arm: proc-v7: pc phy addresses before disable MMU Per Forlin
2011-09-24  8:06 ` Russell King - ARM Linux
2011-09-24  8:13 ` Mika Westerberg
2011-09-24  9:32   ` Per Förlin
2011-09-24 11:00     ` Will Deacon
2011-09-24 12:55       ` Per Förlin
2011-09-24 13:02         ` Russell King - ARM Linux
2011-09-30  5:37           ` Per Förlin
2011-09-30  8:34             ` Will Deacon
2011-09-30  9:34               ` Per Förlin
2011-09-30  9:38                 ` Will Deacon
2011-10-03 14:32     ` Dave Martin

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).