svn commit: r250152 - head/sys/amd64/amd64

Konstantin Belousov kib at FreeBSD.org
Wed May 1 20:03:51 UTC 2013


Author: kib
Date: Wed May  1 20:03:50 2013
New Revision: 250152
URL: http://svnweb.freebsd.org/changeset/base/250152

Log:
  The check to ensure that xstate_bv always has XFEATURE_ENABLED_X87 and
  XFEATURE_ENABLED_SSE bits set is not needed.  CPU correctly handles
  any bitmask which is subset of the enabled bits in %XCR0.
  
  More, CPU instructions XSAVE and XSAVEOPT could write the mask without
  e.g. XFEATURE_ENABLED_SSE, after the VZEROALL.  The check prevents the
  restoration of the otherwise valid FPU save area.
  
  In collaboration with:	jhb
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/fpu.c

Modified: head/sys/amd64/amd64/fpu.c
==============================================================================
--- head/sys/amd64/amd64/fpu.c	Wed May  1 18:06:53 2013	(r250151)
+++ head/sys/amd64/amd64/fpu.c	Wed May  1 20:03:50 2013	(r250152)
@@ -743,9 +743,6 @@ fpusetxstate(struct thread *td, char *xf
 	 */
 	if (bv & ~xsave_mask)
 		return (EINVAL);
-	if ((bv & (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) !=
-	    (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE))
-		return (EINVAL);
 
 	hdr = (struct xstate_hdr *)(get_pcb_user_save_td(td) + 1);
 


More information about the svn-src-all mailing list