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-changelog

[Xen-changelog] [xen-unstable] vmx: Enable WBINVD intercepts to avoid re

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vmx: Enable WBINVD intercepts to avoid real WBINVD for non-vtd guests.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Nov 2007 04:40:06 -0800
Delivery-date: Wed, 14 Nov 2007 04:40:32 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1194613198 0
# Node ID 8d8d179b9b05d46c0b0f7b745306269800b1e83a
# Parent  837f83225153547109480d63b3386cb8f65b5274
vmx: Enable WBINVD intercepts to avoid real WBINVD for non-vtd guests.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c        |    3 ++-
 xen/arch/x86/hvm/vmx/vmx.c         |   14 ++++++++++++--
 xen/include/asm-x86/hvm/vmx/vmcs.h |    1 +
 xen/include/asm-x86/hvm/vmx/vmx.h  |    5 +----
 4 files changed, 16 insertions(+), 7 deletions(-)

diff -r 837f83225153 -r 8d8d179b9b05 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c       Fri Nov 09 12:08:37 2007 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c       Fri Nov 09 12:59:58 2007 +0000
@@ -106,7 +106,8 @@ static void vmx_init_vmcs_config(void)
     if ( _vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
     {
         min = 0;
-        opt = SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
+        opt = (SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
+               SECONDARY_EXEC_WBINVD_EXITING);
         _vmx_secondary_exec_control = adjust_vmx_controls(
             min, opt, MSR_IA32_VMX_PROCBASED_CTLS2);
     }
diff -r 837f83225153 -r 8d8d179b9b05 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Fri Nov 09 12:08:37 2007 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Fri Nov 09 12:59:58 2007 +0000
@@ -2909,11 +2909,21 @@ asmlinkage void vmx_vmexit_handler(struc
     }
 
     case EXIT_REASON_INVD:
-    {
-        inst_len = __get_instruction_length(); /* Safe: INVD */
+    case EXIT_REASON_WBINVD:
+    {
+        inst_len = __get_instruction_length(); /* Safe: INVD, WBINVD */
         __update_guest_eip(inst_len);
         if ( !list_empty(&(domain_hvm_iommu(v->domain)->pdev_list)) )
+        {
             wbinvd();
+            /* Disable further WBINVD intercepts. */
+            if ( (exit_reason == EXIT_REASON_WBINVD) &&
+                 (vmx_cpu_based_exec_control &
+                  CPU_BASED_ACTIVATE_SECONDARY_CONTROLS) )
+                __vmwrite(SECONDARY_VM_EXEC_CONTROL,
+                          vmx_secondary_exec_control &
+                          ~SECONDARY_EXEC_WBINVD_EXITING);
+        }
         break;
     }
 
diff -r 837f83225153 -r 8d8d179b9b05 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h        Fri Nov 09 12:08:37 2007 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h        Fri Nov 09 12:59:58 2007 +0000
@@ -131,6 +131,7 @@ extern u32 vmx_vmentry_control;
 extern u32 vmx_vmentry_control;
 
 #define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
+#define SECONDARY_EXEC_WBINVD_EXITING           0x00000040
 extern u32 vmx_secondary_exec_control;
 
 extern bool_t cpu_has_vmx_ins_outs_instr_info;
diff -r 837f83225153 -r 8d8d179b9b05 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h Fri Nov 09 12:08:37 2007 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h Fri Nov 09 12:59:58 2007 +0000
@@ -71,18 +71,15 @@ void vmx_vlapic_msr_changed(struct vcpu 
 #define EXIT_REASON_IO_INSTRUCTION      30
 #define EXIT_REASON_MSR_READ            31
 #define EXIT_REASON_MSR_WRITE           32
-
 #define EXIT_REASON_INVALID_GUEST_STATE 33
 #define EXIT_REASON_MSR_LOADING         34
-
 #define EXIT_REASON_MWAIT_INSTRUCTION   36
 #define EXIT_REASON_MONITOR_INSTRUCTION 39
 #define EXIT_REASON_PAUSE_INSTRUCTION   40
-
 #define EXIT_REASON_MACHINE_CHECK       41
-
 #define EXIT_REASON_TPR_BELOW_THRESHOLD 43
 #define EXIT_REASON_APIC_ACCESS         44
+#define EXIT_REASON_WBINVD              54
 
 /*
  * Interruption-information format

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] vmx: Enable WBINVD intercepts to avoid real WBINVD for non-vtd guests., Xen patchbot-unstable <=