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 5/5] vtdt: Export tdt feature to guest

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 5/5] vtdt: Export tdt feature to guest
From: "Wei, Gang" <gang.wei@xxxxxxxxx>
Date: Tue, 14 Dec 2010 11:27:53 +0800
Accept-language: zh-CN, en-US
Acceptlanguage: zh-CN, en-US
Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "Wei, Gang" <gang.wei@xxxxxxxxx>
Delivery-date: Mon, 13 Dec 2010 19:34:06 -0800
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: AcubPuR9OiFFP+nhRFu81qaEkZ+8Qg==
Thread-topic: [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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 5/5] vtdt: Export tdt feature to guest, Wei, Gang <=