]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
KVM: nSVM: Drop pointless pdptrs_changed() check on nested transition
authorSean Christopherson <seanjc@google.com>
Mon, 7 Jun 2021 09:01:57 +0000 (12:01 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Jun 2021 17:09:46 +0000 (13:09 -0400)
Remove the "PDPTRs unchanged" check to skip PDPTR loading during nested
SVM transitions as it's not at all an optimization.  Reading guest memory
to get the PDPTRs isn't magically cheaper by doing it in pdptrs_changed(),
and if the PDPTRs did change, KVM will end up doing the read twice.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210607090203.133058-3-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c

index 34fc74b0d58a30fff6383e54d68be65ce77f2ad2..f0a7f8432527eeeb06ec4d174017f1ab29641648 100644 (file)
@@ -391,10 +391,8 @@ static int nested_svm_load_cr3(struct kvm_vcpu *vcpu, unsigned long cr3,
                return -EINVAL;
 
        if (!nested_npt && is_pae_paging(vcpu) &&
-           (cr3 != kvm_read_cr3(vcpu) || pdptrs_changed(vcpu))) {
-               if (CC(!load_pdptrs(vcpu, vcpu->arch.walk_mmu, cr3)))
-                       return -EINVAL;
-       }
+           CC(!load_pdptrs(vcpu, vcpu->arch.walk_mmu, cr3)))
+               return -EINVAL;
 
        /*
         * TODO: optimize unconditional TLB flush/MMU sync here and in