From: "hch@infradead.org" <hch@infradead.org>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Matthew Rosato <mjrosato@linux.ibm.com>,
"jgg@nvidia.com" <jgg@nvidia.com>,
"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
"jjherne@linux.ibm.com" <jjherne@linux.ibm.com>,
"akrowiak@linux.ibm.com" <akrowiak@linux.ibm.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"hch@infradead.org" <hch@infradead.org>,
"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"cohuck@redhat.com" <cohuck@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"zhenyuw@linux.intel.com" <zhenyuw@linux.intel.com>,
"pasic@linux.ibm.com" <pasic@linux.ibm.com>,
"borntraeger@linux.ibm.com" <borntraeger@linux.ibm.com>,
"intel-gvt-dev@lists.freedesktop.org"
<intel-gvt-dev@lists.freedesktop.org>,
"Wang, Zhi A" <zhi.a.wang@intel.com>
Subject: Re: [PATCH v2 1/1] vfio: remove VFIO_GROUP_NOTIFY_SET_KVM
Date: Wed, 18 May 2022 23:48:15 -0700 [thread overview]
Message-ID: <YoXoL2tt06sEz9Rd@infradead.org> (raw)
In-Reply-To: <BN9PR11MB527684F9BD1B906B930E4A468CD09@BN9PR11MB5276.namprd11.prod.outlook.com>
On Thu, May 19, 2022 at 06:43:06AM +0000, Tian, Kevin wrote:
> > This fixes a user-triggerable oops in GVT.
>
> No changelog.
??
the cover latter clearly states what has changed since v1, and this
patch has a good commit log. This is exactly how it is supposed to
be done.
>
> >
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> > Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
>
> Not sure whether Christoph wants a s-o-b here when he wrote
> the snippet to remove the release work of gvt...
That's just tivial code removal, so no.
>
> > @@ -1083,11 +1083,22 @@ static struct file *vfio_device_open(struct
> > vfio_device *device)
> >
> > mutex_lock(&device->dev_set->lock);
> > device->open_count++;
> > + down_read(&device->group->group_rwsem);
> > + if (device->open_count == 1 && device->group->kvm) {
> > + /*
> > + * Here we pass the KVM pointer with the group under the
> > read
> > + * lock. If the device driver will use it, it must obtain a
> > + * reference and release it during close_device.
> > + */
> > + device->kvm = device->group->kvm;
> > + }
> > +
> > if (device->open_count == 1 && device->ops->open_device) {
>
> Merge the two branches so both are under if (device->open_count == 1) {}
> (and group_rwsem can be also moved inside)
Yeah. And we don't really need the device->group->kvm check, as
it would otherwise assign NULL which is perfectly fine.
But otherwise this also looks good to me:
Reviewed-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2022-05-19 6:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 21:26 [PATCH v2 0/1] vfio: remove VFIO_GROUP_NOTIFY_SET_KVM Matthew Rosato
2022-05-18 21:26 ` [PATCH v2 1/1] " Matthew Rosato
2022-05-19 6:43 ` Tian, Kevin
2022-05-19 6:48 ` hch [this message]
2022-05-19 6:52 ` Tian, Kevin
2022-05-19 12:33 ` Jason Gunthorpe
2022-05-19 16:23 ` Tony Krowiak
2022-05-19 16:35 ` Matthew Rosato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YoXoL2tt06sEz9Rd@infradead.org \
--to=hch@infradead.org \
--cc=akrowiak@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=jgg@nvidia.com \
--cc=jjherne@linux.ibm.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=zhenyuw@linux.intel.com \
--cc=zhi.a.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox