Thread (79 messages) 79 messages, 3 authors, 2025-06-06

Re: [PATCH v5 09/29] iommufd: Do not unmap an owned iopt_area

From: Nicolin Chen <hidden>
Date: 2025-06-05 04:31:07
Also in: linux-doc, linux-iommu, linux-kselftest, linux-patches, linux-tegra, lkml

On Wed, May 28, 2025 at 02:08:45PM -0300, Jason Gunthorpe wrote:
quoted hunk ↗ jump to hunk
@@ -740,11 +740,16 @@ static int iopt_unmap_iova_range(struct io_pagetable *iopt, unsigned long start,
 			up_write(&iopt->iova_rwsem);
 			up_read(&iopt->domains_rwsem);
 
-			iommufd_access_notify_unmap(iopt, area_first, length);
+			rc = iommufd_access_notify_unmap(iopt, area_first, length);
+			if (rc)
+				goto out_unmapped;
+
I found that we have to re-take those rwsems to unset a flag:

			rc = iommufd_access_notify_unmap(iopt, area_first, length);
			if (rc) {
				down_read(&iopt->domains_rwsem);
  				down_write(&iopt->iova_rwsem);
				area->prevent_access = false;
				goto out_unlock_iova;
			}

Will include this in the patch.

Thanks
Nicolin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help