Re: [PATCH] PCI/P2PDMA: Root complex whitelist should not apply when an IOMMU is present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 23, 2019 at 09:53:53AM -0600, Logan Gunthorpe wrote:
> > The problem shows up if pci_bus_address() returns a different address
> > than pci_resource_start(), should be easy to check if that happens.
> > IIRC it is something mostly seen on embedded SOCs.
> > 
> 
> I think it's a bit more complicated then that: If you're calling
> dma_map_resource() to program the IOMMU then I'm pretty sure you'd want
> to use the pci_resource_start() address as the phys_addr_t. If you're
> bypassing the root complex (like the current p2pdma code enforces), then
> you'd simply use a pci_bus_address() directly as the dma_addr and would
> not program the IOMMU at all seeing it's not involved (which is what is
> currently done).

True.  What we need is:

 if (both device are behind the same root port (using a switch)) {
 	use the current direct map + offset code
 } else {
 	call ->map_resource()
 }



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux