diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2004-09-02 20:22:09 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-09-02 20:22:09 -0700 |
| commit | 0d0c0fde9def62a7757173e8ff79767038af46ef (patch) | |
| tree | 0ea55285f4e894052125a5460d5e388f1f7eca09 /include | |
| parent | 2aed69eee15e149812d47755d3fb05a9f34f01f2 (diff) | |
[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>
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-ppc64/mmu.h | 2 | ||||
| -rw-r--r-- | include/asm-ppc64/processor.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h index dde94156b32b..d7ebf8797f94 100644 --- a/include/asm-ppc64/mmu.h +++ b/include/asm-ppc64/mmu.h @@ -198,7 +198,7 @@ extern void htab_finish_init(void); #define STAB0_PHYS_ADDR (STAB0_PAGE<<PAGE_SHIFT) #define STAB0_VIRT_ADDR (KERNELBASE+STAB0_PHYS_ADDR) -#define SLB_NUM_BOLTED 2 +#define SLB_NUM_BOLTED 3 #define SLB_CACHE_ENTRIES 8 /* Bits in the SLB ESID word */ diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h index b8e80dfc96f3..5a76ed82be02 100644 --- a/include/asm-ppc64/processor.h +++ b/include/asm-ppc64/processor.h @@ -538,6 +538,7 @@ typedef struct { struct thread_struct { unsigned long ksp; /* Kernel stack pointer */ + unsigned long ksp_vsid; struct pt_regs *regs; /* Pointer to saved register state */ mm_segment_t fs; /* for get_fs() validation */ double fpr[32]; /* Complete floating point set */ |
