KVM: selftests: Don't bother deleting memslots in KVM when freeing VMs
When freeing a VM, don't call into KVM to manually remove each memslot, simply cleanup and free any userspace assets associated with the memory region. KVM is ultimately responsible for ensuring kernel resources are freed when the VM is destroyed, deleting memslots one-by-one is unnecessarily slow, and unless a test is already leaking the VM fd, the VM will be destroyed when kvm_vm_release() is called. Not deleting KVM's memslot also allows cleaning up dead VMs without having to care whether or not the to-be-freed VM is dead or alive. Reported-by:Eric Auger <eric.auger@redhat.com> Reviewed-by:
Eric Auger <eric.auger@redhat.com> Tested-by:
Eric Auger <eric.auger@redhat.com> Reported-by:
Mark Brown <broonie@kernel.org> Signed-off-by:
Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/kvmarm/Zy0bcM0m-N18gAZz@google.com/ Signed-off-by:
Oliver Upton <oliver.upton@linux.dev>
Loading
Please register or sign in to comment