[Intel-gfx] [PATCH v3] vfio: fix deadlock between group lock and kvm lock
Alex Williamson
alex.williamson at redhat.com
Fri Feb 3 21:35:51 UTC 2023
On Fri, 3 Feb 2023 16:19:10 -0500
Matthew Rosato <mjrosato at linux.ibm.com> wrote:
> > @@ -350,32 +350,25 @@ void vfio_device_get_kvm_safe(struct vfio_device *device)
> >
> > lockdep_assert_held(&device->dev_set->lock);
> >
> > - spin_lock(&device->group->kvm_ref_lock);
> > - if (!device->group->kvm)
> > - goto unlock;
> > -
> > pfn = symbol_get(kvm_put_kvm);
> > if (WARN_ON(!pfn))
> > - goto unlock;
> > + return;
> >
> > fn = symbol_get(kvm_get_kvm_safe);
> > if (WARN_ON(!fn)) {
> > symbol_put(kvm_put_kvm);
> > - goto unlock;
> > + return;
> > }
> > > ret = fn(device->group->kvm);
>
> s/device->group->kvm/kvm/
Oops, yes.
> With that small change, this looks good to me too (and testing looks
> good too). Do you want me to send a v4 for one last round of review?
Please do. Thanks,
Alex
More information about the Intel-gfx
mailing list