Module Name:    src
Committed By:   maxv
Date:           Thu Jun 14 18:00:16 UTC 2018

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

Log Message:
Install the FPU state on the current CPU in setregs (execve).


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 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.33 src/sys/arch/x86/x86/fpu.c:1.34
--- src/sys/arch/x86/x86/fpu.c:1.33	Thu Jun 14 14:36:46 2018
+++ src/sys/arch/x86/x86/fpu.c	Thu Jun 14 18:00:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.33 2018/06/14 14:36:46 maxv Exp $	*/
+/*	$NetBSD: fpu.c,v 1.34 2018/06/14 18:00:15 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.33 2018/06/14 14:36:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.34 2018/06/14 18:00:15 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -644,6 +644,14 @@ fpu_save_area_clear(struct lwp *l, unsig
 		fpu_save->sv_87.s87_cw = x87_cw;
 	}
 	pcb->pcb_fpu_dflt_cw = x87_cw;
+
+	/*
+	 * If using eager-switch, install the FPU state on the current
+	 * CPU.
+	 */
+	if (x86_fpu_eager) {
+		fpu_eagerswitch(NULL, l);
+	}
 }
 
 void

Reply via email to