[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220215143753.GP4160@nvidia.com>
Date: Tue, 15 Feb 2022 10:37:53 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Joerg Roedel <joro@...tes.org>
Cc: Lu Baolu <baolu.lu@...ux.intel.com>,
Alex Williamson <alex.williamson@...hat.com>,
Robin Murphy <robin.murphy@....com>,
Christoph Hellwig <hch@...radead.org>,
Kevin Tian <kevin.tian@...el.com>,
Ashok Raj <ashok.raj@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Will Deacon <will@...nel.org>,
Dan Williams <dan.j.williams@...el.com>, rafael@...nel.org,
Diana Craciun <diana.craciun@....nxp.com>,
Cornelia Huck <cohuck@...hat.com>,
Eric Auger <eric.auger@...hat.com>,
Liu Yi L <yi.l.liu@...el.com>,
Jacob jun Pan <jacob.jun.pan@...el.com>,
Chaitanya Kulkarni <kch@...dia.com>,
Stuart Yoder <stuyoder@...il.com>,
Laurentiu Tudor <laurentiu.tudor@....com>,
Thierry Reding <thierry.reding@...il.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Jonathan Hunter <jonathanh@...dia.com>,
Li Yang <leoyang.li@....com>,
Dmitry Osipenko <digetx@...il.com>,
iommu@...ts.linux-foundation.org, linux-pci@...r.kernel.org,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 5/8] iommu/amd: Use iommu_attach/detach_device()
On Tue, Feb 15, 2022 at 10:11:01AM +0100, Joerg Roedel wrote:
> > But, then, the requirement is that nobody is using the dma API when we
> > make this change?
>
> That is the tricky part. DMA-API keeps working after the change is made,
> because the new domain is also direct mapped. The new domain just has
> the ability to assign host page-tables to device PASIDs, so that DMA
> requests with a PASID TLP will be remapped.
From, what you've described this is also a good use case for the
replace_group idea..
Using Lu's series we'd:
- Require the group to be in DMA-API mode. We know this is the case
because of how we got here from probe()
- Use the 'replace group's domain' API to switch the group from one
identity translation domain to another identity translation domain
- Rely on the DMA-API refcount to block VFIO/etc instead of checking
for the default domain
- Restore the default domain when all the DMA-API mode drivers unprobe
That is, if Robin's idea to just get the right domain in the first
place doesn't work.
Anyhow, given all this I think this patch is not OK as is.
Thanks,
Jason
Powered by blists - more mailing lists