1.0.41.28: ppc: Fix race conditions in use of pseudo-atomic in ppc-assem.S.
authorAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sat, 7 Aug 2010 15:23:10 +0000 (15:23 +0000)
committerAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sat, 7 Aug 2010 15:23:10 +0000 (15:23 +0000)
  * Originally, ppc-assem.S was saving the pseudo-atomic-interrupted
bit before clearing the pseduo-atomc-atomic bit in reg_ALLOC.  This
introduces a single-instruction window wherein an interrupt could
occur, be deferred, and the setting of pseudo-atomic-interrupted be
ignored.

  * Fixed, in the four places it occurs, by reordering instructions.

src/runtime/ppc-assem.S
version.lisp-expr

index 318d576..ec19ad5 100644 (file)
@@ -321,8 +321,8 @@ x:
        load(reg_OCFP,CSYMBOL(current_control_frame_pointer))
 
        /* No longer atomic, and check for interrupt */
-       andi. reg_NL3, reg_ALLOC, 1
        subi reg_ALLOC,reg_ALLOC,4
+       andi. reg_NL3, reg_ALLOC, 1
        twnei reg_NL3, 0
 
        /* Pass in the arguments */
@@ -380,8 +380,8 @@ lra:
        store(reg_NL1,reg_NL2,CSYMBOL(foreign_function_call_active))
 
        /* Check for interrupt */
-       andi. reg_NL3, reg_ALLOC, 1
        subi reg_ALLOC, reg_ALLOC, 4
+       andi. reg_NL3, reg_ALLOC, 1
        twnei reg_NL3,0
        
        /* Back to C */
@@ -432,8 +432,8 @@ lra:
        store(reg_CSP,reg_CFUNC,CSYMBOL(foreign_function_call_active))
        /* load(reg_POLL,saver2) */
        /* Disable pseudo-atomic; check pending interrupt */
-       andi. reg_NL3, reg_ALLOC, 1
        subi reg_ALLOC, reg_ALLOC, 4
+       andi. reg_NL3, reg_ALLOC, 1
        twnei reg_NL3, 0
 
        mr reg_NL3,reg_NARGS
@@ -499,8 +499,8 @@ lra:
        la reg_LIP,-OTHER_POINTER_LOWTAG(reg_LIP)
 
        /* No longer atomic */
-       andi. reg_NL3, reg_ALLOC, 1
        subi reg_ALLOC, reg_ALLOC, 4
+       andi. reg_NL3, reg_ALLOC, 1
        twnei reg_NL3, 0
 
        mtlr reg_LIP
index 7c0e02e..7860e46 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.41.27"
+"1.0.41.28"