Module Name:    src
Committed By:   maxv
Date:           Sat Jun 16 05:52:17 UTC 2018

Modified Files:
        src/sys/arch/x86/x86: fpu.c

Log Message:
Actually, don't do anything if we switch to a kernel thread. When the cpu
switches back to a user thread the fpu is restored, so no point calling
fninit (which doesn't clear all the states anyway).


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/x86/x86/fpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/fpu.c
diff -u src/sys/arch/x86/x86/fpu.c:1.34 src/sys/arch/x86/x86/fpu.c:1.35
--- src/sys/arch/x86/x86/fpu.c:1.34	Thu Jun 14 18:00:15 2018
+++ src/sys/arch/x86/x86/fpu.c	Sat Jun 16 05:52:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.34 2018/06/14 18:00:15 maxv Exp $	*/
+/*	$NetBSD: fpu.c,v 1.35 2018/06/16 05:52:17 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.34 2018/06/14 18:00:15 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.35 2018/06/16 05:52:17 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -333,14 +333,6 @@ fpu_restore(struct lwp *l)
 }
 
 static void
-fpu_reset(void)
-{
-	clts();
-	fninit();
-	stts();
-}
-
-static void
 fpu_eagerrestore(struct lwp *l)
 {
 	struct pcb *pcb = lwp_getpcb(l);
@@ -359,9 +351,7 @@ fpu_eagerswitch(struct lwp *oldlwp, stru
 
 	s = splhigh();
 	fpusave_cpu(true);
-	if (newlwp->l_flag & LW_SYSTEM)
-		fpu_reset();
-	else
+	if (!(newlwp->l_flag & LW_SYSTEM))
 		fpu_eagerrestore(newlwp);
 	splx(s);
 }

Reply via email to