[PATCH 04/10] 8xx: Always pin kernel instruction TLB

Joakim Tjernlund joakim.tjernlund at transmode.se
Wed Dec 30 02:10:58 EST 2009

Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote on 09/12/2009 09:56:35:

> From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> To: Joakim Tjernlund <joakim.tjernlund at transmode.se>
> Cc: "linuxppc-dev at ozlabs.org" <linuxppc-dev at ozlabs.org>, Rex Feany
> <RFeany at mrv.com>, Scott Wood <scottwood at freescale.com>
> Date: 09/12/2009 09:56
> Subject: Re: [PATCH 04/10] 8xx: Always pin kernel instruction TLB
> On Wed, 2009-12-09 at 08:39 +0100, Joakim Tjernlund wrote:
> > The later isn't as simple :) I believe the bulk of such code in
> > entry_32.S.
> Yeah but it would be useful for hash I suppose if one really wants to
> boot with nobats. Though at least on hash most of the time we have ways
> to recover by mean of MSR:RI being cleared, which your TLB miss code
> doesn't check...
> > Anyhow, the config option is still valid as if enabled
> > it will pin several DTLB's too. Scott had some concerns about removing
> > the config option completely so this was the next best thing.
> Well, if you want to pin at least one entry, then just remove the #if
> completely but don't leave a #if 1 :-)

As you wish. Here is a new version without the #if 1
This is required for 8xx to work in Linus current tree.

>From 5a4fa5078ba1774b037dbfd88b9c87b74cf76db7 Mon Sep 17 00:00:00 2001
From: Joakim Tjernlund <Joakim.Tjernlund at transmode.se>
Date: Fri, 13 Nov 2009 00:26:59 +0100
Subject: [PATCH] 8xx: Always pin kernel instruction TLB

Various kernel asm modifies SRR0/SRR1 just before executing
a rfi. If such code crosses a page boundary you risk a TLB miss
which will clobber SRR0/SRR1. Avoid this by always pinning
kernel instruction TLB space.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund at transmode.se>
 arch/powerpc/kernel/head_8xx.S |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index adc5a32..c80e7c5 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -767,12 +767,12 @@ start_here:
 	tlbia			/* Invalidate all TLB entries */
+/* Always pin the first 8 MB ITLB to prevent ITLB
+   misses while mucking around with SRR0/SRR1 in asm
 	lis	r8, MI_RSV4I at h
 	ori	r8, r8, 0x1c00
-	li	r8, 0
 	mtspr	SPRN_MI_CTR, r8	/* Set instruction MMU control */


More information about the Linuxppc-dev mailing list