linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/book3e-64: use a separate TLB handler when linear map is bolted
Date: Fri, 17 Jun 2011 11:32:15 -0500	[thread overview]
Message-ID: <20110617113215.56b3d6df@schlenkerla.am.freescale.net> (raw)
In-Reply-To: <1308276050.2516.129.camel@pasglop>

On Fri, 17 Jun 2011 12:00:50 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> Does this completely replace your previous series of 7 patches ? (IE.
> Should I ditch them in patchwork ?) Or does it apply on top of them ?

It replaces them.

> >  #define SET_IVOR(vector_number, vector_offset)	\
> > diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h
> > index a73668a..9d9e444 100644
> > --- a/arch/powerpc/include/asm/mmu_context.h
> > +++ b/arch/powerpc/include/asm/mmu_context.h
> > @@ -54,6 +54,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
> >  	/* 64-bit Book3E keeps track of current PGD in the PACA */
> >  #ifdef CONFIG_PPC_BOOK3E_64
> >  	get_paca()->pgd = next->pgd;
> > +	get_paca()->extlb[0][EX_TLB_PGD / 8] = (unsigned long)next->pgd;
> >  #endif
> >  	/* Nothing else to do if we aren't actually switching */
> >  	if (prev == next)
> > @@ -110,6 +111,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm,
> >  	/* 64-bit Book3E keeps track of current PGD in the PACA */
> >  #ifdef CONFIG_PPC_BOOK3E_64
> >  	get_paca()->pgd = NULL;
> > +	get_paca()->extlb[0][EX_TLB_PGD / 8] = 0;
> >  #endif
> >  }
> 
> Why do you keep a copy of the pgd there since it's in the PACA already
> and you have r13 setup in your handlers ?

This cache line is already being used by the TLB miss handler.  The cache
line containing paca->pgd isn't otherwise used there.

> > +.macro tlb_prolog_bolted addr
> > +	mtspr	SPRN_SPRG_TLB_SCRATCH,r13
> > +	mfspr	r13,SPRN_SPRG_PACA
> > +	std	r10,PACA_EXTLB+EX_TLB_R10(r13)
> > +	mfcr	r10
> > +	std	r11,PACA_EXTLB+EX_TLB_R11(r13)
> > +	mfspr	r11,SPRN_SPRG_TLB_SCRATCH
> 
> Do you need that ? Can't you leave r13 in scratch the whole way and
> just pop it out in the error case when branching to DSI/ISI ? The only
> thing is that TLB_SCRATCH needs to be saved/restored by
> crit/debug/mcheck but thats worth saving cycles in the TLB miss handler
> no ?

Sounds right... I'll try it.

> > +	mfspr	r11,SPRN_ESR
> > +
> > +	srdi	r15,r16,60		/* get region */
> > +	rldicl.	r10,r16,64-PGTABLE_EADDR_SIZE,PGTABLE_EADDR_SIZE+4
> > +	bne-	dtlb_miss_fault_bolted
> 
> Ok so I'm not familiar with your pipeline here, but wouldn't it be
> better to move the srdi to after the bne above and make it srdi., thus
> avoiding the compare below ?
> 
> > +	rlwinm	r10,r11,32-19,27,27
> > +	rlwimi	r10,r11,32-16,19,19
> > +	cmpwi	r15,0
> > +	ori	r10,r10,_PAGE_PRESENT
> > +	oris	r11,r10,_PAGE_ACCESSED@h

The cmpwi will run in parallel with the rlwimi above on e5500, but
changing it shouldn't hurt, and it's one less instruction to sit in the
icache...

-Scott

  reply	other threads:[~2011-06-17 16:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-03 22:12 [PATCH] powerpc/book3e-64: use a separate TLB handler when linear map is bolted Scott Wood
2011-06-17  2:00 ` Benjamin Herrenschmidt
2011-06-17 16:32   ` Scott Wood [this message]
2011-06-17 22:44     ` Benjamin Herrenschmidt
2011-06-22 21:24       ` Scott Wood
2011-06-22 22:05         ` Benjamin Herrenschmidt

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=20110617113215.56b3d6df@schlenkerla.am.freescale.net \
    --to=scottwood@freescale.com \
    --cc=benh@kernel.crashing.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).