From: Jason Gunthorpe jgg@nvidia.com Sent: Wednesday, November 5, 2025 2:12 AM
sorry coming to this late, but why do we leave inconsistent behavior between unmapping all vs. unmapping a range:
int iopt_unmap_all(struct io_pagetable *iopt, unsigned long *unmapped) {
- int rc;
- rc = iopt_unmap_iova_range(iopt, 0, ULONG_MAX, unmapped); /* If the IOVAs are empty then unmap all succeeds */
- if (rc == -ENOENT)
return 0;- return rc;
- return iopt_unmap_iova_range(iopt, 0, ULONG_MAX, unmapped);
}
here empty IOVAs succeeds, while...
@@ -367,6 +367,10 @@ int iommufd_ioas_unmap(struct iommufd_ucmd *ucmd) &unmapped); if (rc) goto out_put;
if (!unmapped) {rc = -ENOENT;goto out_put; }}
...here it's a failure.
from uAPI p.o.v. better the two scenarios are consistent?