diff mbox series

[v2,04/17] iommu: Export iommu_get_resv_regions()

Message ID 4-v2-51b9896e7862+8a8c-iommufd_alloc_jgg@nvidia.com (mailing list archive)
State New
Headers show
Series Add iommufd physical device operations for replace and alloc hwpt | expand

Commit Message

Jason Gunthorpe March 8, 2023, 12:35 a.m. UTC
iommufd wants to use this in the next patch. For some reason the
iommu_put_resv_regions() was already exported.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/iommu.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Baolu Lu March 8, 2023, 12:06 p.m. UTC | #1
On 2023/3/8 8:35, Jason Gunthorpe wrote:
> iommufd wants to use this in the next patch. For some reason the
> iommu_put_resv_regions() was already exported.

"virtio-iommu calls it and can be modular."

https://lore.kernel.org/all/20220708093332.GA28988@lst.de/

> Signed-off-by: Jason Gunthorpe<jgg@nvidia.com>

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

Best regards,
baolu
Jason Gunthorpe March 8, 2023, 2:54 p.m. UTC | #2
On Wed, Mar 08, 2023 at 08:06:26PM +0800, Baolu Lu wrote:
> On 2023/3/8 8:35, Jason Gunthorpe wrote:
> > iommufd wants to use this in the next patch. For some reason the
> > iommu_put_resv_regions() was already exported.
> 
> "virtio-iommu calls it and can be modular."
> 
> https://lore.kernel.org/all/20220708093332.GA28988@lst.de/

Yes, but that seems to be pretty weird on its own as the list it is
managing wasn't really created by the iommu core code, and doesn't
need to use the free callback..

Jason
Tian, Kevin March 10, 2023, 10:40 a.m. UTC | #3
> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Wednesday, March 8, 2023 8:36 AM
> 
> +/**
> + * iommu_get_resv_regions - get reserved regions
> + * @dev: device for which to get reserved regions
> + * @list: reserved region list for device
> + *
> + * This returns a list of reserved IOVA regions specific to this device.
> + * A domain user should not map IOVA to these ranges.
> + */

s/to these ranges/in these ranges/

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
diff mbox series

Patch

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 10db680acaed5a..e57462bb06d9f0 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -2639,6 +2639,14 @@  int iommu_set_pgtable_quirks(struct iommu_domain *domain,
 }
 EXPORT_SYMBOL_GPL(iommu_set_pgtable_quirks);
 
+/**
+ * iommu_get_resv_regions - get reserved regions
+ * @dev: device for which to get reserved regions
+ * @list: reserved region list for device
+ *
+ * This returns a list of reserved IOVA regions specific to this device.
+ * A domain user should not map IOVA to these ranges.
+ */
 void iommu_get_resv_regions(struct device *dev, struct list_head *list)
 {
 	const struct iommu_ops *ops = dev_iommu_ops(dev);
@@ -2646,9 +2654,10 @@  void iommu_get_resv_regions(struct device *dev, struct list_head *list)
 	if (ops->get_resv_regions)
 		ops->get_resv_regions(dev, list);
 }
+EXPORT_SYMBOL_GPL(iommu_get_resv_regions);
 
 /**
- * iommu_put_resv_regions - release resered regions
+ * iommu_put_resv_regions - release reserved regions
  * @dev: device for which to free reserved regions
  * @list: reserved region list for device
  *