]> xenbits.xensource.com Git - xen.git/commitdiff
SVM: fix performance decrease with asid assignment
authorChristoph Egger <Christoph.Egger@amd.com>
Mon, 9 Jul 2012 09:28:50 +0000 (10:28 +0100)
committerChristoph Egger <Christoph.Egger@amd.com>
Mon, 9 Jul 2012 09:28:50 +0000 (10:28 +0100)
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-unstable changeset:   25482:34c725807d21
xen-unstable date:        Wed Jun 13 11:51:26 2012 +0200

xen/arch/x86/hvm/svm/asid.c

index 3b9c6ce0f6ca204ef35f9648f1de9d87cbf582a4..7bc17b5f3e473eecfc783d50e7831d04e3ba64f4 100644 (file)
@@ -52,7 +52,8 @@ void svm_asid_handle_vmrun(void)
         return;
     }
 
-    vmcb_set_guest_asid(vmcb, curr->arch.hvm_vcpu.asid);
+    if (vmcb_get_guest_asid(vmcb) != curr->arch.hvm_vcpu.asid)
+        vmcb_set_guest_asid(vmcb, curr->arch.hvm_vcpu.asid);
     vmcb->tlb_control = need_flush;
 }