]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: MMU: Avoid page prefetch on SVM
authorAvi Kivity <avi@qumranet.com>
Thu, 29 May 2008 11:56:28 +0000 (14:56 +0300)
committerAvi Kivity <avi@qumranet.com>
Sun, 20 Jul 2008 09:42:30 +0000 (12:42 +0300)
SVM cannot benefit from page prefetching since guest page fault bypass
cannot by made to work there.  Avoid accessing the guest page table in
this case.

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

index 62741b7c4223adf2deb0fc8deb3fa0939f0f8cc2..5ebb2788bd73cad5246d6993f2ce4d3fea6fc9ae 100644 (file)
@@ -850,7 +850,10 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
        hlist_add_head(&sp->hash_link, bucket);
        if (!metaphysical)
                rmap_write_protect(vcpu->kvm, gfn);
-       vcpu->arch.mmu.prefetch_page(vcpu, sp);
+       if (shadow_trap_nonpresent_pte != shadow_notrap_nonpresent_pte)
+               vcpu->arch.mmu.prefetch_page(vcpu, sp);
+       else
+               nonpaging_prefetch_page(vcpu, sp);
        return sp;
 }