Revert "VMX: flush cache when vmentry back to UC guest"
authorJan Beulich <jbeulich@suse.com>
Fri, 6 Dec 2013 10:10:54 +0000 (11:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Dec 2013 10:10:54 +0000 (11:10 +0100)
This reverts commit 86d60e85 as well as one related change from
62652c00 ("VMX: fix cr0.cd handling"), on the basis that all of this
flushing is still insufficient and, while not known to fix anything, is
known to negatively affect performance.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/vcpu.h

index b1f8dfee5ccf8682a02224573756df10a7287468..69f7e7443ce5452218788f239f7430a9130c23c4 100644 (file)
@@ -2571,9 +2571,6 @@ static enum hvm_copy_result __hvm_copy(
         return HVMCOPY_unhandleable;
 #endif
 
-    if ( unlikely(curr->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory = 1;
-
     while ( todo > 0 )
     {
         count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);
@@ -2685,9 +2682,6 @@ static enum hvm_copy_result __hvm_clear(paddr_t addr, int size)
         return HVMCOPY_unhandleable;
 #endif
 
-    if ( unlikely(curr->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory = 1;
-
     while ( todo > 0 )
     {
         count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);
index 4ab15bc2a069ae8628d367c38bc1bae7aa571cac..dfff6280d8c521fe186f8288b894ec0618046225 100644 (file)
@@ -643,10 +643,6 @@ static void vmx_ctxt_switch_to(struct vcpu *v)
             __invept(INVEPT_SINGLE_CONTEXT, ept_get_eptp(ept_data), 0);
     }
 
-    /* For guest cr0.cd setting, do not use potentially polluted cache */
-    if ( unlikely(v->arch.hvm_vcpu.cache_mode == NO_FILL_CACHE_MODE) )
-        wbinvd();
-
     vmx_restore_guest_msrs(v);
     vmx_restore_dr(v);
 }
@@ -3008,13 +3004,6 @@ void vmx_vmenter_helper(const struct cpu_user_regs *regs)
     struct hvm_vcpu_asid *p_asid;
     bool_t need_flush;
 
-    /* In case hypervisor access hvm memory when guest uc mode */
-    if ( unlikely(curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory) )
-    {
-        curr->arch.hvm_vcpu.hypervisor_access_uc_hvm_memory = 0;
-        wbinvd();
-    }
-
     if ( !cpu_has_vmx_vpid )
         goto out;
     if ( nestedhvm_vcpu_in_guestmode(curr) )
index c1abcec3a8848dc902c4cbe0da9775a3a95cdb58..122ab0d91cc5d61b01785e4c4f8ca0f83e561ef6 100644 (file)
@@ -172,7 +172,6 @@ struct hvm_vcpu {
 
     /* Which cache mode is this VCPU in (CR0:CD/NW)? */
     u8                  cache_mode;
-    bool_t              hypervisor_access_uc_hvm_memory;
 
     struct hvm_vcpu_io  hvm_io;