@@ -2070,16 +2070,17 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu)
for (i = 0; i < nr_roots; ++i) {
root = rootp[i];
ASSERT(!VALID_PAGE(root));
- if (vcpu->arch.mmu.root_level == PT32E_ROOT_LEVEL) {
+
+ if (direct)
+ root_gfn = 0;
+ else if (vcpu->arch.mmu.root_level == PT32E_ROOT_LEVEL) {
pdptr = kvm_pdptr_read(vcpu, i);
if (!is_present_gpte(pdptr)) {
rootp[i] = 0;
continue;
}
root_gfn = pdptr >> PAGE_SHIFT;
- } else if (vcpu->arch.mmu.root_level == 0)
- root_gfn = 0;
- else
+ } else
root_gfn = vcpu->arch.cr3 >> PAGE_SHIFT;
if (mmu_check_root(vcpu, root_gfn))