Re: [PATCH v12 07/17] iommu: Try to allocate blocking domain when probing device

Jason Gunthorpe
2022-09-02T13:17:16Z

On Thu, Sep 01, 2022 at 06:44:10PM +0800, Baolu Lu wrote:
> On 2022/8/31 22:10, Jason Gunthorpe wrote:
> > On Wed, Aug 31, 2022 at 09:49:44AM +0800, Baolu Lu wrote:
> > > > Maybe all of this is just the good reason to go to a simple
> > > > device->ops->remove_dev_pasid() callback and forget about blocking
> > > > domain here.
> > >
> > > Do you mean rolling back to what we did in v10?
> >
> > Yeah, but it shouldn't be a domain_op, removing a pasid is a device op
> >
> > Just
> >
> > remove_dev_pasid(struct device *dev, ioasid_t pasid)
>
> It's clear now. Thanks!
>
> How about below iommu_attach/detach_device_pasid() code?

I think this is probably the right thing

> By the way, how about naming it "block_dev_pasid(dev, pasid)"?

set/remove is a better pairing that set/block

Jason