kernel - Reorder critical section interlock in splz()
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 22 Dec 2011 19:45:06 +0000 (11:45 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 22 Dec 2011 19:45:06 +0000 (11:45 -0800)
* Reorder a critical section interlock in splz() to remove a one-instruction
  window where an interrupt might nest against the splz() operation.

sys/platform/pc32/i386/ipl.s

index 05bf5a2..01f2324 100644 (file)
@@ -443,8 +443,8 @@ splz_soft:
        addl    $FIRST_SOFTINT,%ecx     /* actual intr number */
        pushl   %eax
        pushl   %ecx
-       decl    TD_CRITCOUNT(%ebx)
        incl    TD_NEST_COUNT(%ebx)     /* prevent doreti/splz nesting */
+       decl    TD_CRITCOUNT(%ebx)
        call    sched_ithd_soft         /* YYY must pull in imasks */
        incl    TD_CRITCOUNT(%ebx)
        decl    TD_NEST_COUNT(%ebx)     /* prevent doreti/splz nesting */