[Midnightbsd-cvs] src [9364] trunk/sys/amd64/amd64/fpu.c: Correct the type for the literal used on the left side of the shift up

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Mar 4 14:50:21 EST 2017


Revision: 9364
          http://svnweb.midnightbsd.org/src/?rev=9364
Author:   laffer1
Date:     2017-03-04 14:50:21 -0500 (Sat, 04 Mar 2017)
Log Message:
-----------
Correct the type for the literal used on the left side of the shift up
to 63 bit positions.

Do not fill the save area and do not set the saved bit in the xstate
bit vector for the state which is not marked as enabled in xsave_mask.

Modified Paths:
--------------
    trunk/sys/amd64/amd64/fpu.c

Modified: trunk/sys/amd64/amd64/fpu.c
===================================================================
--- trunk/sys/amd64/amd64/fpu.c	2017-03-04 19:49:48 UTC (rev 9363)
+++ trunk/sys/amd64/amd64/fpu.c	2017-03-04 19:50:21 UTC (rev 9364)
@@ -687,8 +687,8 @@
 		    offsetof(struct xstate_hdr, xstate_bv));
 		max_ext_n = flsl(xsave_mask);
 		for (i = 0; i < max_ext_n; i++) {
-			bit = 1 << i;
-			if ((*xstate_bv & bit) != 0)
+			bit = 1ULL << i;
+			if ((xsave_mask & bit) == 0 || (*xstate_bv & bit) != 0)
 				continue;
 			bcopy((char *)fpu_initialstate +
 			    xsave_area_desc[i].offset,



More information about the Midnightbsd-cvs mailing list