RE: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO

From: Tian, Kevin
Date: Thu Oct 14 2021 - 04:29:58 EST


> From: hch@xxxxxx <hch@xxxxxx>
> Sent: Thursday, October 14, 2021 4:22 PM
>
> > > > What I don't really understand is why ARM, with an IOMMU that
> supports
> > > > PTE WB, has devices where dev_is_dma_coherent() == false ?
> > >
> > > Because no IOMMU in the world can help that fact that a periphal on the
> > > SOC is not part of the cache coherency protocol.
> >
> > but since DMA goes through IOMMU then isn't IOMMU the one who
> > should decide the final cache coherency? What would be the case
> > if the IOMMU sets WB while the peripheral doesn't want it?
>
> No. And IOMMU deal with address translation, it can't paper over
> a fact that there is no coherency possible.

Does it relate to the ATS story where the device gets translated address
from IOMMU and then directly sends request to memory controller?
In this way if the device is not in cache coherency domain then nothing
can change it.

Then if ATS is disabled, suppose the untranslated request from the
device is translated and forwarded by IOMMU to the memory controller.
In this case IOMMU should be able to join the coherency protocol
even when the originating device itself cannot.

Is above understanding correct?

Thanks
Kevin