[PATCH] ARM: Implement cpu_v7_reset.
Per Fransson
per.fransson.ml at gmail.com
Mon Sep 6 04:58:25 EDT 2010
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
More information about the linux-arm-kernel
mailing list