linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mreimer@sdgsystems.com (Matt Reimer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] [ARM] pxa: fix page table corruption on resume
Date: Wed, 29 Dec 2010 11:18:29 -0500	[thread overview]
Message-ID: <1293639509-9373-1-git-send-email-mreimer@sdgsystems.com> (raw)
In-Reply-To: <4CF6A7F2.80206@sdgsystems.com>

From: Aric D. Blumer <aric@sdgsystems.com>

Before this patch, the following error would sometimes occur after a
resume on pxa3xx:

    /path/to/mm/memory.c:144: bad pmd 8040542e.

The problem was that a temporary page table mapping was being improperly
restored.

The PXA3xx resume code creates a temporary mapping of resume_turn_on_mmu
to avoid a prefetch abort.  The pxa3xx_resume_after_mmu code requires
that the r1 register holding the address of this mapping not be
modified, however, resume_turn_on_mmu does modify it. It is mostly
correct in that r1 receives the base table address, but it may also
get other bits in 13:0.  This results in pxa3xx_resume_after_mmu
restoring the original mapping to the wrong place, corrupting memory
and leaving the temporary mapping in place.

Signed-off-by: Matt Reimer <mreimer@sdgsystems.com>
---
 arch/arm/mach-pxa/sleep.S |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index 52c30b0..ae00811 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -353,8 +353,8 @@ resume_turn_on_mmu:
 
 	@ Let us ensure we jump to resume_after_mmu only when the mcr above
 	@ actually took effect.  They call it the "cpwait" operation.
-	mrc	p15, 0, r1, c2, c0, 0		@ queue a dependency on CP15
-	sub	pc, r2, r1, lsr #32		@ jump to virtual addr
+	mrc	p15, 0, r0, c2, c0, 0		@ queue a dependency on CP15
+	sub	pc, r2, r0, lsr #32		@ jump to virtual addr
 	nop
 	nop
 	nop
-- 
1.7.0.4

  parent reply	other threads:[~2010-12-29 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01 19:54 bad pmd Aric D. Blumer
2010-12-01 20:14 ` Russell King - ARM Linux
2010-12-02  2:35   ` Aric D. Blumer
2010-12-07 17:26     ` Aric D. Blumer
2010-12-08 14:02       ` Russell King - ARM Linux
2010-12-14 15:08         ` Matt Reimer
2010-12-29  4:51           ` Eric Miao
2010-12-29 16:23             ` Matt Reimer
2011-01-02 23:51               ` Russell King - ARM Linux
2010-12-29 16:18 ` Matt Reimer [this message]
2011-01-03 15:47   ` [PATCH] [ARM] pxa: fix page table corruption on resume Eric Miao

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=1293639509-9373-1-git-send-email-mreimer@sdgsystems.com \
    --to=mreimer@sdgsystems.com \
    --cc=linux-arm-kernel@lists.infradead.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).