diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-02-14 17:13:48 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-02-25 16:20:19 +0300 |
commit | 6d58f275e6dcded101bd7e6688bf308d3385e238 (patch) | |
tree | a1643221f31022220049b31855f0716f1c47a316 /arch | |
parent | d2e5f3334169ab1bbbf13902e9fc8ef605ba824d (diff) | |
download | linux-6d58f275e6dcded101bd7e6688bf308d3385e238.tar.xz |
KVM: x86/mmu: clear MMIO cache when unloading the MMU
For cleanliness, do not leave a stale GVA in the cache after all the roots are
cleared. In practice, kvm_mmu_load will go through kvm_mmu_sync_roots if
paging is on, and will not use vcpu_match_mmio_gva at all if paging is off.
However, leaving data in the cache might cause bugs in the future.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/mmu/mmu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index a1768a831d97..b2c1c4eb6007 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -5082,6 +5082,7 @@ void kvm_mmu_unload(struct kvm_vcpu *vcpu) WARN_ON(VALID_PAGE(vcpu->arch.root_mmu.root.hpa)); kvm_mmu_free_roots(kvm, &vcpu->arch.guest_mmu, KVM_MMU_ROOTS_ALL); WARN_ON(VALID_PAGE(vcpu->arch.guest_mmu.root.hpa)); + vcpu_clear_mmio_info(vcpu, MMIO_GVA_ANY); } static bool need_remote_flush(u64 old, u64 new) |