diff mbox series

[v5,5/7] iommu/vt-d: Remove VMD child device sanity check

Message ID 1579613871-301529-6-git-send-email-jonathan.derrick@intel.com
State New
Headers show
Series Clean up VMD DMA Map Ops | expand

Commit Message

Derrick, Jonathan Jan. 21, 2020, 1:37 p.m. UTC
This removes the sanity check required for VMD child devices. The new
pci_real_dma_dev() DMA alias mechanism places them in the same IOMMU
group as the VMD endpoint. Assignment of the group would require
assigning the VMD endpoint, where unbinding the VMD endpoint removes the
child device domain from the hierarchy.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
---
 drivers/iommu/intel-iommu.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Comments

Lu Baolu Jan. 22, 2020, 4:37 a.m. UTC | #1
On 1/21/20 9:37 PM, Jon Derrick wrote:
> This removes the sanity check required for VMD child devices. The new
> pci_real_dma_dev() DMA alias mechanism places them in the same IOMMU
> group as the VMD endpoint. Assignment of the group would require
> assigning the VMD endpoint, where unbinding the VMD endpoint removes the
> child device domain from the hierarchy.
> 
> Signed-off-by: Jon Derrick<jonathan.derrick@intel.com>

Acked-by: Lu Baolu <baolu.lu@linux.intel.com>

Thanks,
baolu
diff mbox series

Patch

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 72f26e8..7e2c492f 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -774,15 +774,7 @@  static struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devf
 	if (dev_is_pci(dev)) {
 		struct pci_dev *pf_pdev;
 
-		pdev = to_pci_dev(dev);
-
-#ifdef CONFIG_X86
-		/* VMD child devices currently cannot be handled individually */
-		if (is_vmd(pdev->bus))
-			return NULL;
-#endif
-
-		pdev = pci_real_dma_dev(pdev);
+		pdev = pci_real_dma_dev(to_pci_dev(dev));
 
 		/* VFs aren't listed in scope tables; we need to look up
 		 * the PF instead to find the IOMMU. */