aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/iommu.h
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2017-03-22 00:21:48 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2017-03-30 06:42:01 -0400
commita540aa56ba3d29084f28710c8b93cc9c3c422943 (patch)
tree265e8987fb9f37ede5fb9175dac3e26b62745ed8 /arch/powerpc/include/asm/iommu.h
parent6b5c19c55266f6efd10ffac0e9f9f2b7aa420a58 (diff)
powerpc/powernv/iommu: Add real mode version of iommu_table_ops::exchange()
In real mode, TCE tables are invalidated using special cache-inhibited store instructions which are not available in virtual mode This defines and implements exchange_rm() callback. This does not define set_rm/clear_rm/flush_rm callbacks as there is no user for those - exchange/exchange_rm are only to be used by KVM for VFIO. The exchange_rm callback is defined for IODA1/IODA2 powernv platforms. This replaces list_for_each_entry_rcu with its lockless version as from now on pnv_pci_ioda2_tce_invalidate() can be called in the real mode too. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/iommu.h')
-rw-r--r--arch/powerpc/include/asm/iommu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h
index 2c1d50792944..4554699aec02 100644
--- a/arch/powerpc/include/asm/iommu.h
+++ b/arch/powerpc/include/asm/iommu.h
@@ -64,6 +64,11 @@ struct iommu_table_ops {
64 long index, 64 long index,
65 unsigned long *hpa, 65 unsigned long *hpa,
66 enum dma_data_direction *direction); 66 enum dma_data_direction *direction);
67 /* Real mode */
68 int (*exchange_rm)(struct iommu_table *tbl,
69 long index,
70 unsigned long *hpa,
71 enum dma_data_direction *direction);
67#endif 72#endif
68 void (*clear)(struct iommu_table *tbl, 73 void (*clear)(struct iommu_table *tbl,
69 long index, long npages); 74 long index, long npages);
@@ -208,6 +213,8 @@ extern void iommu_del_device(struct device *dev);
208extern int __init tce_iommu_bus_notifier_init(void); 213extern int __init tce_iommu_bus_notifier_init(void);
209extern long iommu_tce_xchg(struct iommu_table *tbl, unsigned long entry, 214extern long iommu_tce_xchg(struct iommu_table *tbl, unsigned long entry,
210 unsigned long *hpa, enum dma_data_direction *direction); 215 unsigned long *hpa, enum dma_data_direction *direction);
216extern long iommu_tce_xchg_rm(struct iommu_table *tbl, unsigned long entry,
217 unsigned long *hpa, enum dma_data_direction *direction);
211#else 218#else
212static inline void iommu_register_group(struct iommu_table_group *table_group, 219static inline void iommu_register_group(struct iommu_table_group *table_group,
213 int pci_domain_number, 220 int pci_domain_number,