Re: [PATCH RFCv1 07/14] iommufd: Add viommu set/unset_dev_id ops

Jason Gunthorpe
2024-05-23T15:01:28Z

On Thu, May 23, 2024 at 06:19:59AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Wednesday, May 22, 2024 2:25 AM
> >
> > On Tue, May 14, 2024 at 06:59:07PM -0700, Nicolin Chen wrote:
> > > So, you want a proxy S1 domain for a device to attach, in case
> > > of a stage-2 only setup, because an S2 domain will no longer has
> > > a VMID, since it's shared among viommus. In the SMMU driver case,
> > > an arm_smmu_domain won't have an smmu pointer, so a device can't
> > > attach to an S2 domain but always an nested S1 domain, right?
> >
> > That seems like a simple solution to the VMID lifetime, but it means
> > the kernel has to decode more types of vSTE.
> >
>
> why does ATC invalidation need to know about VMID?

ATC invalidation always requires a vRID to pRID translation and the
VIOMMU will hold that translation.

On vCMDQ HW and on AMD HW the vRID to pRID translation is pushed into
HW, and vCMDQ requires the VMID to do that.

Jason