diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-02-10 19:32:38 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-02-11 00:07:37 -0500 |
commit | cd15b048445d0a54f7147c35a86c5a16ef231554 (patch) | |
tree | 80c7e63624143adc5d453106ec13f445438c6135 /arch/powerpc/platforms/powernv/pci.c | |
parent | ea961a828fe7250e954f086d74d9323c3d44c3e4 (diff) |
powerpc/powernv: Add iommu DMA bypass support for IODA2
This patch adds the support for to create a direct iommu "bypass"
window on IODA2 bridges (such as Power8) allowing to bypass iommu
page translation completely for 64-bit DMA capable devices, thus
significantly improving DMA performances.
Additionally, this adds a hook to the struct iommu_table so that
the IOMMU API / VFIO can disable the bypass when external ownership
is requested, since in that case, the device will be used by an
environment such as userspace or a KVM guest which must not be
allowed to bypass translations.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powernv/pci.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/pci.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index b555ebc57ef5..95633d79ef5d 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -634,6 +634,16 @@ static void pnv_pci_dma_dev_setup(struct pci_dev *pdev) | |||
634 | pnv_pci_dma_fallback_setup(hose, pdev); | 634 | pnv_pci_dma_fallback_setup(hose, pdev); |
635 | } | 635 | } |
636 | 636 | ||
637 | int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask) | ||
638 | { | ||
639 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); | ||
640 | struct pnv_phb *phb = hose->private_data; | ||
641 | |||
642 | if (phb && phb->dma_set_mask) | ||
643 | return phb->dma_set_mask(phb, pdev, dma_mask); | ||
644 | return __dma_set_mask(&pdev->dev, dma_mask); | ||
645 | } | ||
646 | |||
637 | void pnv_pci_shutdown(void) | 647 | void pnv_pci_shutdown(void) |
638 | { | 648 | { |
639 | struct pci_controller *hose; | 649 | struct pci_controller *hose; |