Skip to content

Commit 2bef9ba

Browse files
Jacob Panjoergroedel
authored andcommitted
iommu/sva: Remove PASID to mm lookup function
There is no user of iommu_sva_find() function, remove it so that PASID allocator can be a simple IDA. Device drivers are expected to store and keep track of their own PASID metadata. Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Jason Gunthorpe<jgg@nvidia.com> Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Link: https://lore.kernel.org/r/20230322200803.869130-4-jacob.jun.pan@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent cd38911 commit 2bef9ba

2 files changed

Lines changed: 0 additions & 21 deletions

File tree

drivers/iommu/iommu-sva.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,6 @@ int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t max)
5151
}
5252
EXPORT_SYMBOL_GPL(iommu_sva_alloc_pasid);
5353

54-
/* ioasid_find getter() requires a void * argument */
55-
static bool __mmget_not_zero(void *mm)
56-
{
57-
return mmget_not_zero(mm);
58-
}
59-
60-
/**
61-
* iommu_sva_find() - Find mm associated to the given PASID
62-
* @pasid: Process Address Space ID assigned to the mm
63-
*
64-
* On success a reference to the mm is taken, and must be released with mmput().
65-
*
66-
* Returns the mm corresponding to this PASID, or an error if not found.
67-
*/
68-
struct mm_struct *iommu_sva_find(ioasid_t pasid)
69-
{
70-
return ioasid_find(&iommu_sva_pasid, pasid, __mmget_not_zero);
71-
}
72-
EXPORT_SYMBOL_GPL(iommu_sva_find);
73-
7454
/**
7555
* iommu_sva_bind_device() - Bind a process address space to a device
7656
* @dev: the device

drivers/iommu/iommu-sva.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <linux/mm_types.h>
1010

1111
int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t max);
12-
struct mm_struct *iommu_sva_find(ioasid_t pasid);
1312

1413
/* I/O Page fault */
1514
struct device;

0 commit comments

Comments
 (0)