[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230203143551.2f349702.alex.williamson@redhat.com>
Date: Fri, 3 Feb 2023 14:35:51 -0700
From: Alex Williamson <alex.williamson@...hat.com>
To: Matthew Rosato <mjrosato@...ux.ibm.com>
Cc: "Liu, Yi L" <yi.l.liu@...el.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"jgg@...dia.com" <jgg@...dia.com>,
"cohuck@...hat.com" <cohuck@...hat.com>,
"farman@...ux.ibm.com" <farman@...ux.ibm.com>,
"pmorel@...ux.ibm.com" <pmorel@...ux.ibm.com>,
"borntraeger@...ux.ibm.com" <borntraeger@...ux.ibm.com>,
"frankja@...ux.ibm.com" <frankja@...ux.ibm.com>,
"imbrenda@...ux.ibm.com" <imbrenda@...ux.ibm.com>,
"david@...hat.com" <david@...hat.com>,
"akrowiak@...ux.ibm.com" <akrowiak@...ux.ibm.com>,
"jjherne@...ux.ibm.com" <jjherne@...ux.ibm.com>,
"pasic@...ux.ibm.com" <pasic@...ux.ibm.com>,
"zhenyuw@...ux.intel.com" <zhenyuw@...ux.intel.com>,
"Wang, Zhi A" <zhi.a.wang@...el.com>,
"Christopherson, , Sean" <seanjc@...gle.com>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"intel-gvt-dev@...ts.freedesktop.org"
<intel-gvt-dev@...ts.freedesktop.org>,
"intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] vfio: fix deadlock between group lock and kvm lock
On Fri, 3 Feb 2023 16:19:10 -0500
Matthew Rosato <mjrosato@...ux.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
Powered by blists - more mailing lists