KVM: x86/mmu: load new PGD after the shadow MMU is initialized
[linux-2.6-microblaze.git] / arch / x86 / kvm / vmx / nested.c
index b7bc634..1dfe239 100644 (file)
@@ -1126,15 +1126,15 @@ static int nested_vmx_load_cr3(struct kvm_vcpu *vcpu, unsigned long cr3,
                return -EINVAL;
        }
 
-       if (!nested_ept)
-               kvm_mmu_new_pgd(vcpu, cr3);
-
        vcpu->arch.cr3 = cr3;
        kvm_register_mark_dirty(vcpu, VCPU_EXREG_CR3);
 
        /* Re-initialize the MMU, e.g. to pick up CR4 MMU role changes. */
        kvm_init_mmu(vcpu);
 
+       if (!nested_ept)
+               kvm_mmu_new_pgd(vcpu, cr3);
+
        return 0;
 }