linux/arch/powerpc/platforms/powernv
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
..
eeh-powernv.c powernv/eeh: Update the EEH code to use the opal irq domain 2015-05-22 15:14:38 +10:00
idle.c powerpc/powernv: Introduce sysfs control for fastsleep workaround behavior 2015-05-22 15:12:30 +10:00
Kconfig powerpc/powernv: Add opal-prd channel 2015-06-05 08:32:21 +10:00
Makefile powerpc/powernv: Add opal-prd channel 2015-06-05 08:32:21 +10:00
opal-async.c powerpc/powernv: Reorder OPAL subsystem initialisation 2015-05-22 15:14:37 +10:00
opal-dump.c powernv/opal-dump: Convert to irq domain 2015-05-22 15:14:38 +10:00
opal-elog.c powernv/elog: Convert elog to opal irq domain 2015-05-22 15:14:38 +10:00
opal-flash.c powerpc/powernv: Add interfaces for flash device access 2015-04-11 20:49:21 +10:00
opal-hmi.c powerpc/powernv: Reorder OPAL subsystem initialisation 2015-05-22 15:14:37 +10:00
opal-irqchip.c opal: Remove events notifier 2015-05-22 15:14:38 +10:00
opal-lpc.c powerpc/powernv: Properly fix LPC debugfs endianness 2014-10-31 17:09:04 +11:00
opal-memory-errors.c powerpc/powernv: Reorder OPAL subsystem initialisation 2015-05-22 15:14:37 +10:00
opal-msglog.c powerpc/powernv: Fix reading of OPAL msglog 2014-06-11 17:03:36 +10:00
opal-nvram.c powerpc/powernv: Add pstore support on powernv 2015-03-23 14:06:10 +11:00
opal-power.c powerpc/powernv: reboot when requested by firmware 2015-04-15 16:35:23 -07:00
opal-prd.c powerpc/powernv: Add opal-prd channel 2015-06-05 08:32:21 +10:00
opal-rtc.c rtc/tpo: Driver to support rtc and wakeup on PowerNV platform 2014-11-17 18:04:01 +11:00
opal-sensor.c powerpc/powernv: Reorder OPAL subsystem initialisation 2015-05-22 15:14:37 +10:00
opal-sysparam.c powerpc/powernv: convert OPAL codes returned by sysparam calls 2015-06-04 22:27:56 +10:00
opal-tracepoints.c powerpc: Replace __get_cpu_var uses 2014-11-03 12:12:32 +11:00
opal-wrappers.S powerpc/powernv: Add opal-prd channel 2015-06-05 08:32:21 +10:00
opal-xscom.c powerpc/powernv: Switch powernv drivers to use machine_xxx_initcall() 2014-07-28 14:11:26 +10:00
opal.c powerpc/powernv: Add opal-prd channel 2015-06-05 08:32:21 +10:00
pci-ioda.c vfio: powerpc/spapr/iommu/powernv/ioda2: Rework IOMMU ownership control 2015-06-11 15:16:47 +10:00
pci-p5ioc2.c powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group 2015-06-11 15:16:15 +10:00
pci.c powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group 2015-06-11 15:16:15 +10:00
pci.h powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group 2015-06-11 15:16:15 +10:00
powernv.h powerpc/powernv: Move dma_set_mask() from pnv_phb to pci_controller_ops 2015-06-02 13:18:49 +10:00
rng.c KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation. 2015-04-21 15:21:29 +02:00
setup.c powerpc/powernv: Move dma_set_mask() from pnv_phb to pci_controller_ops 2015-06-02 13:18:49 +10:00
smp.c powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
subcore-asm.S powerpc/powernv: Add support for POWER8 split core on powernv 2014-05-28 13:35:37 +10:00
subcore.c powernv/powerpc: Add winkle support for offline cpus 2014-12-15 10:46:41 +11:00
subcore.h powernv/powerpc: Add winkle support for offline cpus 2014-12-15 10:46:41 +11:00