Re: [RFC PATCH 7/7] vfio/selftests: Add observability test for IO page table usage
From: Pranjal Shrivastava
Date: Mon Nov 30 2026 - 10:28:47 EST
On Wed, Nov 25, 2026 at 04:33:32PM -0800, David Matlack wrote:
> On Thu Oct 1, 2026 at 3:45 PM PDT, Pranjal Shrivastava wrote:
> > Add a new selftest, vfio_nr_pages_test, to validate the iommu-nr-pages
> > fdinfo metric across all IOMMU backends (Type 1 and IOMMUFD native/compat).
>
> What's the status of this series? Should we expect another version
> (e.g. after the discussion on the shrinker RFC and at LPC)?
>
> nit: Please use "vfio: selftests:" as the shortlog prefix for VFIO
> selftests (see Documentation/driver-api/vfio-selftests.rst).
>
Yes. Following the discussion at LPC, Jason would prefer to expose this
only through iommufd rather than VFIO type1, so I'm reworking the series
along those lines and plan to post it soon. That drops the type1 fdinfo
patch and this VFIO selftest.
> I gave this a try in QEMU with an emulated Intel IOMMU (which uses
> generic_pt, so it reports iommu-nr-pages), on top of this series. It
> fails in every mode except iommufd, which skips. Details below.
>
> [...]
>
Thanks a lot for testing this, and you're right about both the fd
selection and the PROT_NONE mapping. Your point about the final
assertion carries over though: I'll make the iommufd selftest check that
the count goes back down after a full-table unmap, rather than asserting
that it stays up.
Thanks,
Praan