From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: using identity_mapping_add & switching MMU state - how ?
Date: Thu, 2 Jun 2011 21:16:11 +0100 [thread overview]
Message-ID: <20110602201611.GA10532@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <alpine.DEB.2.00.1106021621400.2311@localhost6.localdomain6>
On Thu, Jun 02, 2011 at 04:44:02PM +0100, Frank Hofmann wrote:
> I'm trying to find a way to do an MMU off / on transition.
>
> What I want to do is to call cpu_do_resume() from the hibernation restore
> codepath.
>
> I've succeeded to make this work by adding a test whether the MMU is
> already on when cpu_resume_mmu() is called.
I think you're making things more complicated than they need to be.
> I'm not sure that sort of thing is proper; hence I've been trying to find
> a way to disable the MMU before calling cpu_do_resume().
Well, I don't really condone using cpu_do_resume() outside of its
original context of arch/arm/kernel/sleep.S - the two were written
to work together, and the processor specific bit is not really
designed to be used separately.
> Can't seem to get this to work though; even though I'm creating a
> separate MMU context that's given 1:1 mappings for all of kernel
> code/data, execution still hangs as soon as I enable the code section
> below that switches the MMU off.
I'm not surprised - cpu_do_resume() has some special entry requirements
which are not obvious by way of the rest of the code in
arch/arm/kernel/sleep.S. As I say, cpu_do_resume is not designed to be
used by other code other than what's in that file.
But... it requires the v:p offset in r1, and the _virtual_ address of
the code to continue at in lr. These are specifically saved for it by
cpu_suspend in arch/arm/kernel/sleep.S.
next prev parent reply other threads:[~2011-06-02 20:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-02 15:44 using identity_mapping_add & switching MMU state - how ? Frank Hofmann
2011-06-02 16:20 ` Will Deacon
2011-06-02 16:22 ` Dave Martin
2011-06-02 16:46 ` Frank Hofmann
2011-06-02 18:07 ` Lorenzo Pieralisi
2011-06-03 12:20 ` Frank Hofmann
2011-06-02 20:16 ` Russell King - ARM Linux [this message]
2011-06-03 10:44 ` Frank Hofmann
2011-06-03 15:56 ` Frank Hofmann
2011-06-03 23:53 ` Russell King - ARM Linux
2011-06-06 16:32 ` Frank Hofmann
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=20110602201611.GA10532@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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).