On Mon, Nov 10, 2025 at 11:02:32PM +0000, David Matlack wrote:
> On 2025-11-10 02:32 PM, Alex Mastro wrote:
> > On Mon, Nov 10, 2025 at 10:03:54PM +0000, David Matlack wrote:
> > > On 2025-11-10 01:10 PM, Alex Mastro wrote:
> > > > +
> > > > +       hdr = vfio_iommu_info_cap_hdr(buf, 
> > > > VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE);
> > > > +       if (!hdr)
> > > > +               goto free_buf;
> > > 
> > > Is this to account for running on old versions of VFIO? Or are there
> > > some scenarios when VFIO can't report the list of IOVA ranges?
> > 
> > I wanted to avoid being overly assertive in this low-level helper function,
> > mostly out of ignorance about where/in which system states this capability 
> > may
> > not be reported.
> 
> Makes sense, but IIUC a failure here will eventually turn into an
> assertion failure in all callers that exist today. So there's currently
> no reason to plumb it up the stack.

Yes, the first part is true.

> 
> For situations like this, I think we should err on asserting at the
> lower level helpers, and only propagating errors up as needed. That
> keeps all the happy-path callers simple, and those should be the
> majority of callers (if not all callers).

SGTM -- I will do this.



Reply via email to