]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[SPARC64]: Do not write garbage into %pstate in tsb_context_switch().
authorDavid S. Miller <davem@sunset.davemloft.net>
Thu, 16 Feb 2006 05:16:42 +0000 (21:16 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 20 Mar 2006 09:13:08 +0000 (01:13 -0800)
For SUN4V, we were clobbering %o5 to do the hypervisor call.
This clobbers the saved %pstate value and we end up writing
garbage into that register as a result.  Oops.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/tsb.S

index be8f0892d721c9245228de90d36df06e613d762e..7996c9d66702cacf9270ab964a8d13e8b64f6239 100644 (file)
@@ -265,13 +265,19 @@ __tsb_context_switch:
        mov     SCRATCHPAD_UTSBREG2, %g1
        stxa    %g2, [%g1] ASI_SCRATCHPAD
 
+       /* Save away %o5's %pstate, we have to use %o5 for
+        * the hypervisor call.
+        */
+       mov     %o5, %g1
+
        mov     HV_FAST_MMU_TSB_CTXNON0, %o5
        mov     1, %o0
        mov     %o4, %o1
        ta      HV_FAST_TRAP
 
+       /* Finish up and restore %o5.  */
        ba,pt   %xcc, 9f
-        nop
+        mov    %g1, %o5
 
        /* SUN4U TSB switch.  */
 1:     mov     TSB_REG, %g1