]> Gentwo Git Trees - linux/.git/commit
iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE
authorNicolin Chen <nicolinc@nvidia.com>
Tue, 5 Nov 2024 20:05:12 +0000 (12:05 -0800)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 12 Nov 2024 15:46:19 +0000 (11:46 -0400)
commit54ce69e36c71c88f258b1a322c54343d90954858
treeb4e122f4f27f1c09c9b1bfae1e6c460851116946
parent67db79dc1a411335f8a7e53a5e206d96b237d9a8
iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE

With a vIOMMU object, use space can flush any IOMMU related cache that can
be directed via a vIOMMU object. It is similar to the IOMMU_HWPT_INVALIDATE
uAPI, but can cover a wider range than IOTLB, e.g. device/desciprtor cache.

Allow hwpt_id of the iommu_hwpt_invalidate structure to carry a viommu_id,
and reuse the IOMMU_HWPT_INVALIDATE uAPI for vIOMMU invalidations. Drivers
can define different structures for vIOMMU invalidations v.s. HWPT ones.

Since both the HWPT-based and vIOMMU-based invalidation pathways check own
cache invalidation op, remove the WARN_ON_ONCE in the allocator.

Update the uAPI, kdoc, and selftest case accordingly.

Link: https://patch.msgid.link/r/b411e2245e303b8a964f39f49453a5dff280968f.1730836308.git.nicolinc@nvidia.com
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/hw_pagetable.c
include/uapi/linux/iommufd.h
tools/testing/selftests/iommu/iommufd.c