<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/testing/selftests/vfio, branch master</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=master</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2026-03-20T19:54:51Z</updated>
<entry>
<title>vfio: selftests: Support DMR and GNR-D DSA devices</title>
<updated>2026-03-20T19:54:51Z</updated>
<author>
<name>Yi Lai</name>
<email>yi1.lai@intel.com</email>
</author>
<published>2026-03-20T01:09:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c82cfe15916d33e89c2d2efeeb624e8c9c2c4ca8'/>
<id>urn:sha1:c82cfe15916d33e89c2d2efeeb624e8c9c2c4ca8</id>
<content type='text'>
Currently, the VFIO DSA driver test only supports the SPR DSA device ID.
Attempting to run the test on newer platforms like DMR or GNR-D results
in a "No driver found" error, causing the test to be skipped.

Refactor dsa_probe() to use a switch statement for checking device IDs.
This improves maintainability and makes it easier to add new device IDs
in the future.

Add the following DSA device IDs to the supported list:
PCI_DEVICE_ID_INTEL_DSA_DMR  (0x1212)
PCI_DEVICE_ID_INTEL_DSA_GNRD (0x11fb)

Signed-off-by: Yi Lai &lt;yi1.lai@intel.com&gt;
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Link: https://lore.kernel.org/r/20260320010930.481380-1-yi1.lai@intel.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
<entry>
<title>vfio: selftests: Build tests on aarch64</title>
<updated>2026-03-20T19:52:16Z</updated>
<author>
<name>Ted Logan</name>
<email>tedlogan@fb.com</email>
</author>
<published>2026-03-19T22:58:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1347a742a1e1b080e2e8d200312ae45b8d6ac859'/>
<id>urn:sha1:1347a742a1e1b080e2e8d200312ae45b8d6ac859</id>
<content type='text'>
Fix vfio selftests on aarch64, allowing native builds on aarch64 hosts.

Reported-by: Matt Evans &lt;mattev@meta.com&gt;
Closes: https://lore.kernel.org/all/e51b4ff2-13c4-47d4-b781-3dcbd740d274@meta.com/
Fixes: a55d4bbbe644 ("vfio: selftests: only build tests on arm64 and x86_64")
Signed-off-by: Ted Logan &lt;tedlogan@fb.com&gt;
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Link: https://lore.kernel.org/r/20260319-vfio-selftests-aarch64-v2-1-bb2621c24dc4@fb.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
<entry>
<title>vfio: selftests: Fix VLA initialisation in vfio_pci_irq_set()</title>
<updated>2026-03-19T18:32:08Z</updated>
<author>
<name>Manish Honap</name>
<email>mhonap@nvidia.com</email>
</author>
<published>2026-03-17T05:14:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f42d716707654134789a0205a050b0d022be948'/>
<id>urn:sha1:4f42d716707654134789a0205a050b0d022be948</id>
<content type='text'>
C does not permit an initialiser expression on a variable-length array
(C99 Section 6.7.9 constraint: "The type of the entity to be initialized
shall not be a variable length array type").

vfio_pci_irq_set() declared:

      u8 buf[sizeof(struct vfio_irq_set) + sizeof(int) * count] = {};

where `count` is a runtime function parameter, making `buf` a VLA.

GCC rejects this with (tried with GCC-9.4.0):

      error: variable-sized object may not be initialized

Fix by removing the `= {}` initialiser and inserting an explicit
memset() immediately after the declaration.  memset() on a VLA is
perfectly legal and achieves the same zero-initialisation on all
conforming C implementations.

Fixes: 19faf6fd969c ("vfio: selftests: Add a helper library for VFIO selftests")
Cc: stable@vger.kernel.org
Reviewed-by: Dave Jiang &lt;dave.jiang@intel.com&gt;
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Signed-off-by: Manish Honap &lt;mhonap@nvidia.com&gt;
Link: https://lore.kernel.org/r/20260317051402.3725670-1-mhonap@nvidia.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
<entry>
<title>vfio: selftests: fix crash in vfio_dma_mapping_mmio_test</title>
<updated>2026-03-10T17:56:01Z</updated>
<author>
<name>Alex Mastro</name>
<email>amastro@fb.com</email>
</author>
<published>2026-03-03T19:46:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f183963891b4b0126f19aa0993ed931f3f3f9520'/>
<id>urn:sha1:f183963891b4b0126f19aa0993ed931f3f3f9520</id>
<content type='text'>
Remove the __iommu_unmap() call on a region that was never mapped.
When __iommu_map() fails (expected for MMIO vaddrs in non-VFIO
modes), the region is not added to the dma_regions list, leaving its
list_head zero-initialized. If the unmap ioctl returns success,
__iommu_unmap() calls list_del_init() on this zeroed node and crashes.

This fixes the iommufd_compat_type1 and iommufd_compat_type1v2
test variants.

Fixes: 080723f4d4c3 ("vfio: selftests: Add vfio_dma_mapping_mmio_test")
Signed-off-by: Alex Mastro &lt;amastro@fb.com&gt;
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Yuan Yao &lt;yaoyuan@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20260303-fix-mmio-test-v1-1-78b4a9e46a4e@fb.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
<entry>
<title>vfio: selftests: only build tests on arm64 and x86_64</title>
<updated>2026-02-06T22:08:05Z</updated>
<author>
<name>Ted Logan</name>
<email>tedlogan@fb.com</email>
</author>
<published>2026-02-03T01:23:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a55d4bbbe64494bb92b32402018efb2ffc44d796'/>
<id>urn:sha1:a55d4bbbe64494bb92b32402018efb2ffc44d796</id>
<content type='text'>
Only build vfio self-tests on arm64 and x86_64; these are the only
architectures where the vfio self-tests are run. Addresses compiler
warnings for format and conversions on i386.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202601211830.aBEjmEFD-lkp@intel.com/
Signed-off-by: Ted Logan &lt;tedlogan@fb.com&gt;
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Link: https://lore.kernel.org/r/20260202-vfio-selftest-only-64bit-v2-1-9c3ebb37f0f4@fb.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
<entry>
<title>vfio: selftests: Drop IOMMU mapping size assertions for VFIO_TYPE1_IOMMU</title>
<updated>2026-01-19T17:06:30Z</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2026-01-14T21:12:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1c588bca3bd5b39c93a28a5986bf82ebfb05eec2'/>
<id>urn:sha1:1c588bca3bd5b39c93a28a5986bf82ebfb05eec2</id>
<content type='text'>
Drop the assertions about IOMMU mappings sizes for VFIO_TYPE1_IOMMU
modes (both the VFIO mode and the iommufd compatibility mode). These
assertions fail when CONFIG_IOMMUFD_VFIO_CONTAINER is enabled, since
iommufd compatibility mode provides different huge page behavior than
VFIO for VFIO_TYPE1_IOMMU. VFIO_TYPE1_IOMMU is an old enough interface
that it's not worth changing the behavior of VFIO and iommufd to match
nor care about the IOMMU mapping sizes.

Cc: Jason Gunthorpe &lt;jgg@ziepe.ca&gt;
Link: https://lore.kernel.org/kvm/20260109143830.176dc279@shazbot.org/
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Link: https://lore.kernel.org/r/20260114211252.2581145-1-dmatlack@google.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
<entry>
<title>vfio: selftests: Add vfio_dma_mapping_mmio_test</title>
<updated>2026-01-19T17:06:30Z</updated>
<author>
<name>Alex Mastro</name>
<email>amastro@fb.com</email>
</author>
<published>2026-01-14T18:57:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=080723f4d4c3c6fb0720aae614deb1f30ee9ef2e'/>
<id>urn:sha1:080723f4d4c3c6fb0720aae614deb1f30ee9ef2e</id>
<content type='text'>
Test IOMMU mapping the BAR mmaps created during vfio_pci_device_setup().

All IOMMU modes are tested: vfio_type1 variants are expected to succeed,
while non-type1 modes are expected to fail. iommufd compat mode can be
updated to expect success once kernel support lands. Native iommufd will
not support mapping vaddrs backed by MMIO (it will support dma-buf based
MMIO mapping instead).

Signed-off-by: Alex Mastro &lt;amastro@fb.com&gt;
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Tested-by: David Matlack &lt;dmatlack@google.com&gt;
Link: https://lore.kernel.org/r/20260114-map-mmio-test-v3-3-44e036d95e64@fb.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
<entry>
<title>vfio: selftests: Align BAR mmaps for efficient IOMMU mapping</title>
<updated>2026-01-19T17:06:30Z</updated>
<author>
<name>Alex Mastro</name>
<email>amastro@fb.com</email>
</author>
<published>2026-01-14T18:57:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=557dbdf6c4e9c2dc3d4a4476c67ef14dca32378d'/>
<id>urn:sha1:557dbdf6c4e9c2dc3d4a4476c67ef14dca32378d</id>
<content type='text'>
Update vfio_pci_bar_map() to align BAR mmaps for efficient huge page
mappings. The manual mmap alignment can be removed once mmap(!MAP_FIXED)
on vfio device fds improves to automatically return well-aligned
addresses.

Also add MADV_HUGEPAGE, which encourages the kernel to use huge pages
(e.g. when /sys/kernel/mm/transparent_hugepage/enabled is set to "madvise").

Drop MAP_FILE from mmap(). It is an ignored compatibility flag.

Signed-off-by: Alex Mastro &lt;amastro@fb.com&gt;
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Tested-by: David Matlack &lt;dmatlack@google.com&gt;
Link: https://lore.kernel.org/r/20260114-map-mmio-test-v3-2-44e036d95e64@fb.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
<entry>
<title>vfio: selftests: Centralize IOMMU mode name definitions</title>
<updated>2026-01-19T17:06:29Z</updated>
<author>
<name>Alex Mastro</name>
<email>amastro@fb.com</email>
</author>
<published>2026-01-14T18:57:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=03b7c2d763c907f508edf8c317c0e920ce072a33'/>
<id>urn:sha1:03b7c2d763c907f508edf8c317c0e920ce072a33</id>
<content type='text'>
Replace scattered string literals with MODE_* macros in iommu.h. This
provides a single source of truth for IOMMU mode name strings.

Signed-off-by: Alex Mastro &lt;amastro@fb.com&gt;
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Tested-by: David Matlack &lt;dmatlack@google.com&gt;
Link: https://lore.kernel.org/r/20260114-map-mmio-test-v3-1-44e036d95e64@fb.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
<entry>
<title>vfio: selftests: Drop &lt;uapi/linux/types.h&gt; includes</title>
<updated>2025-12-23T21:17:13Z</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2025-12-19T23:38:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=193120dddd1a1f3dcae164289498588fa0544d78'/>
<id>urn:sha1:193120dddd1a1f3dcae164289498588fa0544d78</id>
<content type='text'>
Drop the &lt;uapi/linux/types.h&gt; includes now that &lt;linux/types.h&gt;
(tools/include/linux/types.h) has a definition for __aligned_le64, which
is needed by &lt;linux/iommufd.h&gt;.

Including &lt;uapi/linux/types.h&gt; is harmless but causes benign typedef
redefinitions. This is not a problem for VFIO selftests but becomes an
issue when the VFIO selftests library is built into KVM selftests, since
they are built with -std=gnu99 which does not allow typedef redifitions.

No functional change intended.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Link: https://lore.kernel.org/r/20251219233818.1965306-3-dmatlack@google.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
</entry>
</feed>
