linux-stable/arch/powerpc/platforms
Alexey Kardashevskiy 9d67c94335 powerpc/iommu: Add "borrowing" iommu_table_group_ops
PPC64 IOMMU API defines iommu_table_group_ops which handles DMA windows
for PEs: control the ownership, create/set/unset a table the hardware
for dynamic DMA windows (DDW). VFIO uses the API to implement support on
POWER.

So far only PowerNV IODA2 (POWER8 and newer machines) implemented this
and other cases (POWER7 or nested KVM) did not and instead reused
existing iommu_table structs. This means 1) no DDW 2) ownership transfer
is done directly in the VFIO SPAPR TCE driver.

Soon POWER is going to get its own iommu_ops and ownership control is
going to move there. This implements spapr_tce_table_group_ops which
borrows iommu_table tables. The upside is that VFIO needs to know less
about POWER.

The new ops returns the existing table from create_table() and only
checks if the same window is already set. This is only going to work if
the default DMA window starts table_group.tce32_start and as big as
pe->table_group.tce32_size (not the case for IODA2+ PowerNV).

This changes iommu_table_group_ops::take_ownership() to return an error
if borrowing a table failed.

This should not cause any visible change in behavior for PowerNV.
pSeries was not that well tested/supported anyway.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
[mpe: Fix CONFIG_IOMMU_API=n build (skiroot_defconfig), & formatting]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/525438831.16998517.1678123820075.JavaMail.zimbra@raptorengineeringinc.com
2023-03-14 23:36:27 +11:00
..
4xx powerpc/msi: Fix deassociation of MSI descriptors 2022-12-17 10:58:48 +00:00
8xx powerpc/8xx: Add missing of_node_put() in tqm8xx_setup.c 2022-09-05 17:28:25 +10:00
40x powerpc: Remove asm/prom.h from all files that don't need it 2022-05-08 22:15:04 +10:00
44x powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ 2023-01-30 17:53:05 +11:00
52xx powerpc/rtas: arch-wide function token lookup conversions 2023-02-13 22:35:03 +11:00
82xx powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
83xx powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe() 2022-12-02 20:09:48 +11:00
85xx powerpc/sgy_cts1000: convert to using gpiod API and facelift 2022-11-24 23:31:48 +11:00
86xx powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
512x powerpc/512x: Add missing of_node_put() in clock-commonclk.c 2022-09-05 17:30:24 +10:00
amigaone powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
book3s mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
cell powerpc updates for 6.3 2023-02-25 11:00:06 -08:00
chrp powerpc/rtas: arch-wide function token lookup conversions 2023-02-13 22:35:03 +11:00
embedded6xx powerpc/embedded6xx/ls_uart: Add missing of_node_put() 2022-09-05 17:28:26 +10:00
maple powerpc/rtas: arch-wide function token lookup conversions 2023-02-13 22:35:03 +11:00
microwatt random: remove CONFIG_ARCH_RANDOM 2022-07-18 15:03:37 +02:00
pasemi powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
powermac powerpc/powermac: Fix symbol not declared warnings 2022-11-24 23:31:50 +11:00
powernv powerpc/iommu: Add "borrowing" iommu_table_group_ops 2023-03-14 23:36:27 +11:00
ps3 powerpc updates for 6.3 2023-02-25 11:00:06 -08:00
pseries powerpc/iommu: Add "borrowing" iommu_table_group_ops 2023-03-14 23:36:27 +11:00
Kconfig powerpc: Rename PPC_NATIVE to PPC_HASH_MMU_NATIVE 2021-12-02 22:57:22 +11:00
Kconfig.cputype powerpc/64: Replace -mcpu=e500mc64 by -mcpu=e5500 2023-02-15 22:41:11 +11:00
Makefile
fsl_uli1575.c powerpc: Add missing headers 2022-05-08 22:15:40 +10:00