commit 99a24d7c19d624654afbd574e604d8a011ed28b3
Author: Taku YAMAMOTO <taku@tackymt.homeip.net>
Date:   Sun Jul 14 07:36:29 2013 +0900

    i386: defer FPU context resume from resumectx() to npxdna() by CR0_TS.

diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s
index 80aa6c4..71efae1 100644
--- a/sys/i386/i386/swtch.s
+++ b/sys/i386/i386/swtch.s
@@ -36,6 +36,7 @@
 #include "opt_sched.h"
 
 #include <machine/asmacros.h>
+#include <machine/specialreg.h>
 
 #include "assym.s"
 
@@ -487,6 +488,10 @@ ENTRY(resumectx)
 	movl	PCB_CR3(%ecx),%eax
 	movl	%eax,%cr3
 	movl	PCB_CR0(%ecx),%eax
+#ifdef DEV_NPX
+	/* Let npxdna() restore the FPU context lazily. */
+	orl	$CR0_TS,%eax
+#endif
 	movl	%eax,%cr0
 	jmp	1f
 1:
@@ -519,10 +524,6 @@ ENTRY(resumectx)
 	movl	PCB_DR7(%ecx),%eax
 	movl	%eax,%dr7
 
-#ifdef DEV_NPX
-	/* XXX FIX ME */
-#endif
-
 	/* Restore other registers */
 	movl	PCB_EDI(%ecx),%edi
 	movl	PCB_ESI(%ecx),%esi
