diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2013-05-20 23:33:11 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-06-20 02:55:15 -0400 |
commit | 5b25199eff8e124297e6e95392f1719d20daca89 (patch) | |
tree | bb37081c3b804172b2f16838e18f1e0746da0fce | |
parent | 5ffd229c02731a91d08ca21e76b503c5bbb5c095 (diff) |
powerpc/vfio: Enable on pSeries platform
The enables VFIO on the pSeries platform, enabling user space
programs to access PCI devices directly.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 4 | ||||
-rw-r--r-- | drivers/iommu/Kconfig | 2 | ||||
-rw-r--r-- | drivers/vfio/Kconfig | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 86ae364900d6..23fc1dcf4434 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -614,6 +614,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus) | |||
614 | 614 | ||
615 | iommu_table_setparms(pci->phb, dn, tbl); | 615 | iommu_table_setparms(pci->phb, dn, tbl); |
616 | pci->iommu_table = iommu_init_table(tbl, pci->phb->node); | 616 | pci->iommu_table = iommu_init_table(tbl, pci->phb->node); |
617 | iommu_register_group(tbl, pci_domain_nr(bus), 0); | ||
617 | 618 | ||
618 | /* Divide the rest (1.75GB) among the children */ | 619 | /* Divide the rest (1.75GB) among the children */ |
619 | pci->phb->dma_window_size = 0x80000000ul; | 620 | pci->phb->dma_window_size = 0x80000000ul; |
@@ -658,6 +659,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus) | |||
658 | ppci->phb->node); | 659 | ppci->phb->node); |
659 | iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window); | 660 | iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window); |
660 | ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node); | 661 | ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node); |
662 | iommu_register_group(tbl, pci_domain_nr(bus), 0); | ||
661 | pr_debug(" created table: %p\n", ppci->iommu_table); | 663 | pr_debug(" created table: %p\n", ppci->iommu_table); |
662 | } | 664 | } |
663 | } | 665 | } |
@@ -684,6 +686,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev) | |||
684 | phb->node); | 686 | phb->node); |
685 | iommu_table_setparms(phb, dn, tbl); | 687 | iommu_table_setparms(phb, dn, tbl); |
686 | PCI_DN(dn)->iommu_table = iommu_init_table(tbl, phb->node); | 688 | PCI_DN(dn)->iommu_table = iommu_init_table(tbl, phb->node); |
689 | iommu_register_group(tbl, pci_domain_nr(phb->bus), 0); | ||
687 | set_iommu_table_base(&dev->dev, PCI_DN(dn)->iommu_table); | 690 | set_iommu_table_base(&dev->dev, PCI_DN(dn)->iommu_table); |
688 | return; | 691 | return; |
689 | } | 692 | } |
@@ -1184,6 +1187,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) | |||
1184 | pci->phb->node); | 1187 | pci->phb->node); |
1185 | iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window); | 1188 | iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window); |
1186 | pci->iommu_table = iommu_init_table(tbl, pci->phb->node); | 1189 | pci->iommu_table = iommu_init_table(tbl, pci->phb->node); |
1190 | iommu_register_group(tbl, pci_domain_nr(pci->phb->bus), 0); | ||
1187 | pr_debug(" created table: %p\n", pci->iommu_table); | 1191 | pr_debug(" created table: %p\n", pci->iommu_table); |
1188 | } else { | 1192 | } else { |
1189 | pr_debug(" found DMA window, table: %p\n", pci->iommu_table); | 1193 | pr_debug(" found DMA window, table: %p\n", pci->iommu_table); |
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 3f3abde8a7f9..01730b2b9954 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig | |||
@@ -263,7 +263,7 @@ config SHMOBILE_IOMMU_L1SIZE | |||
263 | 263 | ||
264 | config SPAPR_TCE_IOMMU | 264 | config SPAPR_TCE_IOMMU |
265 | bool "sPAPR TCE IOMMU Support" | 265 | bool "sPAPR TCE IOMMU Support" |
266 | depends on PPC_POWERNV | 266 | depends on PPC_POWERNV || PPC_PSERIES |
267 | select IOMMU_API | 267 | select IOMMU_API |
268 | help | 268 | help |
269 | Enables bits of IOMMU API required by VFIO. The iommu_ops | 269 | Enables bits of IOMMU API required by VFIO. The iommu_ops |
diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig index b464687f6e14..26b3d9d1409f 100644 --- a/drivers/vfio/Kconfig +++ b/drivers/vfio/Kconfig | |||
@@ -12,7 +12,7 @@ menuconfig VFIO | |||
12 | tristate "VFIO Non-Privileged userspace driver framework" | 12 | tristate "VFIO Non-Privileged userspace driver framework" |
13 | depends on IOMMU_API | 13 | depends on IOMMU_API |
14 | select VFIO_IOMMU_TYPE1 if X86 | 14 | select VFIO_IOMMU_TYPE1 if X86 |
15 | select VFIO_IOMMU_SPAPR_TCE if PPC_POWERNV | 15 | select VFIO_IOMMU_SPAPR_TCE if (PPC_POWERNV || PPC_PSERIES) |
16 | help | 16 | help |
17 | VFIO provides a framework for secure userspace device drivers. | 17 | VFIO provides a framework for secure userspace device drivers. |
18 | See Documentation/vfio.txt for more details. | 18 | See Documentation/vfio.txt for more details. |