lkml.org 
[lkml]   [2022]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 12/18] KVM: x86/mmu: clear MMIO cache when unloading the MMU
    Date
    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>
    ---
    arch/x86/kvm/mmu/mmu.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
    index b01160716c6a..4e8e3e9530ca 100644
    --- a/arch/x86/kvm/mmu/mmu.c
    +++ b/arch/x86/kvm/mmu/mmu.c
    @@ -5111,6 +5111,7 @@ void kvm_mmu_unload(struct kvm_vcpu *vcpu)
    {
    __kvm_mmu_unload(vcpu->kvm, &vcpu->arch.root_mmu);
    __kvm_mmu_unload(vcpu->kvm, &vcpu->arch.guest_mmu);
    + vcpu_clear_mmio_info(vcpu, MMIO_GVA_ANY);
    }

    static bool need_remote_flush(u64 old, u64 new)
    --
    2.31.1

    \
     
     \ /
      Last update: 2022-02-17 22:05    [W:2.181 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site