Skip to contentSkip to conversation

iommu: expose iommu_sva_find() to common header

PATCH New Fenghua Yu 1 participant 2 messages Jan 3, 2023 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Fenghua Yu

author
#1 lore raw

PATCH 8/17 iommu: expose iommu_sva_find() to common header

From: Dave Jiang <[email protected]>

Move iommu_sva_find() prototype to global header from local header in order to allow drivers to call the function. Used by idxd driver to find the mm from device reported PASID. The symbol is already exported.

---
 drivers/iommu/iommu-sva.h | 1 -
 include/linux/iommu.h     | 7 +++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/iommu/iommu-sva.h +0 -1
index 7215a761b962..102eae1817a2 100644
@@ -9,7 +9,6 @@
 #include <linux/mm_types.h>
 
 int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t max);
-struct mm_struct *iommu_sva_find(ioasid_t pasid);
 
 /* I/O Page fault */
 struct device;
include/linux/iommu.h +7 -0
index 46e1347bfa22..7db16ca3f519 100644
@@ -704,6 +704,8 @@ void iommu_release_device(struct device *dev);
 int iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features f);
 int iommu_dev_disable_feature(struct device *dev, enum iommu_dev_features f);
 
+struct mm_struct *iommu_sva_find(ioasid_t pasid);
+
 int iommu_device_use_default_domain(struct device *dev);
 void iommu_device_unuse_default_domain(struct device *dev);
 
@@ -1042,6 +1044,11 @@ iommu_dev_disable_feature(struct device *dev, enum iommu_dev_features feat)
 	return -ENODEV;
 }
 
+static inline struct mm_struct *iommu_sva_find(ioasid_t pasid)
+{
+	return ERR_PTR(-ENODEV);
+}
+
 static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev)
 {
 	return NULL;
Signature · 1 line
2.32.0
author
#2 lore raw

PATCH 9/17 mm: export access_remote_vm() symbol

In reply to a message not in the archive

From: Dave Jiang <[email protected]>

Export access_remote_vm() symbol for driver usage. The idxd driver would like to use it to write the user's completion record that the hardware device is not able to write to due to user page fault.

---
 mm/memory.c | 1 +
 1 file changed, 1 insertion(+)
mm/memory.c +1 -0
index aad226daf41b..caae4deff987 100644
@@ -5579,6 +5579,7 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr,
 {
 	return __access_remote_vm(mm, addr, buf, len, gup_flags);
 }
+EXPORT_SYMBOL_GPL(access_remote_vm);
 
 /*
  * Access another process' address space.
Signature · 1 line
2.32.0