diff mbox

[5/5] KVM: MMU: Fix check for cr3 outside guest memory

Message ID 1272271723-9070-6-git-send-email-avi@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Avi Kivity April 26, 2010, 8:48 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 6e925b3..e3acc9e 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2083,7 +2083,7 @@  static int mmu_alloc_roots(struct kvm_vcpu *vcpu)
 		} else
 			root_gfn = vcpu->arch.cr3 >> PAGE_SHIFT;
 
-		if (mmu_check_root(vcpu, root_gfn))
+		if (!direct && mmu_check_root(vcpu, root_gfn))
 			return 1;
 		sp = kvm_mmu_get_page(vcpu, root_gfn, i << 30,
 				      PT32_ROOT_LEVEL, direct,