On Mon, Nov 17, 2025 at 06:56:56AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <[email protected]>
> > 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?

Maybe, but this has been like this from the start, so I don't think we
should change it..

This patch was about aligning the type 1 emulation, not changing the
existing iommufd uapi.

Jason

Reply via email to