[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1623850736-389584-3-git-send-email-quic_c_gdjako@quicinc.com>
Date: Wed, 16 Jun 2021 06:38:43 -0700
From: Georgi Djakov <quic_c_gdjako@...cinc.com>
To: <will@...nel.org>, <robin.murphy@....com>
CC: <joro@...tes.org>, <isaacm@...eaurora.org>,
<baolu.lu@...ux.intel.com>, <pratikp@...eaurora.org>,
<iommu@...ts.linux-foundation.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <djakov@...nel.org>
Subject: [PATCH v7 02/15] iommu: Add an unmap_pages() op for IOMMU drivers
From: "Isaac J. Manjarres" <isaacm@...eaurora.org>
Add a callback for IOMMU drivers to provide a path for the
IOMMU framework to call into an IOMMU driver, which can call
into the io-pgtable code, to unmap a virtually contiguous
range of pages of the same size.
For IOMMU drivers that do not specify an unmap_pages() callback,
the existing logic of unmapping memory one page block at a time
will be used.
Signed-off-by: Isaac J. Manjarres <isaacm@...eaurora.org>
Suggested-by: Will Deacon <will@...nel.org>
Signed-off-by: Will Deacon <will@...nel.org>
Acked-by: Lu Baolu <baolu.lu@...ux.intel.com>
Signed-off-by: Georgi Djakov <quic_c_gdjako@...cinc.com>
---
include/linux/iommu.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 32d448050bf7..25a844121be5 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -181,6 +181,7 @@ struct iommu_iotlb_gather {
* @detach_dev: detach device from an iommu domain
* @map: map a physically contiguous memory region to an iommu domain
* @unmap: unmap a physically contiguous memory region from an iommu domain
+ * @unmap_pages: unmap a number of pages of the same size from an iommu domain
* @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain
* @iotlb_sync_map: Sync mappings created recently using @map to the hardware
* @iotlb_sync: Flush all queued ranges from the hardware TLBs and empty flush
@@ -231,6 +232,9 @@ struct iommu_ops {
phys_addr_t paddr, size_t size, int prot, gfp_t gfp);
size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
size_t size, struct iommu_iotlb_gather *iotlb_gather);
+ size_t (*unmap_pages)(struct iommu_domain *domain, unsigned long iova,
+ size_t pgsize, size_t pgcount,
+ struct iommu_iotlb_gather *iotlb_gather);
void (*flush_iotlb_all)(struct iommu_domain *domain);
void (*iotlb_sync_map)(struct iommu_domain *domain, unsigned long iova,
size_t size);
Powered by blists - more mailing lists