Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 May 2014 18:22:03 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r266552 - head/sys/amd64/amd64
Message-ID:  <201405221822.s4MIM3NO091765@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu May 22 18:22:02 2014
New Revision: 266552
URL: http://svnweb.freebsd.org/changeset/base/266552

Log:
  Don't permit users to request a subset of the AVX512 or MPX xsave masks.
  
  These masks are documented in the Intel Architecture Instruction Set
  Extensions Programming Reference (March 2014).
  
  Reviewed by:	kib
  MFC after:	1 month

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

Modified: head/sys/amd64/amd64/fpu.c
==============================================================================
--- head/sys/amd64/amd64/fpu.c	Thu May 22 18:13:17 2014	(r266551)
+++ head/sys/amd64/amd64/fpu.c	Thu May 22 18:22:02 2014	(r266552)
@@ -199,6 +199,10 @@ fpuinit_bsp1(void)
 	TUNABLE_ULONG_FETCH("hw.xsave_mask", &xsave_mask_user);
 	xsave_mask_user |= XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE;
 	xsave_mask &= xsave_mask_user;
+	if ((xsave_mask & XFEATURE_AVX512) != XFEATURE_AVX512)
+		xsave_mask &= ~XFEATURE_AVX512;
+	if ((xsave_mask & XFEATURE_MPX) != XFEATURE_MPX)
+		xsave_mask &= ~XFEATURE_MPX;
 
 	cpuid_count(0xd, 0x1, cp);
 	if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405221822.s4MIM3NO091765>