[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Enable RDWRGSFS feature support for HVM guests



# HG changeset patch
# User Yang, Wei <wei.y.yang@xxxxxxxxx>
# Date 1308150408 -3600
# Node ID 8c75f35d55f60cb2f374e3b5c7c520f8633d733f
# Parent  35b4220c98bc89b7162d19ed6c858e027fabff69
Enable RDWRGSFS feature support for HVM guests

Write/read FS/GS base instructions enable user level code to
read/write FS & GS segment base registers for thread local storage.

Signed-off-by: Yang, Wei <wei.y.yang@xxxxxxxxx>
---


diff -r 35b4220c98bc -r 8c75f35d55f6 tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c        Wed Jun 15 16:05:14 2011 +0100
+++ b/tools/libxc/xc_cpuid_x86.c        Wed Jun 15 16:06:48 2011 +0100
@@ -356,7 +356,8 @@
     case 0x00000007: /* Intel-defined CPU features */
         if ( input[1] == 0 ) {
             regs[1] &= (bitmaskof(X86_FEATURE_SMEP) |
-                        bitmaskof(X86_FEATURE_ERMS));
+                        bitmaskof(X86_FEATURE_ERMS) |
+                        bitmaskof(X86_FEATURE_FSGSBASE));
         } else
             regs[1] = 0;
         regs[0] = regs[2] = regs[3] = 0;
diff -r 35b4220c98bc -r 8c75f35d55f6 xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h     Wed Jun 15 16:05:14 2011 +0100
+++ b/xen/include/asm-x86/hvm/hvm.h     Wed Jun 15 16:06:48 2011 +0100
@@ -325,6 +325,7 @@
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
         (cpu_has_smep ? X86_CR4_SMEP : 0) |             \
+        (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) |     \
         ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
                       ? X86_CR4_VMXE : 0)  |             \
         (xsave_enabled(_v) ? X86_CR4_OSXSAVE : 0))))

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.