[POWERPC] SLB shadow buffer cleanup
[powerpc.git] / arch / powerpc / kernel / entry_64.S
index 1060155..2cd872b 100644 (file)
@@ -18,7 +18,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <asm/unistd.h>
 #include <asm/processor.h>
@@ -57,6 +56,7 @@ system_call_common:
        beq-    1f
        ld      r1,PACAKSAVE(r13)
 1:     std     r10,0(r1)
+       crclr   so
        std     r11,_NIP(r1)
        std     r12,_MSR(r1)
        std     r0,GPR0(r1)
@@ -75,7 +75,6 @@ system_call_common:
        std     r11,GPR11(r1)
        std     r11,GPR12(r1)
        std     r9,GPR13(r1)
-       crclr   so
        mfcr    r9
        mflr    r10
        li      r11,0xc01
@@ -376,6 +375,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,SLBSHADOW_STACKESID(r9) /* Clear ESID */
+       std     r7,SLBSHADOW_STACKVSID(r9)  /* Save VSID */
+       std     r0,SLBSHADOW_STACKESID(r9)  /* Save ESID */
+
        slbie   r6
        slbie   r6              /* Workaround POWER5 < DD2.1 issue */
        slbmte  r7,r0
@@ -617,6 +624,12 @@ _GLOBAL(enter_rtas)
        mfsrr1  r10
        std     r10,_SRR1(r1)
 
+       /* Temporary workaround to clear CR until RTAS can be modified to
+        * ignore all bits.
+        */
+       li      r0,0
+       mtcr    r0
+
        /* There is no way it is acceptable to get here with interrupts enabled,
         * check it with the asm equivalent of WARN_ON
         */