KVM: Optimize kvm_mmu_unprotect_page_virt() for tdp
authorAvi Kivity <avi@redhat.com>
Thu, 27 Aug 2009 10:37:06 +0000 (13:37 +0300)
committerAvi Kivity <avi@redhat.com>
Thu, 10 Sep 2009 07:46:56 +0000 (10:46 +0300)
We know no pages are protected, so we can short-circuit the whole thing
(including fairly nasty guest memory accesses).

Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c

index 6f38178..eca41ae 100644 (file)
@@ -2694,6 +2694,9 @@ int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva)
        gpa_t gpa;
        int r;
 
+       if (tdp_enabled)
+               return 0;
+
        gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, gva);
 
        spin_lock(&vcpu->kvm->mmu_lock);