Re: [PATCH 1/7] iommu/vt-d: Add domain_alloc_paging support

From: Jason Gunthorpe
Date: Mon Oct 14 2024 - 15:23:47 EST


On Mon, Oct 14, 2024 at 08:53:36AM +0800, Baolu Lu wrote:
> On 2024/10/11 21:22, Jason Gunthorpe wrote:
> > On Fri, Oct 11, 2024 at 12:27:16PM +0800, Lu Baolu wrote:
> >
> > > +static struct iommu_domain *intel_iommu_domain_alloc_paging(struct device *dev)
> > > +{
> > > + struct dmar_domain *dmar_domain;
> > > + bool first_stage;
> > > +
> > > + first_stage = first_level_by_default(0);
> > > + dmar_domain = paging_domain_alloc(dev, first_stage);
> > > + if (IS_ERR(dmar_domain))
> > > + return ERR_CAST(dmar_domain);
> > > +
> > > + return &dmar_domain->domain;
> > > +}
> > With the direction that Vasant's series is going in, I think this
> > should be skipped and instead your other patch to make
> > domain_alloc_user (which we will rename) a full functional replacement
> > is the right thing.
>
> I think it's too early to remove domain_alloc_paging from the iommu
> driver. Vasant's series makes most of the paging domain allocation go
> through domain_alloc_user ops, but for those that are non-PASID related,
> it still goes through domain_alloc_paging. So perhaps we can clean up
> after both series are merged.

I gave him a few more patches to finish the job, but yes let's not
make them interdependent. Just make sure this series sets things up so
we can delete this and the _user version can do everything

Jason