[POWERPC] Implement SLB shadow buffer

This adds a shadow buffer for the SLBs and regsiters it with PHYP.
Only the bolted SLB entries (top 3) are shadowed.

The SLB shadow buffer tells the hypervisor what the kernel needs to
have in the SLB for the kernel to be able to function.  The hypervisor
can use this information to speed up partition context switches.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Michael Neuling
2006-08-07 16:19:19 +10:00
committed by Paul Mackerras
parent 452b5e2121
commit 2f6093c847
9 changed files with 124 additions and 11 deletions

View File

@@ -323,6 +323,11 @@ _GLOBAL(ret_from_fork)
* The code which creates the new task context is in 'copy_thread'
* in arch/powerpc/kernel/process.c
*/
#define SHADOW_SLB_BOLTED_STACK_ESID \
(SLBSHADOW_SAVEAREA + 0x10*(SLB_NUM_BOLTED-1))
#define SHADOW_SLB_BOLTED_STACK_VSID \
(SLBSHADOW_SAVEAREA + 0x10*(SLB_NUM_BOLTED-1) + 8)
.align 7
_GLOBAL(_switch)
mflr r0
@@ -375,6 +380,14 @@ BEGIN_FTR_SECTION
ld r7,KSP_VSID(r4) /* Get new stack's VSID */
oris r0,r6,(SLB_ESID_V)@h
ori r0,r0,(SLB_NUM_BOLTED-1)@l
/* Update the last bolted SLB */
ld r9,PACA_SLBSHADOWPTR(r13)
li r12,0
std r12,SHADOW_SLB_BOLTED_STACK_ESID(r9) /* Clear ESID */
std r7,SHADOW_SLB_BOLTED_STACK_VSID(r9) /* Save VSID */
std r0,SHADOW_SLB_BOLTED_STACK_ESID(r9) /* Save ESID */
slbie r6
slbie r6 /* Workaround POWER5 < DD2.1 issue */
slbmte r7,r0