Apologies, I sent that previous message too early. The reason we want this change is so we can use iommu_group's to force our pcie devices to have the same IOMMU mappings. For legacy reasons we require a bunch of our pcie devices to have the same address translations.
We were going to do this by using the iommu-dma api and replacing all the existing calls to the DMA api functions in the amd driver with their iommu-dma equivalent like in this driver: https://elixir.bootlin.com/linux/latest/source/arch/arm64/mm/dma-mapping.c#L810 To do this we need the map/unmap callbacks to be spinlock-safe. On 24 August 2018 at 23:51, Tom Murphy <[email protected]> wrote: > The reason we want this change is so we can use iommu_group's to force our > pcie devices to have the same IOMMU mappings. For legacy reasons we require > a bunch of our pcie devices to have the same address translation. > > We were going to do this by using the iommu-dma api and replacing all the > existing calls to . > > On 24 August 2018 at 16:24, Robin Murphy <[email protected]> wrote: > >> On 24/08/18 15:53, Christoph Hellwig wrote: >> >>> On Fri, Aug 24, 2018 at 02:28:49PM +0000, [email protected] wrote: >>> >>>> From: Tom Murphy <[email protected]> >>>> >>>> --- >>>> >>>> This patch allows the IOMMU API path in the AMD driver to be called >>>> from an atomic context. >>>> This is useful for anyone building a driver which needs to call the >>>> IOMMU API while holding a spinlock. >>>> >>> >>> I don't think that is a good idea. Please point to the code in the >>> driver and we can't probably find a better solution. >>> >> >> Although IIRC the AMD driver is in fact the only one whose map/unmap >> callbacks aren't already spinlock-safe (or at least it was last time I was >> looking). Stuff like iommu-dma is already relying on this in order to >> implement streaming DMA API calls (which may be in atomic context) on top >> of the corresponding IOMMU API operations. >> >> Robin. >> > >
_______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
