On 5/9/22 7:35 PM, Jason Gunthorpe wrote:
Hi s390 folks/Matthew Since everyone is looking at iommu support for the nested domains, could we also tackle the default domain conversion please? s390 is one of the last 4 drivers that need it. From what I can see it looks like when detach_dev() is called it expects the platform's dma_ops to work in arch/s390/pci/pci_dma.c ?
Yes
Has anyone thought about converting the dma_ops to use the normal DMA API iommu support and run it through the iommu driver instead of through the dma_ops? Alternatively perhaps we can keep the dma_ops with some iommu side-change.
It has come up before. So ultimately the goal is to be driving the dma through the default iommu domain (via dma-iommu) rather than directly in the dma_ops? One of our main concerns is performance loss from s390-ism optimizations in the dma_ops like RPCIT avoidance / lazy map + global flush (maybe I am wrong or something can be generalized through the api - or something is already there that will work). Of course there are some obvious benefits too, we have some duplication of work between s390-iommu.c and arch/s390/pci/pci_dma.c
I think the reality is that Niklas and I need to have a close look and do some testing on our end to see what it will take and if we can get acceptable performance from a conversion, then get back to you.
Thanks, Matt