[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DS0PR11MB752986582BDB95CA75663B00C305A@DS0PR11MB7529.namprd11.prod.outlook.com>
Date: Mon, 31 Jul 2023 07:22:11 +0000
From: "Liu, Yi L" <yi.l.liu@...el.com>
To: Nicolin Chen <nicolinc@...dia.com>,
Jason Gunthorpe <jgg@...dia.com>
CC: "joro@...tes.org" <joro@...tes.org>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
"robin.murphy@....com" <robin.murphy@....com>,
"baolu.lu@...ux.intel.com" <baolu.lu@...ux.intel.com>,
"cohuck@...hat.com" <cohuck@...hat.com>,
"eric.auger@...hat.com" <eric.auger@...hat.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>
Subject: RE: [PATCH v3 08/17] iommufd: IOMMU_HWPT_ALLOC allocation with user
data
> From: Nicolin Chen <nicolinc@...dia.com>
> Sent: Saturday, July 29, 2023 3:10 AM
>
> On Fri, Jul 28, 2023 at 02:55:57PM -0300, Jason Gunthorpe wrote:
> > On Mon, Jul 24, 2023 at 04:03:57AM -0700, Yi Liu wrote:
> >
> > > + switch (pt_obj->type) {
> > > + case IOMMUFD_OBJ_IOAS:
> > > + ioas = container_of(pt_obj, struct iommufd_ioas, obj);
> > > + break;
> > > + case IOMMUFD_OBJ_HW_PAGETABLE:
> > > + /* pt_id points HWPT only when hwpt_type
> is !IOMMU_HWPT_TYPE_DEFAULT */
> > > + if (cmd->hwpt_type == IOMMU_HWPT_TYPE_DEFAULT) {
> > > + rc = -EINVAL;
> > > + goto out_put_pt;
> > > + }
> > > +
> > > + parent = container_of(pt_obj, struct iommufd_hw_pagetable, obj);
> > > + /*
> > > + * Cannot allocate user-managed hwpt linking to auto_created
> > > + * hwpt. If the parent hwpt is already a user-managed hwpt,
> > > + * don't allocate another user-managed hwpt linking to it.
> > > + */
> > > + if (parent->auto_domain || parent->parent) {
> > > + rc = -EINVAL;
> > > + goto out_put_pt;
> > > + }
> > > + ioas = parent->ioas;
> >
> > Why do we set ioas here? I would think it should be NULL.
> >
> > I think it is looking like a mistake to try and re-use
> > iommufd_hw_pagetable_alloc() directly for the nested case. It should
> > not have a IOAS argument, it should not do enforce_cc, or iopt_*
> > functions
> >
> > So must of the function is removed. Probably better to make a new
> > ioas-less function for the nesting case.
>
> OK.
>
> @Yi, along with the PATCH-6 (IOMMU_RESV_SW_MSI), I will rework
> on this -- mainly breaking up NESTED hwpt with IOAS.
Thanks. Then I'll address the hw_info comments first.
Regards,
Yi Liu
Powered by blists - more mailing lists