On 9/11/20 3:27 AM, Christoph Hellwig wrote:
Hi S/390 PCI and IOMMU maintainers, We've recently tried to convert all implementations of the IOMMU API to use drivers/iommu/dma-iommu.c instead of their local IOMMU ops. I've looked at S/390 and while some comments mention things about the iommu API the implementation looks quite separate. Do arch/s390/pci/pci_dma.c and drivers/iommu/s390-iommu.c driver the same hardware? If so would a
Yes, these drivers are dealing with the same hardware.
switch to drivers/iommu/dma-iommu.c be feasibel?
Hmm... s390 does some particular things that are arch-specific, largely as forms of optimization. One such example is a case where we avoid reusing IO TLB Page Table Entries until we have to do a global flush.
I'd need to take a closer look at what AMD did / what intel is doing. Fundamentally we are open to the idea as the maintenance benefit is clear, but I don't think it's a trivial swap - I think we would need extensions to dma-iommu to accommodate some of our special cases / optimizations.