qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 06/13] iommu: Make use of DMA quirking and ACS enabl


From: Alex Williamson
Subject: [Qemu-devel] [PATCH 06/13] iommu: Make use of DMA quirking and ACS enabled check for groups
Date: Fri, 11 May 2012 16:56:09 -0600
User-agent: StGIT/0.14.3

Incorporate DMA quirking and ACS checking into amd_iommu and
intel-iommu.  Note that IOMMU groups are not yet used for
streaming DMA, so this doesn't immediately solve the problems
with broken Ricoh devices.

Signed-off-by: Alex Williamson <address@hidden>
---

 drivers/iommu/amd_iommu.c   |    3 +++
 drivers/iommu/intel-iommu.c |    3 +++
 drivers/pci/pci.h           |    1 +
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index b7e5ddf..a165311 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -291,6 +291,9 @@ static int iommu_init_device(struct device *dev)
                dma_pdev = pci_get_slot(pdev->bus,
                                        PCI_DEVFN(PCI_SLOT(pdev->devfn), 0));
 
+       dma_pdev = pci_dma_quirk(dma_pdev);
+       dma_pdev = pci_acs_enabled(dma_pdev);
+
        group = iommu_group_get(&dma_pdev->dev);
        if (!group) {
                group = iommu_group_alloc();
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index e63b33b..5f526c7 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4113,6 +4113,9 @@ static int intel_iommu_add_device(struct device *dev)
                dma_pdev = pci_get_slot(pdev->bus,
                                        PCI_DEVFN(PCI_SLOT(pdev->devfn), 0));
 
+       dma_pdev = pci_dma_quirk(dma_pdev);
+       dma_pdev = pci_acs_enabled(dma_pdev);
+
        group = iommu_group_get(&dma_pdev->dev);
        if (!group) {
                group = iommu_group_alloc();
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index e494347..e8f2f8f 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -310,6 +310,7 @@ static inline resource_size_t pci_resource_alignment(struct 
pci_dev *dev,
 }
 
 extern void pci_enable_acs(struct pci_dev *dev);
+extern struct pci_dev *pci_acs_enabled(struct pci_dev *dev);
 
 struct pci_dev_reset_methods {
        u16 vendor;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]