]> git.hungrycats.org Git - linux/commit
[PATCH] ppc64: pin the kernel stack's SLB entry
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 3 Sep 2004 03:22:09 +0000 (20:22 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 3 Sep 2004 03:22:09 +0000 (20:22 -0700)
commit0d0c0fde9def62a7757173e8ff79767038af46ef
tree0ea55285f4e894052125a5460d5e388f1f7eca09
parent2aed69eee15e149812d47755d3fb05a9f34f01f2
[PATCH] ppc64: pin the kernel stack's SLB entry

This has been given basic testing on Power4 pSeries and iSeries machines.

At present, the SLB miss handler has to check the SLB slot it is about to
use to ensure that it does not contain the SLBE for the current kernel
stack - throwing out the SLBE for the kernel stack can trigger the
"megabug": we have no SLBE for the stack, but we don't fault immediately
because we have an ERAT entry for it.  The ERAT entry is then lost due to a
tlbie on another CPU during the unrecoverable section of the exception
return path.

This patch implements a different approach - with this patch SLB slot 2
always (well, nearly always) contains an SLBE for the stack.  This slot is
never cast out by the normal SLB miss path.  On context switch, an SLBE for
the new stack is pinned into this slot, unless the new stack is the the
bolted segment.

For iSeries we need a special workaround because there is no way of
ensuring the stack SLBE is preserved an a shared processor switch.  So, we
still need to handle taking an SLB miss on the stack, in which case we must
make sure it is loaded into slot 2, rather than using the normal
round-robin.

This approach shaves a few ns off the slb miss time (on pSeries), but more
importantly makes it easier to experiment with different SLB castout
aporoaches without worrying about reinstating the megabug.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/kernel/asm-offsets.c
arch/ppc64/kernel/entry.S
arch/ppc64/kernel/process.c
arch/ppc64/mm/slb.c
arch/ppc64/mm/slb_low.S
include/asm-ppc64/mmu.h
include/asm-ppc64/processor.h