[PATCH v2 08/19] iommufd/viommu: Add cache_invalidate for IOMMU_VIOMMU_TYPE_DEFAULT

Jason Gunthorpe jgg at nvidia.com
Thu Sep 5 09:05:04 PDT 2024


On Tue, Aug 27, 2024 at 09:59:45AM -0700, Nicolin Chen wrote:
> Add a default_viommu_ops with a new op for cache invaldiation, similar to
> the cache_invalidate_user op in structure iommu_domain_ops, but wider. An
> IOMMU driver that allocated a nested domain with a core-managed viommu is
> able to use the same viommu pointer for this cache invalidation API.
> 
> ARM SMMUv3 for example supports IOTLB and ATC device cache invaldiations.
> The IOTLB invalidation is per-VMID, held currently by a parent S2 domain.
> The ATC invalidation is per device (Stream ID) that should be tranlsated
> by a virtual device ID lookup table. Either case fits the viommu context.
> 
> Signed-off-by: Nicolin Chen <nicolinc at nvidia.com>
> ---
>  drivers/iommu/iommufd/iommufd_private.h |  3 +++
>  drivers/iommu/iommufd/viommu.c          |  3 +++
>  include/linux/iommu.h                   |  5 +++++
>  include/linux/iommufd.h                 | 19 +++++++++++++++++++
>  4 files changed, 30 insertions(+)

It looks OK

Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>

Jason



More information about the linux-arm-kernel mailing list