RE: [PATCH v7 3/4] iommu/vt-d: Add set_dev_pasid callback for dma domain

From: Tian, Kevin
Date: Wed Jun 14 2023 - 04:14:09 EST


> From: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Sent: Wednesday, May 31, 2023 1:09 AM
>
>
> > * 2) all SVA domains share a reserved domain id per recommendation
> > * from VT-d spec (section 6.2.3.1) so domain_detach_iommu() is
> > * not required;
>
> The DID should be managed and allocated for the S2 pointer and the
> flushing logic should work genericly by tracking the S2's being used
> and flushing their DIDs when all the S2s fall out of use. The special
> identity S2 just gets a static DID that never falls out of use.
>

I'm not sure it's worthwhile to fake a identity S2 for the bare metal
SVA case. It's far simpler to special case the reserved DID value in
the SVM path.