Re: [PATCH 1/4] iommu/vt-d: Implement set device pasid op for default domain

From: Jason Gunthorpe
Date: Mon Mar 06 2023 - 14:03:05 EST


On Mon, Mar 06, 2023 at 11:04:43AM -0800, Jacob Pan wrote:

> > and probably this is the right thing to do as in the end DMA type will
> > be removed with Jason's cleanup
>
> so, let me recap. set_dev_pasid() should make no assumptions of
> ordering, i.e. it is equal to iommu_domain_ops.attach_dev().

Absolutely yes.

You should factor out all the "prepare the domain to be used" code and
call it in both places.

Jason