PCI_P2PDMA_MAP_BUS_ADDR and PCIe ATS?
Thomas Hellström <[email protected]>
| Newsgroups | dev.linux.lists.iommu,org.kernel.vger.linux-pci |
|---|---|
| Organization | Intel Sweden AB, Registration Number: 556189-6027 |
| Message-ID | <[email protected]> |
Hi! I was looking at the way pci_p2pdma_distance() returns PCI_P2PDMA_MAP_BUS_ADDR if devices sit beneath a local switch with ACS disabled or not present. The client then programs the bus address directly to perform p2p dma, as handed out by the dma layer. However if the device (p2pdma client) has IOMMU turned on and ATS enabled, the device may or may not send a translation request to the IOMMU. Wouldn't that fail returnint an IOMMU fault if the device is programmed with the bus address rather than the IOVA? So if ATS is enabled, shouldn't the device always be handed the IOVA to avoid this? Granted, untranslated transactions will then take the round-trip to the host bridge, but pre-translated transactions will still benefit from the direct routing through the switch, although that is not directly visible to the kernel p2pdma layer? Does pci_p2pdma_distance() need to be client ATS-enabled aware? Any input appreciated, Thanks, Thomas