[SPARC64]: Drop %gl to 0 before re-enabling PSTATE_IE in rtrap
authorDavid S. Miller <davem@sunset.davemloft.net>
Thu, 23 Feb 2006 00:15:45 +0000 (16:15 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 20 Mar 2006 09:13:57 +0000 (01:13 -0800)
If we take a window fault, on SUN4V set %gl to zero before we
turn PSTATE_IE back on in %pstate.  Otherwise if we take an
interrupt we'll end up with corrupt register state.

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

index 1e724fe172ae4581d26737c637453bdc37b8b75c..7130e866f935849a61cbdc2ac2f74c84f2f7bb58 100644 (file)
@@ -333,7 +333,6 @@ user_rtt_fill_fixup:
 
                mov     %g6, %l1
                wrpr    %g0, 0x0, %tl
-               wrpr    %g0, RTRAP_PSTATE, %pstate
 
 661:           nop
                .section                .sun4v_1insn_patch, "ax"
@@ -341,6 +340,8 @@ user_rtt_fill_fixup:
                SET_GL(0)
                .previous
 
+               wrpr    %g0, RTRAP_PSTATE, %pstate
+
                mov     %l1, %g6
                ldx     [%g6 + TI_TASK], %g4
                LOAD_PER_CPU_BASE(%g5, %g6, %g1, %g2, %g3)