Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Sep 2014 15:45:46 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271197 - in head/sys/x86: include x86
Message-ID:  <201409061545.s86FjknW065959@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Sep  6 15:45:45 2014
New Revision: 271197
URL: http://svnweb.freebsd.org/changeset/base/271197

Log:
  Add more bits for the XSAVE features from CPUID 0xd, sub-function 1
  %eax report.
  
  Print the XSAVE features 0xd/1 in the boot banner.  The printcpuinfo()
  is executed late enough so that XSAVE is already enabled.
  
  There is no known to me off the shelf hardware that implements any
  feature bits except XSAVEOPT, the list is taken from SDM rev. 50.  The
  banner printing will allow us to note the hardware arrival.
  
  Sponsored by:	    The FreeBSD Foundation
  MFC after:	    1 week

Modified:
  head/sys/x86/include/specialreg.h
  head/sys/x86/x86/identcpu.c

Modified: head/sys/x86/include/specialreg.h
==============================================================================
--- head/sys/x86/include/specialreg.h	Sat Sep  6 15:37:55 2014	(r271196)
+++ head/sys/x86/include/specialreg.h	Sat Sep  6 15:45:45 2014	(r271197)
@@ -296,6 +296,9 @@
  * CPUID instruction 0xd Processor Extended State Enumeration Sub-leaf 1
  */
 #define	CPUID_EXTSTATE_XSAVEOPT	0x00000001
+#define	CPUID_EXTSTATE_XSAVEC	0x00000002
+#define	CPUID_EXTSTATE_XINUSE	0x00000004
+#define	CPUID_EXTSTATE_XSAVES	0x00000008
 
 /*
  * AMD extended function 8000_0007h edx info

Modified: head/sys/x86/x86/identcpu.c
==============================================================================
--- head/sys/x86/x86/identcpu.c	Sat Sep  6 15:37:55 2014	(r271196)
+++ head/sys/x86/x86/identcpu.c	Sat Sep  6 15:45:45 2014	(r271197)
@@ -932,6 +932,19 @@ printcpuinfo(void)
 				       );
 			}
 
+			if ((cpu_feature2 & CPUID2_XSAVE) != 0) {
+				cpuid_count(0xd, 0x1, regs);
+				if (regs[0] != 0) {
+					printf("\n  XSAVE Features=0x%b",
+					    regs[0],
+					    "\020"
+					    "\001XSAVEOPT"
+					    "\002XSAVEC"
+					    "\003XINUSE"
+					    "\004XSAVES");
+				}
+			}
+
 			if (via_feature_rng != 0 || via_feature_xcrypt != 0)
 				print_via_padlock_info();
 



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