linux-stable/arch/powerpc/platforms
Alexey Kardashevskiy f87a88642e vfio: powerpc/spapr/iommu/powernv/ioda2: Rework IOMMU ownership control
This adds tce_iommu_take_ownership() and tce_iommu_release_ownership
which call in a loop iommu_take_ownership()/iommu_release_ownership()
for every table on the group. As there is just one now, no change in
behaviour is expected.

At the moment the iommu_table struct has a set_bypass() which enables/
disables DMA bypass on IODA2 PHB. This is exposed to POWERPC IOMMU code
which calls this callback when external IOMMU users such as VFIO are
about to get over a PHB.

The set_bypass() callback is not really an iommu_table function but
IOMMU/PE function. This introduces a iommu_table_group_ops struct and
adds take_ownership()/release_ownership() callbacks to it which are
called when an external user takes/releases control over the IOMMU.

This replaces set_bypass() with ownership callbacks as it is not
necessarily just bypass enabling, it can be something else/more
so let's give it more generic name.

The callbacks is implemented for IODA2 only. Other platforms (P5IOC2,
IODA1) will use the old iommu_take_ownership/iommu_release_ownership API.
The following patches will replace iommu_take_ownership/
iommu_release_ownership calls in IODA2 with full IOMMU table release/
create.

As we here and touching bypass control, this removes
pnv_pci_ioda2_setup_bypass_pe() as it does not do much
more compared to pnv_pci_ioda2_set_bypass. This moves tce_bypass_base
initialization to pnv_pci_ioda2_setup_dma_pe.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[aw: for the vfio related changes]
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-06-11 15:16:47 +10:00
..
8xx powerpc/8xx: Remove Kconfig symbol FADS 2014-11-07 18:10:46 -06:00
40x powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
44x powerpc/44x/Akebono: Remove select of IBM_EMAC_RGMII_WOL 2014-12-29 15:45:44 +11:00
52xx powerpc: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc 2015-06-02 16:54:44 +10:00
82xx powerpc: platforms: 82xx: drop owner assignment from platform_drivers 2014-10-20 16:20:11 +02:00
83xx PowerPC-83xx: Deletion of an unnecessary check before the function call "of_node_put" 2015-01-29 23:16:19 -06:00
85xx powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
86xx powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
512x powerpc: call of_clk_init() from time_init() 2015-01-20 10:09:02 -08:00
amigaone lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig 2014-08-08 15:57:26 -07:00
cell powerpc/iommu: Move tce_xxx callbacks from ppc_md to iommu_table 2015-06-11 15:14:56 +10:00
chrp powerpc32/chrp: fix section mismatch warning 2015-03-31 19:05:50 +11:00
embedded6xx powerpc: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc 2015-06-02 16:54:44 +10:00
maple powerpc/maple: Move controller ops from ppc_md to controller_ops 2015-04-11 20:49:17 +10:00
pasemi powerpc/iommu: Move tce_xxx callbacks from ppc_md to iommu_table 2015-06-11 15:14:56 +10:00
powermac powerpc/powermac: Fix build error seen with powermac smp builds 2015-04-15 15:52:59 +10:00
powernv vfio: powerpc/spapr/iommu/powernv/ioda2: Rework IOMMU ownership control 2015-06-11 15:16:47 +10:00
ps3 powerpc: Drop return value of smp_ops->probe() 2015-04-10 20:02:49 +10:00
pseries powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group 2015-06-11 15:16:15 +10:00
Kconfig powerpc: Remove the celleb support 2015-04-07 17:15:13 +10:00
Kconfig.cputype powerpc: Little endian should depend on PPC_BOOK3S_64 2015-05-18 16:48:11 +10:00
Makefile powerpc: Remove platforms/wsp and associated pieces 2014-06-11 16:35:38 +10:00
fsl_uli1575.c of/irq: Refactor interrupt-map parsing 2013-10-24 11:43:04 +01:00