Skip to contentSkip to conversation

vfio: selftests: Add documentation

PATCH Superseded David Matlack 2 participants 2 messages Aug 18 – Sep 2

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

David Matlack

author maintainer
#0 lore raw

PATCH 1/1 vfio: selftests: Add documentation

Add documentation for VFIO selftests in Documentation/driver-api/vfio-selftests.rst, include it in the driver-api index, and update MAINTAINERS.

VFIO selftests provide a userspace testing framework built on kselftest to exercise VFIO and IOMMUFD APIs with real physical PCI devices. Since VFIO selftests was introduced it has expanded to include helper libraries (libvfio), driver-level abstractions for triggering hardware DMA and interrupts, multiple IOMMU execution modes, dynamic IOVA allocation, and native integration into KVM selftests. Dedicated documentation should be helpful to guide kernel developers on writing tests, setting up devices, running tests, and understanding the helper library.

---
Note: The integration of libvfio into KVM selftests hasn't landed in vfio/next yet but Sean sent out the pull request to include it in 7.3 so I am optimistically including it in the documentation here.

Cc Josh Hilke <[email protected]>
Cc Sean Christopherson <[email protected]>
Cc Alex Williamson <[email protected]>
 Documentation/driver-api/index.rst          |   1 +
 Documentation/driver-api/vfio-selftests.rst | 243 ++++++++++++++++++++
 MAINTAINERS                                 |   1 +
 3 files changed, 245 insertions(+)
 create mode 100644 Documentation/driver-api/vfio-selftests.rst
Documentation/driver-api/index.rst +1 -0
index eaf7161ff957..630f33287bc0 100644
@@ -47,6 +47,7 @@ of interest to most developers working on device drivers.
    vfio-mediated-device
    vfio
    vfio-pci-device-specific-driver-acceptance
+   vfio-selftests
 
 Bus-level documentation
 =======================
Documentation/driver-api/vfio-selftests.rst new file +243 -0

243 lines not on this page · raw message

MAINTAINERS +1 -0
index 806bd2d80d15..ba174dd8ba1b 100644
@@ -28396,6 +28396,7 @@ VFIO SELFTESTS
 M:	David Matlack <[email protected]>
 L:	[email protected]
 S:	Maintained
+F:	Documentation/driver-api/vfio-selftests.rst
 F:	tools/testing/selftests/vfio/
 
 VFIO VIRTIO PCI DRIVER

base-commit: 37ffa24c9d07edcd414d34283e02af3f3866cf12

Signature · 1 line
2.55.0.699.gb54405d56f-goog
#1 lore raw

Documentation/driver-api/vfio-selftests.rst line 206

Quoted 4 lines · On Tue, 18 Aug 2026 00:05:49 +0000 David Matlack <[email protected]> wrote:
Documentation/driver-api/vfio-selftests.rst new file +4 -0
+By exercising DMA and interrupts across real, varied endpoints, tests can
+thoroughly stress and validate the underlying kernel paths—such as IOMMU page
+table management, dirty page tracking, Device TLB and IOTLB invalidations, and
+interrupt delivery under authentic hardware conditions.

"...underlying kernel paths, such as..." I haven't met a human that actually uses em-dash and it renders poorly in ascii. Otherwise the doc looks great. I also realize I posted my most recent patches with the wrong subject prefix, I should have used "vfio: selftests:". We could maybe mention such a convention in this doc, but enforcement is largely manual, and often an afterthought for me. Thanks,

Alex