linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Tjernlund <joakim.tjernlund@transmode.se>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>, Willy Tarreau <w@1wt.eu>
Subject: Re: [PATCH 00/13] powerpc: Backport 8xx TLB to 2.4
Date: Thu, 13 Jan 2011 22:31:18 +0100	[thread overview]
Message-ID: <OF17821FE2.8701ABFC-ONC1257817.0075D6D2-C1257817.007638FB@transmode.se> (raw)
In-Reply-To: <20110113144400.28892935@udp111988uds.am.freescale.net>

Scott Wood <scottwood@freescale.com> wrote on 2011/01/13 21:44:00:
> > BTW, it occurred to me that the following 8xx quirk is best
> > done in 8xx code:
> >
> > From c1985a3b8b16d96ddce5ef90d5a15e70fb8a2aec Mon Sep 17 00:00:00 2001
> > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > Date: Tue, 11 Jan 2011 11:24:22 +0100
> > Subject: [PATCH] 8xx: Move invalidation of non present TLBs
> >
> > 8xx does not invalidate ~PRESENT TLBs, move the workaround
> > in mm/fault.c here to keep 8xx quirks localized.
> >
> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > ---
> >  arch/ppc/kernel/head_8xx.S |   12 ++++++++++--
> >  arch/ppc/mm/fault.c        |    7 -------
> >  2 files changed, 10 insertions(+), 9 deletions(-)
> >
> > diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
> > index 75acaa0..24b206c 100644
> > --- a/arch/ppc/kernel/head_8xx.S
> > +++ b/arch/ppc/kernel/head_8xx.S
> > @@ -221,7 +221,11 @@ DataAccess:
> >     mr   r5,r20
> >     mfspr   r4,DAR
> >     stw   r4,_DAR(r21)
> > -   li   r20,0x00f0
> > +   /* invalidate ~PRESENT TLBs, 8xx MMU don't do this */
> > +   andis.   r20,r5,0x4000
> > +   beq+   1f
> > +   tlbie   r4
> > +1:   li   r20,0x00f
> >     mtspr   DAR,r20   /* Tag DAR */
> >     addi   r3,r1,STACK_FRAME_OVERHEAD
> >     li   r20,MSR_KERNEL
> > @@ -238,7 +242,11 @@ InstructionAccess:
> >     addi   r3,r1,STACK_FRAME_OVERHEAD
> >     mr   r4,r22
> >     mr   r5,r23
> > -   li   r20,MSR_KERNEL
> > +   /* invalidate ~PRESENT TLBs, 8xx MMU don't do this */
> > +   andis.   r20,r5,0x4000
> > +   beq+   1f
> > +   tlbie   r4
> > +1:   li   r20,MSR_KERNEL
> >     rlwimi   r20,r23,0,16,16      /* copy EE bit from saved MSR */
> >     FINISH_EXCEPTION(do_page_fault)
> >
> > diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c
> > index 874005a..8819fb1 100644
> > --- a/arch/ppc/mm/fault.c
> > +++ b/arch/ppc/mm/fault.c
> > @@ -116,13 +116,6 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
> >     else
> >        is_write = error_code & 0x02000000;
> >  #endif /* CONFIG_4xx || CONFIG_BOOKE */
> > -#if defined(CONFIG_8xx)
> > -   /* 8xx does no invalidate TLBs that are ~PRESENT,
> > -    * do it here.
> > -    */
> > -   if (error_code & 0x40000000)
> > -      _tlbie(address);
> > -#endif
> >  #if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
> >     if (debugger_fault_handler && regs->trap == 0x300) {
> >        debugger_fault_handler(regs);
> > --
> > 1.7.3.4
> >
> > Scott, what do you think of this? Is it safe to call tlbie in this context?
>
> I'd guess so (I assume the concern is MMU translation being off?), but I
> don't have any particular knowledge about this.  I'd be checking the
> same manual that you have. :-)

I noticed 2.6 uses tlbie in CPU15 errata workaround so it is fine
and it is better to invalidate as soon as possible to free up a TLB slot.
Runs on my old 2.4 too.

 Jocke

      reply	other threads:[~2011-01-13 21:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10 21:37 [PATCH 00/13] powerpc: Backport 8xx TLB to 2.4 Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 01/13] 8xx: Use a macro to simpliy CPU6 errata code Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 02/13] 8xx: Tag DAR with 0x00f0 to catch buggy instructions Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 03/13] 8xx: invalidate non present TLBs Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 04/13] 8xx: Fix CONFIG_PIN_TLB Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 05/13] 8xx: Update TLB asm so it behaves as linux mm expects Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 06/13] 8xx: Always pin kernel instruction TLB Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 07/13] 8xx: Fixup DAR from buggy dcbX instructions Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 08/13] 8xx: CPU6 errata make DTLB error too big to fit Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 09/13] 8xx: Add missing Guarded setting in DTLB Error Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 10/13] 8xx: Restore _PAGE_WRITETHRU Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 11/13] 8xx: start using dcbX instructions in various copy routines Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 12/13] 8xx: Optimize ITLBMiss handler Joakim Tjernlund
2011-01-10 21:37 ` [PATCH 13/13] 8xx: Optimize TLB Miss handlers Joakim Tjernlund
2011-01-11  6:09 ` [PATCH 00/13] powerpc: Backport 8xx TLB to 2.4 Willy Tarreau
2011-01-11  8:12   ` Joakim Tjernlund
2011-01-11 20:08     ` Willy Tarreau
2011-01-11 20:27       ` Joakim Tjernlund
     [not found]   ` <OFEC114402.5A694921-ONC1257815.002CC8F2-C1257815.002D1C7D@LocalDomain>
2011-01-11 10:56     ` Joakim Tjernlund
2011-01-13 20:44       ` Scott Wood
2011-01-13 21:31         ` Joakim Tjernlund [this message]

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=OF17821FE2.8701ABFC-ONC1257817.0075D6D2-C1257817.007638FB@transmode.se \
    --to=joakim.tjernlund@transmode.se \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.com \
    --cc=w@1wt.eu \
    /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).