[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aRJwf1kv72zzu5Qt@devgpu015.cco6.facebook.com>
Date: Mon, 10 Nov 2025 15:08:47 -0800
From: Alex Mastro <amastro@...com>
To: David Matlack <dmatlack@...gle.com>
CC: Alex Williamson <alex@...zbot.org>, Shuah Khan <shuah@...nel.org>,
<kvm@...r.kernel.org>, <linux-kselftest@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Jason Gunthorpe <jgg@...pe.ca>
Subject: Re: [PATCH 1/4] vfio: selftests: add iova range query helpers
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.
Powered by blists - more mailing lists