All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Wang Dongsheng-B40534 <B40534@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
	"anton@enomsg.org" <anton@enomsg.org>,
	Wang Dongsheng-B40534 <B40534@freescale.com>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 2/2] powerpc/hibernate: add restore mmu context after resume
Date: Wed, 10 Jul 2013 16:42:57 -0500	[thread overview]
Message-ID: <1373492577.8183.235@snotra> (raw)
In-Reply-To: <ABB05CD9C9F68C46A5CEDC7F15439259FBECEC@039-SN2MPN1-022.039d.mgd.msft.net> (from B40534@freescale.com on Wed Jul 10 05:11:54 2013)

On 07/10/2013 05:11:54 AM, Wang Dongsheng-B40534 wrote:
> Hi scott & ben,
>=20
> About this patch do you have any suggestions?
>=20
> Thanks
>=20
> - dongsheng
>=20
> > -----Original Message-----
> > From: Wang Dongsheng-B40534
> > Sent: Sunday, June 09, 2013 6:38 PM
> > To: benh@kernel.crashing.org
> > Cc: johannes@sipsolutions.net; anton@enomsg.org; Wood Scott-B07421;
> > galak@kernel.crashing.org; linuxppc-dev@lists.ozlabs.org; Wang =20
> Dongsheng-
> > B40534
> > Subject: [PATCH 2/2] powerpc/hibernate: add restore mmu context =20
> after
> > resume
> >
> > add restore_mmu_context to replace switch_mmu_context in
> > restore_processor_state, because the switch_mmu_context will do
> > a whole pile of stuff that are probably completely unnecessary.
> >
> > There just need to restore the existing process context, and
> > invalidate TLB for boot core.
> >
> > Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
> > ---
> >  arch/powerpc/include/asm/tlbflush.h |  2 ++
> >  arch/powerpc/kernel/swsusp.c        |  4 +---
> >  arch/powerpc/mm/tlb_nohash.c        | 12 ++++++++++++
> >  3 files changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/powerpc/include/asm/tlbflush.h
> > b/arch/powerpc/include/asm/tlbflush.h
> > index 61a5927..c401fe3 100644
> > --- a/arch/powerpc/include/asm/tlbflush.h
> > +++ b/arch/powerpc/include/asm/tlbflush.h
> > @@ -44,6 +44,8 @@ extern void local_flush_tlb_page(struct =20
> vm_area_struct
> > *vma, unsigned long vmadd
> >  extern void __local_flush_tlb_page(struct mm_struct *mm, unsigned =20
> long
> > vmaddr,
> >  				   int tsize, int ind);
> >
> > +extern void restore_mmu_context(void);
> > +
> >  #ifdef CONFIG_SMP
> >  extern void flush_tlb_mm(struct mm_struct *mm);
> >  extern void flush_tlb_page(struct vm_area_struct *vma, unsigned =20
> long
> > vmaddr);
> > diff --git a/arch/powerpc/kernel/swsusp.c =20
> b/arch/powerpc/kernel/swsusp.c
> > index eae33e1..0b104d7 100644
> > --- a/arch/powerpc/kernel/swsusp.c
> > +++ b/arch/powerpc/kernel/swsusp.c
> > @@ -32,7 +32,5 @@ void save_processor_state(void)
> >
> >  void restore_processor_state(void)
> >  {
> > -#ifdef CONFIG_PPC32
> > -	switch_mmu_context(current->active_mm, current->active_mm);
> > -#endif
> > +	restore_mmu_context();
> >  }
> > diff --git a/arch/powerpc/mm/tlb_nohash.c =20
> b/arch/powerpc/mm/tlb_nohash.c
> > index df32a83..a5a0708 100644
> > --- a/arch/powerpc/mm/tlb_nohash.c
> > +++ b/arch/powerpc/mm/tlb_nohash.c
> > @@ -39,10 +39,12 @@
> >  #include <linux/of_fdt.h>
> >  #include <linux/hugetlb.h>
> >
> > +#include <asm/current.h>
> >  #include <asm/tlbflush.h>
> >  #include <asm/tlb.h>
> >  #include <asm/code-patching.h>
> >  #include <asm/hugetlb.h>
> > +#include <asm/mmu_context.h>
> >
> >  #include "mmu_decl.h"
> >
> > @@ -193,6 +195,16 @@ void local_flush_tlb_page(struct =20
> vm_area_struct *vma,
> > unsigned long vmaddr)
> >  }
> >  EXPORT_SYMBOL(local_flush_tlb_page);
> >
> > +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?

-Scott=

  reply	other threads:[~2013-07-10 21:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09 10:37 [PATCH 1/2] powerpc: add Book E support to 64-bit hibernation Wang Dongsheng
2013-06-09 10:37 ` [PATCH 2/2] powerpc/hibernate: add restore mmu context after resume Wang Dongsheng
2013-07-10 10:11   ` Wang Dongsheng-B40534
2013-07-10 21:42     ` Scott Wood [this message]
2013-07-12  4:04       ` Wang Dongsheng-B40534
2013-07-12 21:54         ` Scott Wood
2013-07-12 23:06           ` Benjamin Herrenschmidt
2013-08-07  9:55             ` Wang Dongsheng-B40534
2013-06-12 22:03 ` [PATCH 1/2] powerpc: add Book E support to 64-bit hibernation Scott Wood
2013-06-13  9:55   ` Wang Dongsheng-B40534
2013-06-13 16:51     ` Scott Wood
2013-06-17  5:54       ` Wang Dongsheng-B40534
2013-06-18  0:01         ` Scott Wood
2013-06-18  0:17           ` Benjamin Herrenschmidt
2013-06-18  0:22             ` Scott Wood
2013-06-18  1:29               ` Benjamin Herrenschmidt
2013-07-10  9:41 ` Wang Dongsheng-B40534
2013-07-10  9:51   ` Benjamin Herrenschmidt
2013-07-10 10:05     ` Wang Dongsheng-B40534

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=1373492577.8183.235@snotra \
    --to=scottwood@freescale.com \
    --cc=B07421@freescale.com \
    --cc=B40534@freescale.com \
    --cc=anton@enomsg.org \
    --cc=johannes@sipsolutions.net \
    --cc=linuxppc-dev@lists.ozlabs.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.