Skip to content

Commit

Permalink
iommu/smmuv3: Add PASID cache invalidation per PASID
Browse files Browse the repository at this point in the history
In order to cascade guest CFGI_CD, let's add PASID cache invalidation
per PASID.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
  • Loading branch information
eauger authored and intel-lab-lkp committed Nov 16, 2020
1 parent da43b0a commit 95e4ccc
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
Expand Up @@ -3002,9 +3002,19 @@ arm_smmu_cache_invalidate(struct iommu_domain *domain, struct device *dev,
} else {
return -EINVAL;
}
}
if (inv_info->cache & IOMMU_CACHE_INV_TYPE_PASID ||
inv_info->cache & IOMMU_CACHE_INV_TYPE_DEV_IOTLB) {
} else if (inv_info->cache & IOMMU_CACHE_INV_TYPE_PASID) {
if (inv_info->granularity == IOMMU_INV_GRANU_PASID) {
struct iommu_inv_pasid_info *info =
&inv_info->granu.pasid_info;

if (!info->flags & IOMMU_INV_PASID_FLAGS_PASID)
return -EINVAL;

arm_smmu_sync_cd(smmu_domain, info->pasid, true);
} else {
return -ENOENT;
}
} else { /* IOMMU_CACHE_INV_TYPE_DEV_IOTLB */
return -ENOENT;
}
return 0;
Expand Down

0 comments on commit 95e4ccc

Please sign in to comment.