Commit a91f387b authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: x86/mmu: Sync roots after MMU load iff load as successful

For clarity, explicitly skip syncing roots if the MMU load failed
instead of relying on the !VALID_PAGE check in kvm_mmu_sync_roots().
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Message-Id: <20210305011101.3597423-17-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 61a1773e
...@@ -4836,10 +4836,11 @@ int kvm_mmu_load(struct kvm_vcpu *vcpu) ...@@ -4836,10 +4836,11 @@ int kvm_mmu_load(struct kvm_vcpu *vcpu)
else else
r = mmu_alloc_shadow_roots(vcpu); r = mmu_alloc_shadow_roots(vcpu);
write_unlock(&vcpu->kvm->mmu_lock); write_unlock(&vcpu->kvm->mmu_lock);
kvm_mmu_sync_roots(vcpu);
if (r) if (r)
goto out; goto out;
kvm_mmu_sync_roots(vcpu);
kvm_mmu_load_pgd(vcpu); kvm_mmu_load_pgd(vcpu);
static_call(kvm_x86_tlb_flush_current)(vcpu); static_call(kvm_x86_tlb_flush_current)(vcpu);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment