All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	David Airlie <airlied@linux.ie>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christoph Hellwig <hch@lst.de>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"Liu, Yi L" <yi.l.liu@intel.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Halil Pasic <pasic@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	Tony Krowiak <akrowiak@linux.ibm.com>,
	Eric Farman <farman@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Harald Freudenberger <freude@linux.ibm.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	"intel-gvt-dev@lists.freedesktop.org"
	<intel-gvt-dev@lists.freedesktop.org>,
	Jason Herne <jjherne@linux.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>
Subject: Re: [Intel-gfx] [PATCH v2 4/7] vfio/mdev: Pass in a struct vfio_device * to vfio_dma_rw()
Date: Fri, 22 Apr 2022 14:59:37 -0300	[thread overview]
Message-ID: <20220422175937.GD1951132@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52764597BDC02C88E855EA808CF79@BN9PR11MB5276.namprd11.prod.outlook.com>

On Fri, Apr 22, 2022 at 01:50:00AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Friday, April 22, 2022 12:29 AM
> > 
> > Every caller has a readily available vfio_device pointer, use that instead
> > of passing in a generic struct device. The struct vfio_device already
> > contains the group we need so this avoids complexity, extra refcountings,
> > and a confusing lifecycle model.
> 
> Using the same description as last patch leaves the impression that
> the two patches do the exactly same type of change. But this
> patch actually includes one more change to grab a reference on the
> container. This is worth an explanation.

How about this:

Every caller has a readily available vfio_device pointer, use that instead
of passing in a generic struct device. Change vfio_dma_rw() to take in the
struct vfio_device and move the container users that would have been held
by vfio_group_get_external_user_from_dev() to vfio_dma_rw() directly, like
vfio_pin/unpin_pages().

Thanks,
Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>,
	David Airlie <airlied@linux.ie>,
	Alex Williamson <alex.williamson@redhat.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>, Daniel Vetter <daniel@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Harald Freudenberger <freude@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"intel-gvt-dev@lists.freedesktop.org" 
	<intel-gvt-dev@lists.freedesktop.org>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Jason Herne <jjherne@linux.ibm.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	Zhenyu Wang <zhenyuw@linux.intel.com>,
	"Wang, Zhi A" <zhi.a.wang@intel.com>,
	Tony Krowiak <akrowiak@linux.ibm.com>,
	Eric Farman <farman@linux.ibm.com>,
	Christoph Hellwig <hch@lst.de>, "Liu, Yi L" <yi.l.liu@intel.com>
Subject: Re: [PATCH v2 4/7] vfio/mdev: Pass in a struct vfio_device * to vfio_dma_rw()
Date: Fri, 22 Apr 2022 14:59:37 -0300	[thread overview]
Message-ID: <20220422175937.GD1951132@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52764597BDC02C88E855EA808CF79@BN9PR11MB5276.namprd11.prod.outlook.com>

On Fri, Apr 22, 2022 at 01:50:00AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Friday, April 22, 2022 12:29 AM
> > 
> > Every caller has a readily available vfio_device pointer, use that instead
> > of passing in a generic struct device. The struct vfio_device already
> > contains the group we need so this avoids complexity, extra refcountings,
> > and a confusing lifecycle model.
> 
> Using the same description as last patch leaves the impression that
> the two patches do the exactly same type of change. But this
> patch actually includes one more change to grab a reference on the
> container. This is worth an explanation.

How about this:

Every caller has a readily available vfio_device pointer, use that instead
of passing in a generic struct device. Change vfio_dma_rw() to take in the
struct vfio_device and move the container users that would have been held
by vfio_group_get_external_user_from_dev() to vfio_dma_rw() directly, like
vfio_pin/unpin_pages().

Thanks,
Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	David Airlie <airlied@linux.ie>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christoph Hellwig <hch@lst.de>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"Liu, Yi L" <yi.l.liu@intel.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Halil Pasic <pasic@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Wang, Zhi A" <zhi.a.wang@intel.com>,
	Tony Krowiak <akrowiak@linux.ibm.com>,
	Eric Farman <farman@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Harald Freudenberger <freude@linux.ibm.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	"intel-gvt-dev@lists.freedesktop.org"
	<intel-gvt-dev@lists.freedesktop.org>,
	Jason Herne <jjherne@linux.ibm.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>
Subject: Re: [PATCH v2 4/7] vfio/mdev: Pass in a struct vfio_device * to vfio_dma_rw()
Date: Fri, 22 Apr 2022 14:59:37 -0300	[thread overview]
Message-ID: <20220422175937.GD1951132@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52764597BDC02C88E855EA808CF79@BN9PR11MB5276.namprd11.prod.outlook.com>

On Fri, Apr 22, 2022 at 01:50:00AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Friday, April 22, 2022 12:29 AM
> > 
> > Every caller has a readily available vfio_device pointer, use that instead
> > of passing in a generic struct device. The struct vfio_device already
> > contains the group we need so this avoids complexity, extra refcountings,
> > and a confusing lifecycle model.
> 
> Using the same description as last patch leaves the impression that
> the two patches do the exactly same type of change. But this
> patch actually includes one more change to grab a reference on the
> container. This is worth an explanation.

How about this:

Every caller has a readily available vfio_device pointer, use that instead
of passing in a generic struct device. Change vfio_dma_rw() to take in the
struct vfio_device and move the container users that would have been held
by vfio_group_get_external_user_from_dev() to vfio_dma_rw() directly, like
vfio_pin/unpin_pages().

Thanks,
Jason

  reply	other threads:[~2022-04-22 17:59 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 16:28 [Intel-gfx] [PATCH v2 0/7] Make the rest of the VFIO driver interface use vfio_device Jason Gunthorpe
2022-04-21 16:28 ` Jason Gunthorpe
2022-04-21 16:28 ` Jason Gunthorpe
2022-04-21 16:28 ` [Intel-gfx] [PATCH v2 1/7] vfio: Make vfio_(un)register_notifier accept a vfio_device Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-22  1:39   ` [Intel-gfx] " Tian, Kevin
2022-04-22  1:39     ` Tian, Kevin
2022-04-22 17:07     ` [Intel-gfx] " Jason Gunthorpe
2022-04-22 17:07       ` Jason Gunthorpe
2022-04-22 17:07       ` Jason Gunthorpe
2022-04-22  6:21   ` [Intel-gfx] " Christoph Hellwig
2022-04-22  6:21     ` Christoph Hellwig
2022-04-21 16:28 ` [Intel-gfx] [PATCH v2 2/7] vfio/ccw: Remove mdev from struct channel_program Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-21 16:28 ` [Intel-gfx] [PATCH v2 3/7] vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages() Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-22  1:43   ` [Intel-gfx] " Tian, Kevin
2022-04-22  1:43     ` Tian, Kevin
2022-04-22  1:43     ` Tian, Kevin
2022-04-22  6:22   ` [Intel-gfx] " Christoph Hellwig
2022-04-22  6:22     ` Christoph Hellwig
2022-04-22 20:56     ` [Intel-gfx] " Jason Gunthorpe
2022-04-22 20:56       ` Jason Gunthorpe
2022-04-22 20:56       ` Jason Gunthorpe
2022-04-23  5:15       ` [Intel-gfx] " Christoph Hellwig
2022-04-23  5:15         ` Christoph Hellwig
2022-04-23 12:49         ` [Intel-gfx] " Jason Gunthorpe
2022-04-23 12:49           ` Jason Gunthorpe
2022-04-23 12:49           ` Jason Gunthorpe
2022-04-21 16:28 ` [Intel-gfx] [PATCH v2 4/7] vfio/mdev: Pass in a struct vfio_device * to vfio_dma_rw() Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-22  1:50   ` [Intel-gfx] " Tian, Kevin
2022-04-22  1:50     ` Tian, Kevin
2022-04-22  1:50     ` Tian, Kevin
2022-04-22 17:59     ` Jason Gunthorpe [this message]
2022-04-22 17:59       ` Jason Gunthorpe
2022-04-22 17:59       ` Jason Gunthorpe
2022-04-24  5:52       ` [Intel-gfx] " Tian, Kevin
2022-04-24  5:52         ` Tian, Kevin
2022-04-24  5:52         ` Tian, Kevin
2022-04-21 16:28 ` [Intel-gfx] [PATCH v2 5/7] drm/i915/gvt: Change from vfio_group_(un)pin_pages to vfio_(un)pin_pages Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-22  1:51   ` [Intel-gfx] " Tian, Kevin
2022-04-22  1:51     ` Tian, Kevin
2022-04-22  1:51     ` Tian, Kevin
2022-04-22  6:22   ` [Intel-gfx] " Christoph Hellwig
2022-04-22  6:22     ` Christoph Hellwig
2022-04-21 16:28 ` [Intel-gfx] [PATCH v2 6/7] vfio: Remove dead code Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-22  1:52   ` [Intel-gfx] " Tian, Kevin
2022-04-22  1:52     ` Tian, Kevin
2022-04-22  1:52     ` Tian, Kevin
2022-04-21 16:28 ` [Intel-gfx] [PATCH v2 7/7] vfio: Remove calls to vfio_group_add_container_user() Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-21 16:28   ` Jason Gunthorpe
2022-04-22  2:11   ` [Intel-gfx] " Tian, Kevin
2022-04-22  2:11     ` Tian, Kevin
2022-04-22  2:11     ` Tian, Kevin
2022-04-22 20:55     ` [Intel-gfx] " Jason Gunthorpe
2022-04-22 20:55       ` Jason Gunthorpe
2022-04-22 20:55       ` Jason Gunthorpe
2022-04-29 20:28   ` [Intel-gfx] " Alex Williamson
2022-04-29 20:28     ` Alex Williamson
2022-04-29 20:28     ` Alex Williamson
2022-05-02 16:22     ` [Intel-gfx] " Jason Gunthorpe
2022-05-02 16:22       ` Jason Gunthorpe
2022-05-02 16:22       ` Jason Gunthorpe
2022-04-21 21:25 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Make the rest of the VFIO driver interface use vfio_device (rev3) Patchwork
2022-04-29 17:31 ` [Intel-gfx] [PATCH v2 0/7] Make the rest of the VFIO driver interface use vfio_device Jason Gunthorpe
2022-04-29 17:31   ` Jason Gunthorpe
2022-04-29 17:31   ` Jason Gunthorpe
2022-04-29 22:22   ` [Intel-gfx] " Alex Williamson
2022-04-29 22:22     ` Alex Williamson
2022-04-29 22:22     ` Alex Williamson

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=20220422175937.GD1951132@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=agordeev@linux.ibm.com \
    --cc=airlied@linux.ie \
    --cc=akrowiak@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=farman@linux.ibm.com \
    --cc=freude@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=jjherne@linux.ibm.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=oberpar@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=svens@linux.ibm.com \
    --cc=vneethv@linux.ibm.com \
    --cc=yi.l.liu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.