[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB527633951B081F0F3A8499C98CC2A@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Wed, 27 Sep 2023 07:45:40 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Baolu Lu <baolu.lu@...ux.intel.com>,
"Liu, Yi L" <yi.l.liu@...el.com>,
"joro@...tes.org" <joro@...tes.org>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"jgg@...dia.com" <jgg@...dia.com>,
"robin.murphy@....com" <robin.murphy@....com>
CC: "cohuck@...hat.com" <cohuck@...hat.com>,
"eric.auger@...hat.com" <eric.auger@...hat.com>,
"nicolinc@...dia.com" <nicolinc@...dia.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"mjrosato@...ux.ibm.com" <mjrosato@...ux.ibm.com>,
"chao.p.peng@...ux.intel.com" <chao.p.peng@...ux.intel.com>,
"yi.y.sun@...ux.intel.com" <yi.y.sun@...ux.intel.com>,
"peterx@...hat.com" <peterx@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"shameerali.kolothum.thodi@...wei.com"
<shameerali.kolothum.thodi@...wei.com>,
"lulu@...hat.com" <lulu@...hat.com>,
"suravee.suthikulpanit@....com" <suravee.suthikulpanit@....com>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"Duan, Zhenzhong" <zhenzhong.duan@...el.com>,
"Martins, Joao" <joao.m.martins@...cle.com>
Subject: RE: [RFC 1/8] iommu: Introduce a replace API for device pasid
> From: Baolu Lu <baolu.lu@...ux.intel.com>
> Sent: Wednesday, September 27, 2023 10:05 AM
>
> On 9/26/23 5:26 PM, Yi Liu wrote:
> >
> > +/**
> > + * iommu_replace_device_pasid - replace the domain that a pasid is
> attached to
> > + * @domain: new IOMMU domain to replace with
> > + * @dev: the physical device
> > + * @pasid: pasid that will be attached to the new domain
> > + *
> > + * This API allows the pasid to switch domains. Return 0 on success, or an
> > + * error. The pasid will roll back to use the old domain if failure. The
> > + * caller could call iommu_detach_device_pasid() before free the old
> domain
> > + * in order to avoid use-after-free case.
>
> The comment does not match the actual behavior of the code. We need to
> discuss and agree on which state the PASID should park in if replacing
> the domain fails.
>
there is no legacy as in group_set_domain and iommufd is the only
caller of this new function. So IMHO the description above is the right
thing to do and the code should be updated to match it.
Powered by blists - more mailing lists