summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-12-11 02:13:37 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2022-01-07 18:44:39 +0300
commit46cbc0400f85987954f6e2c110409f8f60725232 (patch)
tree4bea4af08a7dbfe1c911a4f11f09211a6bd65163 /arch
parenta6fec53947cf48e14cc41e2a69dd7d2aa7a00e65 (diff)
downloadlinux-46cbc0400f85987954f6e2c110409f8f60725232.tar.xz
Revert "KVM: X86: Update mmu->pdptrs only when it is changed"
This reverts commit 24cd19a28cb7174df502162641d6e1e12e7ffbd9. Sean Christopherson reports: "Commit 24cd19a28cb7 ('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 <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/x86.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8912f44c640d..074a0578979f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -841,12 +841,9 @@ int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3)
}
}
- kvm_register_mark_available(vcpu, VCPU_EXREG_PDPTR);
- if (memcmp(mmu->pdptrs, pdpte, sizeof(mmu->pdptrs))) {
- memcpy(mmu->pdptrs, pdpte, sizeof(mmu->pdptrs));
- kvm_register_mark_dirty(vcpu, VCPU_EXREG_PDPTR);
- kvm_make_request(KVM_REQ_LOAD_MMU_PGD, vcpu);
- }
+ memcpy(mmu->pdptrs, pdpte, sizeof(mmu->pdptrs));
+ kvm_register_mark_dirty(vcpu, VCPU_EXREG_PDPTR);
+ kvm_make_request(KVM_REQ_LOAD_MMU_PGD, vcpu);
vcpu->arch.pdptrs_from_userspace = false;
return 1;