Re: [PATCH v4 4/7] iommu/vt-d: Use pci_real_dma_dev() for mapping

2020-01-20 Thread Derrick, Jonathan
Good catch. Thanks Baolu. Will do v5 fixing this and Christoph's nit On Tue, 2020-01-21 at 09:06 +0800, Lu Baolu wrote: > Hi, > > On 1/18/20 12:27 AM, Jon Derrick wrote: > > The PCI device may have a DMA requester on another bus, such as VMD > > subdevices needing to use the VMD endpoint. This ca

Re: [PATCH v4 4/7] iommu/vt-d: Use pci_real_dma_dev() for mapping

2020-01-20 Thread Lu Baolu
Hi, On 1/18/20 12:27 AM, Jon Derrick wrote: The PCI device may have a DMA requester on another bus, such as VMD subdevices needing to use the VMD endpoint. This case requires the real DMA device when mapping to IOMMU. Signed-off-by: Jon Derrick --- drivers/iommu/intel-iommu.c | 9 +

Re: [PATCH v4 4/7] iommu/vt-d: Use pci_real_dma_dev() for mapping

2020-01-19 Thread Christoph Hellwig
On Fri, Jan 17, 2020 at 09:27:26AM -0700, Jon Derrick wrote: > + if (dev_is_pci(dev)) { > + struct pci_dev *pdev; > + > + pdev = pci_real_dma_dev(to_pci_dev(dev)); > + dev = &pdev->dev; I think this could be simplified to if (dev_is_pci(dev))

[PATCH v4 4/7] iommu/vt-d: Use pci_real_dma_dev() for mapping

2020-01-17 Thread Jon Derrick
The PCI device may have a DMA requester on another bus, such as VMD subdevices needing to use the VMD endpoint. This case requires the real DMA device when mapping to IOMMU. Signed-off-by: Jon Derrick --- drivers/iommu/intel-iommu.c | 9 + 1 file changed, 9 insertions(+) diff --git a/dr