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

[Xen-changelog] [xen-unstable] nestedsvm: reduce TLB flushes



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1305878818 -3600
# Node ID 4664f19944d76fcb95695f92abbef79f01750c80
# Parent  a768a10d32b4b85e29face84de2676b37bc0f673
nestedsvm: reduce TLB flushes

Reduce TLB flushes:
1. When we update the cr3 during VMRUN/VMEXIT emulation
    we toggle between n1asid and n2asid forth and back
    => no TLB flush needed
2. Only flush n1asid or n2asid depending on vcpu guest mode
    and not both unconditionally.

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r a768a10d32b4 -r 4664f19944d7 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Fri May 20 08:54:45 2011 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Fri May 20 09:06:58 2011 +0100
@@ -451,7 +451,14 @@
         break;
     case 3:
         vmcb_set_cr3(vmcb, v->arch.hvm_vcpu.hw_cr[3]);
-        hvm_asid_flush_vcpu(v);
+        if ( !nestedhvm_enabled(v->domain) )
+            hvm_asid_flush_vcpu(v);
+        else if ( nestedhvm_vmswitch_in_progress(v) )
+            ; /* We toggle between n1asid/n2asid -> no flush required. */
+        else
+            hvm_asid_flush_vcpu_asid(
+                nestedhvm_vcpu_in_guestmode(v)
+                ? &vcpu_nestedhvm(v).nv_n2asid : &v->arch.hvm_vcpu.n1asid);
         break;
     case 4:
         value = HVM_CR4_HOST_MASK;

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


 


Rackspace

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