All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "mjrosato@linux.ibm.com" <mjrosato@linux.ibm.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"Hao, Xudong" <xudong.hao@intel.com>,
	"peterx@redhat.com" <peterx@redhat.com>,
	"Xu, Terrence" <terrence.xu@intel.com>,
	"chao.p.peng@linux.intel.com" <chao.p.peng@linux.intel.com>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"Liu, Yi L" <yi.l.liu@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"lulu@redhat.com" <lulu@redhat.com>,
	"Jiang, Yanting" <yanting.jiang@intel.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"nicolinc@nvidia.com" <nicolinc@nvidia.com>,
	"Zhao, Yan Y" <yan.y.zhao@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"eric.auger@redhat.com" <eric.auger@redhat.com>,
	"intel-gvt-dev@lists.freedesktop.org"
	<intel-gvt-dev@lists.freedesktop.org>,
	"yi.y.sun@linux.intel.com" <yi.y.sun@linux.intel.com>,
	"cohuck@redhat.com" <cohuck@redhat.com>,
	"shameerali.kolothum.thodi@huawei.com"
	<shameerali.kolothum.thodi@huawei.com>,
	"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
	"robin.murphy@arm.com" <robin.murphy@arm.com>
Subject: Re: [Intel-gfx] [PATCH v3 2/6] iommufd: Create access in vfio_iommufd_emulated_bind()
Date: Fri, 31 Mar 2023 13:55:38 -0300	[thread overview]
Message-ID: <ZCcQik6KVv5nl0/H@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB5276BB3F0494E0CAC07AF4918C8F9@BN9PR11MB5276.namprd11.prod.outlook.com>

On Fri, Mar 31, 2023 at 08:16:16AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Thursday, March 30, 2023 4:00 AM
> > 
> > On Mon, Mar 27, 2023 at 02:33:47AM -0700, Yi Liu wrote:
> > > @@ -494,6 +479,30 @@ void iommufd_access_destroy(struct
> > iommufd_access *access)
> > >  }
> > >  EXPORT_SYMBOL_NS_GPL(iommufd_access_destroy, IOMMUFD);
> > >
> > > +int iommufd_access_attach(struct iommufd_access *access, u32 ioas_id)
> > > +{
> > > +	struct iommufd_ioas *new_ioas;
> > > +	int rc = 0;
> > > +
> > > +	if (access->ioas != NULL && access->ioas->obj.id != ioas_id)
> > > +		return -EINVAL;
> > 
> > This should just be
> > 
> >    if (access->ioas)
> >         return -EINVAL;
> 
> the physical path has the same check:
> 
> 	if (idev->igroup->hwpt != NULL && idev->igroup->hwpt != hwpt) {
> 		rc = -EINVAL;
> 		goto err_unlock;
> 	}
> 
> If we change here then that one should be changed too.

No, that one is checking if the another device attached to the same
group is a compatible hwpt so we succeed to attach the new device

Jason

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "Liu, Yi L" <yi.l.liu@intel.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"robin.murphy@arm.com" <robin.murphy@arm.com>,
	"cohuck@redhat.com" <cohuck@redhat.com>,
	"eric.auger@redhat.com" <eric.auger@redhat.com>,
	"nicolinc@nvidia.com" <nicolinc@nvidia.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"mjrosato@linux.ibm.com" <mjrosato@linux.ibm.com>,
	"chao.p.peng@linux.intel.com" <chao.p.peng@linux.intel.com>,
	"yi.y.sun@linux.intel.com" <yi.y.sun@linux.intel.com>,
	"peterx@redhat.com" <peterx@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"shameerali.kolothum.thodi@huawei.com" 
	<shameerali.kolothum.thodi@huawei.com>,
	"lulu@redhat.com" <lulu@redhat.com>,
	"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
	"intel-gvt-dev@lists.freedesktop.org" 
	<intel-gvt-dev@lists.freedesktop.org>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"Hao, Xudong" <xudong.hao@intel.com>,
	"Zhao, Yan Y" <yan.y.zhao@intel.com>,
	"Xu, Terrence" <terrence.xu@intel.com>,
	"Jiang, Yanting" <yanting.jiang@intel.com>
Subject: Re: [PATCH v3 2/6] iommufd: Create access in vfio_iommufd_emulated_bind()
Date: Fri, 31 Mar 2023 13:55:38 -0300	[thread overview]
Message-ID: <ZCcQik6KVv5nl0/H@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB5276BB3F0494E0CAC07AF4918C8F9@BN9PR11MB5276.namprd11.prod.outlook.com>

On Fri, Mar 31, 2023 at 08:16:16AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Thursday, March 30, 2023 4:00 AM
> > 
> > On Mon, Mar 27, 2023 at 02:33:47AM -0700, Yi Liu wrote:
> > > @@ -494,6 +479,30 @@ void iommufd_access_destroy(struct
> > iommufd_access *access)
> > >  }
> > >  EXPORT_SYMBOL_NS_GPL(iommufd_access_destroy, IOMMUFD);
> > >
> > > +int iommufd_access_attach(struct iommufd_access *access, u32 ioas_id)
> > > +{
> > > +	struct iommufd_ioas *new_ioas;
> > > +	int rc = 0;
> > > +
> > > +	if (access->ioas != NULL && access->ioas->obj.id != ioas_id)
> > > +		return -EINVAL;
> > 
> > This should just be
> > 
> >    if (access->ioas)
> >         return -EINVAL;
> 
> the physical path has the same check:
> 
> 	if (idev->igroup->hwpt != NULL && idev->igroup->hwpt != hwpt) {
> 		rc = -EINVAL;
> 		goto err_unlock;
> 	}
> 
> If we change here then that one should be changed too.

No, that one is checking if the another device attached to the same
group is a compatible hwpt so we succeed to attach the new device

Jason

  reply	other threads:[~2023-03-31 16:55 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27  9:33 [Intel-gfx] [PATCH v3 0/6] vfio: Make emulated devices prepared for vfio device cdev Yi Liu
2023-03-27  9:33 ` Yi Liu
2023-03-27  9:33 ` [Intel-gfx] [PATCH v3 1/6] iommu/iommufd: Pass iommufd_ctx pointer in iommufd_get_ioas() Yi Liu
2023-03-27  9:33   ` Yi Liu
2023-03-27 16:35   ` [Intel-gfx] " Jason Gunthorpe
2023-03-27 16:35     ` Jason Gunthorpe
2023-03-28  5:23   ` [Intel-gfx] " Tian, Kevin
2023-03-28  5:23     ` Tian, Kevin
2023-03-27  9:33 ` [Intel-gfx] [PATCH v3 2/6] iommufd: Create access in vfio_iommufd_emulated_bind() Yi Liu
2023-03-27  9:33   ` Yi Liu
2023-03-29 19:59   ` [Intel-gfx] " Jason Gunthorpe
2023-03-29 19:59     ` Jason Gunthorpe
2023-03-31  8:16     ` [Intel-gfx] " Tian, Kevin
2023-03-31  8:16       ` Tian, Kevin
2023-03-31 16:55       ` Jason Gunthorpe [this message]
2023-03-31 16:55         ` Jason Gunthorpe
2023-03-27  9:33 ` [Intel-gfx] [PATCH v3 3/6] vfio-iommufd: No need to record iommufd_ctx in vfio_device Yi Liu
2023-03-27  9:33   ` Yi Liu
2023-03-27  9:33 ` [Intel-gfx] [PATCH v3 4/6] vfio-iommufd: Make vfio_iommufd_emulated_bind() return iommufd_access ID Yi Liu
2023-03-27  9:33   ` Yi Liu
2023-03-27  9:33 ` [Intel-gfx] [PATCH v3 5/6] vfio/mdev: Uses the vfio emulated iommufd ops set in the mdev sample drivers Yi Liu
2023-03-27  9:33   ` Yi Liu
2023-03-27  9:33 ` [Intel-gfx] [PATCH v3 6/6] vfio: Check the presence for iommufd callbacks in __vfio_register_dev() Yi Liu
2023-03-27  9:33   ` Yi Liu
2023-03-27 11:23 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for vfio: Make emulated devices prepared for vfio device cdev (rev4) Patchwork
2023-03-27 11:23 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-27 11:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-27 15:25 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-03-27 17:47 ` [Intel-gfx] [PATCH v3 0/6] vfio: Make emulated devices prepared for vfio device cdev Nicolin Chen
2023-03-27 17:47   ` Nicolin Chen
2023-03-29 19:47 ` [Intel-gfx] " Jason Gunthorpe
2023-03-29 19:47   ` Jason Gunthorpe
2023-03-30 19:21   ` [Intel-gfx] " Alex Williamson
2023-03-30 19:21     ` Alex Williamson
2023-03-31  3:13 ` [Intel-gfx] " Jiang, Yanting
2023-03-31  3:13   ` Jiang, Yanting
2023-03-31  4:57 ` [Intel-gfx] " Jiang, Yanting
2023-03-31  4:57   ` Jiang, Yanting

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=ZCcQik6KVv5nl0/H@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=cohuck@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=jasowang@redhat.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=lulu@redhat.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=nicolinc@nvidia.com \
    --cc=peterx@redhat.com \
    --cc=robin.murphy@arm.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=terrence.xu@intel.com \
    --cc=xudong.hao@intel.com \
    --cc=yan.y.zhao@intel.com \
    --cc=yanting.jiang@intel.com \
    --cc=yi.l.liu@intel.com \
    --cc=yi.y.sun@linux.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.