@@ -161,6 +161,7 @@ struct iommu_table_group;
struct iommu_table_group_ops {
unsigned long (*get_table_size)(
+ int num,
__u32 page_shift,
__u64 window_size,
__u32 levels);
@@ -192,7 +192,7 @@ extern int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type);
extern void pnv_teardown_msi_irqs(struct pci_dev *pdev);
extern struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev);
extern void pnv_set_msi_irq_chip(struct pnv_phb *phb, unsigned int virq);
-extern unsigned long pnv_pci_ioda2_get_table_size(__u32 page_shift,
+extern unsigned long pnv_pci_ioda2_get_table_size(int num, __u32 page_shift,
__u64 window_size, __u32 levels);
extern int pnv_eeh_post_init(void);
@@ -2597,7 +2597,7 @@ static long pnv_pci_ioda2_unset_window(struct iommu_table_group *table_group,
#endif
#ifdef CONFIG_IOMMU_API
-unsigned long pnv_pci_ioda2_get_table_size(__u32 page_shift,
+unsigned long pnv_pci_ioda2_get_table_size(int num, __u32 page_shift,
__u64 window_size, __u32 levels)
{
unsigned long bytes = 0;
@@ -2644,7 +2644,7 @@ static long pnv_pci_ioda2_create_table_userspace(
if (!ret)
(*ptbl)->it_allocated_size = pnv_pci_ioda2_get_table_size(
- page_shift, window_size, levels);
+ num, page_shift, window_size, levels);
return ret;
}
@@ -613,8 +613,8 @@ static long tce_iommu_create_table(struct tce_container *container,
{
long ret, table_size;
- table_size = table_group->ops->get_table_size(page_shift, window_size,
- levels);
+ table_size = table_group->ops->get_table_size(num, page_shift,
+ window_size, levels);
if (!table_size)
return -EINVAL;
We are about to add an additional offset within a TCE table which is going to increase the size of the window, prepare for this. This should cause no behavioral change. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- arch/powerpc/include/asm/iommu.h | 1 + arch/powerpc/platforms/powernv/pci.h | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 4 ++-- drivers/vfio/vfio_iommu_spapr_tce.c | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-)