From: Alex Mastro <amastro@fb.com>
To: Alex Williamson <alex@shazbot.org>
Cc: David Matlack <dmatlack@google.com>,
Shuah Khan <shuah@kernel.org>, Jason Gunthorpe <jgg@ziepe.ca>,
<kvm@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 0/4] vfio: selftests: update DMA mapping tests to use queried IOVA ranges
Date: Wed, 12 Nov 2025 13:31:43 -0800 [thread overview]
Message-ID: <aRT8v4Yj8Lm5KlUk@devgpu015.cco6.facebook.com> (raw)
In-Reply-To: <20251112083005.542e0b7f.alex@shazbot.org>
On Wed, Nov 12, 2025 at 08:30:05AM -0700, Alex Williamson wrote:
> On Tue, 11 Nov 2025 10:48:23 -0800
> Alex Mastro <amastro@fb.com> wrote:
>
> > Not all IOMMUs support the same virtual address width as the processor,
> > for instance older Intel consumer platforms only support 39-bits of
> > IOMMU address space. On such platforms, using the virtual address as the
> > IOVA and mappings at the top of the address space both fail.
> >
> > VFIO and IOMMUFD have facilities for retrieving valid IOVA ranges,
> > VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE and IOMMU_IOAS_IOVA_RANGES,
> > respectively. These provide compatible arrays of ranges from which we
> > can construct a simple allocator.
> >
> > Use this new allocator in place of reusing the virtual address, and
> > incorporate the maximum supported IOVA into the limit testing. This
> > latter change doesn't test quite the same absolute end-of-address space
> > behavior but still seems to have some value.
> >
> > This series is based on Alex Williamson's "Incorporate IOVA range info"
> > [1] along with feedback from the discussion in David Matlack's "Skip
> > vfio_dma_map_limit_test if mapping returns -EINVAL" [2].
> >
> > Given David's plans to split IOMMU concerns from devices as described
> > in [3], this series' home for `struct iova_allocator` and IOVA
> > range helpers are likely to be short lived, since they reside in
> > vfio_pci_device.c. I assume that the rework can move this functionality
> > to a more appropriate location next to other IOMMU-focused code, once
> > such a place exists.
> >
> > [1] https://lore.kernel.org/all/20251108212954.26477-1-alex@shazbot.org/#t
> > [2] https://lore.kernel.org/all/20251107222058.2009244-1-dmatlack@google.com/
> > [3] https://lore.kernel.org/all/aRIoKJk0uwLD-yGr@google.com/
> >
> > To: Alex Williamson <alex@shazbot.org>
> > To: David Matlack <dmatlack@google.com>
> > To: Shuah Khan <shuah@kernel.org>
> > To: Jason Gunthorpe <jgg@ziepe.ca>
> > Cc: kvm@vger.kernel.org
> > Cc: linux-kselftest@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > Signed-off-by: Alex Mastro <amastro@fb.com>
> >
> > Changes in v3:
> > - Update capability chain cycle detection
> > - Clarify the iova=vaddr commit message
> > - Link to v2: https://lore.kernel.org/r/20251111-iova-ranges-v2-0-0fa267ff9b78@fb.com
>
> Applied to vfio for-linus branch for v6.18. Thanks for the quick
> resolution on this!
No problem, thanks for the reviews!
>
> Alex
prev parent reply other threads:[~2025-11-12 21:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 18:48 [PATCH v3 0/4] vfio: selftests: update DMA mapping tests to use queried IOVA ranges Alex Mastro
2025-11-11 18:48 ` [PATCH v3 1/4] vfio: selftests: add iova range query helpers Alex Mastro
2025-11-11 18:48 ` [PATCH v3 2/4] vfio: selftests: fix map limit tests to use last available iova Alex Mastro
2025-11-11 18:48 ` [PATCH v3 3/4] vfio: selftests: add iova allocator Alex Mastro
2025-11-11 18:48 ` [PATCH v3 4/4] vfio: selftests: replace iova=vaddr with allocated iovas Alex Mastro
2025-11-11 19:26 ` [PATCH v3 0/4] vfio: selftests: update DMA mapping tests to use queried IOVA ranges David Matlack
2025-11-12 17:39 ` Alex Mastro
2025-11-12 17:51 ` David Matlack
2025-11-12 18:04 ` Alex Mastro
2025-11-12 15:30 ` Alex Williamson
2025-11-12 21:31 ` Alex Mastro [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aRT8v4Yj8Lm5KlUk@devgpu015.cco6.facebook.com \
--to=amastro@fb.com \
--cc=alex@shazbot.org \
--cc=dmatlack@google.com \
--cc=jgg@ziepe.ca \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox