Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/x86 Always set XCR0_X87, to force a reload of C...
details: https://anonhg.NetBSD.org/src/rev/d01b8fadd835
branches: trunk
changeset: 357282:d01b8fadd835
user: maxv <maxv%NetBSD.org@localhost>
date: Sat Nov 04 07:38:42 2017 +0000
description:
Always set XCR0_X87, to force a reload of CW. That's needed for compat
options where fx_cw is not the standard fpu value.
diffstat:
sys/arch/x86/x86/fpu.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diffs (32 lines):
diff -r cc6f1f4d50f2 -r d01b8fadd835 sys/arch/x86/x86/fpu.c
--- a/sys/arch/x86/x86/fpu.c Sat Nov 04 07:35:00 2017 +0000
+++ b/sys/arch/x86/x86/fpu.c Sat Nov 04 07:38:42 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu.c,v 1.22 2017/11/04 07:35:00 maxv Exp $ */
+/* $NetBSD: fpu.c,v 1.23 2017/11/04 07:38:42 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.22 2017/11/04 07:35:00 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.23 2017/11/04 07:38:42 maxv Exp $");
#include "opt_multiprocessor.h"
@@ -557,6 +557,13 @@
fpu_save->sv_xmm.fx_mxcsr = __INITIAL_MXCSR__;
fpu_save->sv_xmm.fx_mxcsr_mask = x86_fpu_mxcsr_mask;
fpu_save->sv_xmm.fx_cw = x87_cw;
+
+ /* Force a reload of CW */
+ if (x86_fpu_save == FPU_SAVE_XSAVE ||
+ x86_fpu_save == FPU_SAVE_XSAVEOPT) {
+ fpu_save->sv_xsave_hdr.xsh_xstate_bv |=
+ XCR0_X87;
+ }
} else {
memset(&fpu_save->sv_87, 0, x86_fpu_save_size);
fpu_save->sv_87.s87_tw = 0xffff;
Home |
Main Index |
Thread Index |
Old Index