On Thu, Nov 07, 2024 at 12:26:45PM -0800, Sean Christopherson wrote: > On Thu, Nov 07, 2024, Oliver Upton wrote: > > On Thu, Nov 07, 2024 at 11:56:32AM -0800, Sean Christopherson wrote: > > > --- > > > From: Sean Christopherson <seanjc@xxxxxxxxxx> > > > Date: Thu, 7 Nov 2024 11:39:59 -0800 > > > Subject: [PATCH] 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. > > > > Can you add a comment to kvm_vm_free() about why we want to avoid ioctls > > in that helper? It'd help discourage this situation from happening again > > in the future in the unlikely case someone wants to park an ioctl there. > > > > > Reported-by: Eric Auger <eric.auger@xxxxxxxxxx> > > > Reported-by: Mark Brown <broonie@xxxxxxxxxx> > > > Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx> > > > > I'm assuming you want to take this, happy to grab it otherwise. > > You take it. Unless my git foo is off the rails, this is needs to go into 6.12, > along with a fix for the vGIC test. That, and I already sent Paolo a pull request > for rc7; I don't want to overwork myself ;-) Fine -- I _guess_ I'll do it then :) It'll just go in the 6.13 pull request. https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git/commit/?h=next&id=5afe18dfa47daead88517b095b6e0ce012f031f8 -- Thanks, Oliver