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

[Xen-devel] [PATCH 5/5] vtdt: Export tdt feature to guest



vtdt: Export tdt feature to guest

Via CPUID.01H:ECX.TSC_Deadline[bit 24] according to the value of hvm param 
HVM_PARAM_TDT_ENABLED.

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>

diff -r ac0a07455cd9 tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h       Thu Dec 09 22:33:18 2010 +0800
+++ b/tools/libxc/xc_cpufeature.h       Thu Dec 09 22:33:22 2010 +0800
@@ -99,6 +99,7 @@
 #define X86_FEATURE_SSE4_1     (4*32+19) /* Streaming SIMD Extensions 4.1 */
 #define X86_FEATURE_SSE4_2     (4*32+20) /* Streaming SIMD Extensions 4.2 */
 #define X86_FEATURE_POPCNT     (4*32+23) /* POPCNT instruction */
+#define X86_FEATURE_TSC_DEADLINE (4*32+24) /* "tdt" TSC Deadline Timer */
 #define X86_FEATURE_AES                (4*32+25) /* AES acceleration 
instructions */
 #define X86_FEATURE_XSAVE      (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */
 #define X86_FEATURE_AVX                (4*32+28) /* Advanced Vector Extensions 
*/
diff -r ac0a07455cd9 tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c        Thu Dec 09 22:33:18 2010 +0800
+++ b/tools/libxc/xc_cpuid_x86.c        Thu Dec 09 22:33:22 2010 +0800
@@ -129,8 +129,23 @@ static void intel_xc_cpuid_policy(
     const unsigned int *input, unsigned int *regs,
     int is_pae)
 {
+    unsigned long tdt;
+    int emul_tdt;
+
+    xc_get_hvm_param(xch, domid, HVM_PARAM_TDT_ENABLED, &tdt);
+    emul_tdt = !!tdt;
+
     switch ( input[0] )
     {
+    case 0x00000001:
+        /*
+         * ECX[24] is TSC-Deadline Timer feature, support it even it is not
+         * available physically
+         */
+        if ( emul_tdt )
+            regs[2] |= bitmaskof(X86_FEATURE_TSC_DEADLINE);
+        break;
+        
     case 0x00000004:
         /*
          * EAX[31:26] is Maximum Cores Per Package (minus one).

Attachment: 6-tdt-to-guest.patch
Description: 6-tdt-to-guest.patch

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

 


Rackspace

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