All of lore.kernel.org
 help / color / mirror / Atom feed
From: per.fransson.ml@gmail.com (Per Fransson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Implement cpu_v7_reset.
Date: Mon, 6 Sep 2010 08:58:25 +0000 (UTC)	[thread overview]
Message-ID: <loom.20100906T103236-552@post.gmane.org> (raw)
In-Reply-To: 20100903060443.GM25559@gw.healthdatacare.com

Mika Westerberg <mika.westerberg <at> iki.fi> writes:

> 
> On Thu, Sep 02, 2010 at 04:48:34PM +0300, Mika Westerberg wrote:
> > On Thu, Sep 02, 2010 at 01:18:38PM +0100, Russell King - ARM Linux wrote:
> > > > 
> > > > I tested this patch without that cache invalidate instruction + dsb
> > > > and it still hangs. Exactly the same code works perfectly when it is run
> > > > via 1:1 mapping.
> > > 

How do you run it via a 1-1 mapping? Do you call the physical address of
cpu_reset() from machine_kexec() after calling setup_mm_for_reboot()? I.e.

	outer_inv_all();
	setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
	(virt_to_phys(cpu_reset))(reboot_code_buffer_phys);

In that case, we're relying on two pieces of code being identity mapped,
cpu_v7_reset() and relocate_new_kernel(). I still promote limiting the scope of
setup_mm_for_reboot() to the bare minimum, so as not to destroy the user-space
mapping. If we set up a 1-1 around cpu_reset() for example, couldn't we idle
away there until we are sure the MMU is off and *then* jump to the physical
address of relocate_new_kernel() which wouldn't have to be 1-1 mapped?

>         "After a CP15 c1 instruction disables the MMU, the processor
>         flushes all following instructions in the pipeline. The
>         processor then begins refetching instructions and uses flat
>         address mapping. In flat address mapping, PA = VA."
> 

If this is the case, the Qemu issue I mentioned here

  http://lists.infradead.org/pipermail/linux-arm-kernel/2010-July/019678.html

wasn't so far off the mark after all =o)

Regards,
Per

  reply	other threads:[~2010-09-06  8:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 14:01 [PATCH] ARM: Implement cpu_v7_reset Linus Walleij
2010-09-01 21:18 ` Stephen Boyd
2010-09-02  5:03   ` Uwe Kleine-König
2010-09-02  8:43     ` Russell King - ARM Linux
2010-09-01 23:23 ` Russell King - ARM Linux
2010-09-02  8:34   ` Mika Westerberg
2010-09-02  8:41     ` Russell King - ARM Linux
2010-09-02  8:53       ` Mika Westerberg
2010-09-02 10:39         ` Russell King - ARM Linux
2010-09-02 11:52           ` Mika Westerberg
2010-09-02 12:18             ` Russell King - ARM Linux
2010-09-02 13:48               ` Mika Westerberg
2010-09-03  6:04                 ` Mika Westerberg
2010-09-06  8:58                   ` Per Fransson [this message]
2010-09-06 17:24                     ` Mika Westerberg
2010-09-02 13:30           ` Per Fransson
2010-09-03 18:17             ` Per Fransson

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=loom.20100906T103236-552@post.gmane.org \
    --to=per.fransson.ml@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.