浏览代码

KVM: MMU: Avoid page prefetch on SVM

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>
Avi Kivity 17 年之前
父节点
当前提交
131d82791b
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      arch/x86/kvm/mmu.c

+ 4 - 1
arch/x86/kvm/mmu.c

@@ -850,7 +850,10 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
 	hlist_add_head(&sp->hash_link, bucket);
 	hlist_add_head(&sp->hash_link, bucket);
 	if (!metaphysical)
 	if (!metaphysical)
 		rmap_write_protect(vcpu->kvm, gfn);
 		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;
 	return sp;
 }
 }