SVM: fix performance decrease with asid assignment
authorChristoph Egger <Christoph.Egger@amd.com>
Wed, 13 Jun 2012 09:51:26 +0000 (11:51 +0200)
committerChristoph Egger <Christoph.Egger@amd.com>
Wed, 13 Jun 2012 09:51:26 +0000 (11:51 +0200)
Do not clear asid cleanbit unconditionally. This shaves off 100 cycles
from the VMRUN instruction.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/svm/asid.c

index 14e2abd9198f49f58642ae35612bea9a313515db..3fde3631c452ca4e6061deb1a469add1031376c0 100644 (file)
@@ -56,7 +56,8 @@ void svm_asid_handle_vmrun(void)
         return;
     }
 
-    vmcb_set_guest_asid(vmcb, p_asid->asid);
+    if (vmcb_get_guest_asid(vmcb) != p_asid->asid)
+        vmcb_set_guest_asid(vmcb, p_asid->asid);
     vmcb->tlb_control = need_flush;
 }