vkernel - Fix FP corruption from preemptive thread switch
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 2 Oct 2009 22:53:17 +0000 (15:53 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 2 Oct 2009 22:53:17 +0000 (15:53 -0700)
commiteaaa6d6031b7b67f3b067023af0d99386a1d6d9b
tree2de04547f7e20723dba52ef913f26fe41351de1b
parent5c627295bf5ad6364bd3914b62c1075f370443d6
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