[RFC 2/2] Selective MMU identity mapping for kexec

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Dec 15 18:35:58 EST 2010


On Wed, Dec 15, 2010 at 05:39:22PM +0000, Will Deacon wrote:
> Hi Per,
> 
> It's nice to see somebody looking at this!
> 
> On Mon, 2010-11-01 at 19:32 +0100, Per Fransson wrote:
> > Signed-off-by: Per Fransson <per.xx.fransson at stericsson.com>
> > ---
> >  arch/arm/kernel/machine_kexec.c   |   27 +++++++++++++++++++++-
> >  arch/arm/kernel/relocate_kernel.S |   23 +++++++++++++++++++
> >  arch/arm/mm/mmu.c                 |   44 +++++++++++++++++++++++++++++++++++++
> >  arch/arm/mm/proc-v7.S             |    1 +
> >  4 files changed, 94 insertions(+), 1 deletions(-)
> 
> Some parts of this patchset will be useful for implementing CPU hotplug
> on the ARM RealView boards. The idea is to throw cores back to the
> bootloader when they are offlined, so we need to be able to disable the
> MMU safely before we jump.

Beware - you can't replace random pre-existing table entries on a running
SMP system without creating hazards.

> > +	cpu_reset_phys = virt_to_phys(cpu_reset);
> > +	identity_map(cpu_reset_phys, &kexec_mmu_ents[0].store,
> > +		     &kexec_mmu_ents[0].ptr);
> > +	identity_map(((char *)cpu_reset_phys)+PGDIR_SIZE,
> > +		     &kexec_mmu_ents[1].store, &kexec_mmu_ents[1].ptr);
> 
> I think this could become common code as calling cpu_reset will require
> the identity map to be in place now that you have added MMU disable code
> there.

We have an identity mapping function set in the kernel (which has been
recently moved into its own file in my devel branch.)  It would need to
be extended to return the old pmd and pmd pointer to undo.



More information about the linux-arm-kernel mailing list