[SPARC64]: Sanitize %pstate writes for sun4v.
[linux-2.6.git] / arch / sparc64 / kernel / tsb.S
index 3b45db98005a5a7a6e481ee9c53c2cd178b2a92b..96e63168d8b2644ad1fd958409b54f1a5f2276dc 100644 (file)
@@ -82,9 +82,17 @@ tsb_itlb_load:
        .globl          tsb_do_fault
 tsb_do_fault:
        cmp             %g3, FAULT_CODE_DTLB
-       rdpr            %pstate, %g5
+
+661:   rdpr            %pstate, %g5
+       wrpr            %g5, PSTATE_AG | PSTATE_MG, %pstate
+       .section        .gl_2insn_patch, "ax"
+       .word           661b
+       nop
+       nop
+       .previous
+
        bne,pn          %xcc, tsb_do_itlb_fault
-        wrpr           %g5, PSTATE_AG | PSTATE_MG, %pstate
+        nop
 
 tsb_do_dtlb_fault:
        rdpr    %tl, %g4