vfio/spapr: Relax the IOMMU compatibility check
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Fri, 29 Apr 2016 08:55:15 +0000 (18:55 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 11 May 2016 11:54:27 +0000 (21:54 +1000)
We are going to have multiple different types of PHB on the same system
with POWER8 + NVLink and PHBs will have different IOMMU ops. However
we only really care about one callback - create_table - so we can
relax the compatibility check here.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/vfio/vfio_iommu_spapr_tce.c

index 0582b72ef3772cf1257cc330dcf5e32246fe72bb..3054e3fa63ac0f30d52b9507c405d436df1bc750 100644 (file)
@@ -1188,7 +1188,8 @@ static int tce_iommu_attach_group(void *iommu_data,
                        goto unlock_exit;
                }
                table_group_tmp = iommu_group_get_iommudata(tcegrp->grp);
-               if (table_group_tmp->ops != table_group->ops) {
+               if (table_group_tmp->ops->create_table !=
+                               table_group->ops->create_table) {
                        pr_warn("tce_vfio: Group %d is incompatible with group %d\n",
                                        iommu_group_id(iommu_group),
                                        iommu_group_id(tcegrp->grp));