WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Enable RDWRGSFS feature support for HVM guests

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Enable RDWRGSFS feature support for HVM guests
From: "Yang, Wei Y" <wei.y.yang@xxxxxxxxx>
Date: Tue, 14 Jun 2011 22:43:32 +0800
Accept-language: en-US
Acceptlanguage: en-US
Delivery-date: Tue, 14 Jun 2011 07:44:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcwqknbozyHaBmbNQ8uwJBWpthaSzgACCtBgAACjcoAAAQx1YA==
Thread-topic: [PATCH] Enable RDWRGSFS feature support for HVM guests
This patch enables RDWRGSFS feature to 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>

---
 tools/libxc/xc_cpuid_x86.c    |    3 ++-
 xen/include/asm-x86/hvm/hvm.h |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)


 diff -r f4a47275aebf tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c        Tue Jun 14 13:13:18 2011 +0100
+++ b/tools/libxc/xc_cpuid_x86.c        Tue Jun 14 22:09:24 2011 +0800
@@ -356,7 +356,8 @@ static void xc_cpuid_hvm_policy(
     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 f4a47275aebf xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h     Tue Jun 14 13:13:18 2011 +0100
+++ b/xen/include/asm-x86/hvm/hvm.h     Tue Jun 14 22:09:24 2011 +0800
@@ -324,6 +324,7 @@ static inline int hvm_do_pmu_interrupt(s
         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) |     \
         (xsave_enabled(_v) ? X86_CR4_OSXSAVE : 0))))
 
 /* These exceptions must always be intercepted. */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Enable RDWRGSFS feature support for HVM guests, Yang, Wei Y <=