Subject: Re: [PATCH 2/2] powerpc/hibernate: add restore mmu context after resume

From: Scott Wood <[email-masked]>
Date: Fri, 12 Jul 2013 16:54:50 -0500

On 07/11/2013 11:04:23 PM, Wang Dongsheng-B40534 wrote:
>=20
>=20
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Thursday, July 11, 2013 5:43 AM
> > To: Wang Dongsheng-B40534
> > Cc: Wang Dongsheng-B40534; [email-masked]; Wood =20
> Scott-B07421;
> > [email-masked]; [email-masked]; =20
> [email-masked];
> > [email-masked]
> > Subject: Re: [PATCH 2/2] powerpc/hibernate: add restore mmu context =20
> after
> > resume
> >
> > On 07/10/2013 05:11:54 AM, Wang Dongsheng-B40534 wrote:
> > > > +void restore_mmu_context(void)
> > > > +{
> > > > +	struct mm_struct *mm =3D current->active_mm;
> > > > +
> > > > +	set_context(mm->context.id, mm->pgd);
> > > > +
> > > > +	_tlbil_all();
> > > > +}
> > > > +EXPORT_SYMBOL(restore_mmu_context);
> >
> > What about targets that don't use tlb_nohash.c?
> >
> Yes, you are right, if we used PPC_STD_MMU, compilation error will =20
> occur.
> And _tlbil_all should be remove, because all of the tlb already =20
> invalidated in swsusp_*.S .
> So we should invalid tlb in swsusp_asm64.S & swsusp_booke.S on =20
> freescale platform.
>=20
> How about add restore_mmu_context(struct mm_struct* mm) into =20
> "arch/powerpc/include/asm/mmu_context.h"
>=20
> Path: arch/powerpc/include/asm/mmu_context.h
> static void restore_mmu_context(struct mm_struct *mm)
> {
>        set_context(mm->context.id, mm->pgd);
> }

set_context() doesn't exist for hash MMUs.

Whatever you do, please try actually building it on various targets, =20
including both 32 and 64 bits, and both hash and non-hash.  And make =20
sure that whatever effect PPC32 was depending on switch_mmu_context for =20
is preserved, including on non-booke.

-Scott=