]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Call kvm_arch_flush_shadow_memslot() on the old slot in kvm_invalidate_memslot()
authorMaciej S. Szmigiero <maciej.szmigiero@oracle.com>
Mon, 6 Dec 2021 19:54:31 +0000 (20:54 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Dec 2021 09:24:35 +0000 (04:24 -0500)
commit5600dae211d0bf1edd339c3557d71ce38f80ca88
treefe79d088f4cb1e187ec06af0fb9b685bf41f14cb
parent8d43b4b93fc7d207c26305b659135fceba56e18a
KVM: Call kvm_arch_flush_shadow_memslot() on the old slot in kvm_invalidate_memslot()

kvm_invalidate_memslot() calls kvm_arch_flush_shadow_memslot() on the
active, but KVM_MEMSLOT_INVALID slot.
Do it on the inactive (but valid) old slot instead since arch code really
should not get passed such invalid slot.

Note that this means that the "arch" field of the slot provided to
kvm_arch_flush_shadow_memslot() may have stale data since this function
is called with slots_arch_lock released.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <813595ecc193d6ae39a87709899d4251523b05f8.1638817641.git.maciej.szmigiero@oracle.com>
virt/kvm/kvm_main.c