]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Free arrays for old memslot when moving memslot's base gfn
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 18 Feb 2020 21:07:25 +0000 (13:07 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 16:57:21 +0000 (17:57 +0100)
commit7a1ea1bb1ca148cf949725285f75f44ae268eaf7
tree5d622ab48c6afebfe57587e26a3c7347b314c2a2
parentef60b5b6caae7f55e8f45dcd45fb82b43d11383b
KVM: x86: Free arrays for old memslot when moving memslot's base gfn

Explicitly free the metadata arrays (stored in slot->arch) in the old
memslot structure when moving the memslot's base gfn is committed.  This
eliminates x86's dependency on kvm_free_memslot() being called when a
memslot move is committed, and paves the way for removing the funky code
in kvm_free_memslot() that conditionally frees structures based on its
@dont param.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c