vkernel - Fix FP corruption from preemptive thread switch
commit5febe8f5748ea5923d6465791c344a3a6138dee4
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 2 Oct 2009 22:53:17 +0000 (2 15:53 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 2 Oct 2009 23:00:59 +0000 (2 16:00 -0700)
tree9c769345f4b5098d9cf0f986906f0f211db82910
parentec61b2892719413e2fd52a677fc9a1d05d09d59a
vkernel - Fix FP corruption from preemptive thread switch

* Recent work on the vkernel enabled preemptive interrupt thread switching.
  This introduced a race where the floating point state could change
  out from under the vkernel's go_user() function, causing the FP state
  in the virtual user process to become corrupt.

* Fixed by introducing a critical section which essentially defers any
  preemptive thread switches inside go_user().

Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Test-cases-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
sys/platform/vkernel/i386/trap.c