Skip to content

Commit 46cbc04

Browse files
committed
Revert "KVM: X86: Update mmu->pdptrs only when it is changed"
This reverts commit 24cd19a. Sean Christopherson reports: "Commit 24cd19a ('KVM: X86: Update mmu->pdptrs only when it is changed') breaks nested VMs with EPT in L0 and PAE shadow paging in L2. Reproducing is trivial, just disable EPT in L1 and run a VM. I haven't investigating how it breaks things." Reviewed-by: Sean Christopherson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent a6fec53 commit 46cbc04

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

arch/x86/kvm/x86.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -841,12 +841,9 @@ int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3)
841841
}
842842
}
843843

844-
kvm_register_mark_available(vcpu, VCPU_EXREG_PDPTR);
845-
if (memcmp(mmu->pdptrs, pdpte, sizeof(mmu->pdptrs))) {
846-
memcpy(mmu->pdptrs, pdpte, sizeof(mmu->pdptrs));
847-
kvm_register_mark_dirty(vcpu, VCPU_EXREG_PDPTR);
848-
kvm_make_request(KVM_REQ_LOAD_MMU_PGD, vcpu);
849-
}
844+
memcpy(mmu->pdptrs, pdpte, sizeof(mmu->pdptrs));
845+
kvm_register_mark_dirty(vcpu, VCPU_EXREG_PDPTR);
846+
kvm_make_request(KVM_REQ_LOAD_MMU_PGD, vcpu);
850847
vcpu->arch.pdptrs_from_userspace = false;
851848

852849
return 1;

0 commit comments

Comments
 (0)