Skip to contentSkip to conversation

VFIO updates for v7.4-rc1

GIT PULL Merged Alex Williamson 2 participants 2 messages Oct 22 – Oct 24 KVM

lore
Share & tools
lore
#0 lore raw

Hi Linus,

The following changes since commit 93f51579e7df248780214094418f205253383cc5:

Linux 7.3-rc4 (2026-09-20 13:48:15 -0700)

are available in the Git repository at:

https://github.com/awilliam/linux-vfio.git tags/vfio-v7.4-rc1

for you to fetch changes up to 076d7e989cb69f6ded7d60f2a080eb909930061b:

vfio/nvgrace-gpu: Drop the usemem length check in open_device (2026-10-16 09:32:02 -0600)

----------------------------------------------------------------
VFIO updates for v7.4-rc1

- Fix missing selftest <libgen.h> include for basename() to support non-glibc builds. (Hisam Mehboob)

- Add vfio selftest documentation covering the libvfio helper library and guidance for developers to aid in adding and understanding the framework. (David Matlack)

- Fix vfio cdev open path to prevent a second open from clobbering the vf_token or clearing the KVM reference. Add a selftest to avoid future recurrences. (Alex Williamson)

- Extend vfio selftest mix_and_match timeouts, in particular to account for systems where generated faults can induce heavy SMM load, delaying internal timeouts. Also extend timeout for execution via runner to account for various tests exceeding default 45s timeout. (Alex Williamson)

- Add tracking for non-reserved mappings into a vfio_dma object in order to optimize the tear-down paths where per-page tests can be entirely skipped. This resolves a soft lockup for large memory GPUs. (Samuel Crossley)

- Add vfio selftest driver for mlx5, providing another target for exercising DMA and interrupts against a physical device. (Jason Gunthorpe)

- Hardening against read-only region promotion, preserving vm_pgoff for unmap_mapping_range(), and reject non-shared MMIO mmaps as necessary through vfio-platform, vfio-fsl-mc, and vfio-cdx. These prevent future issues, though none are currently reachable. (Abdifatah Suruur)

- Fix 8-byte ioeventfd support, removing a static error test that was erroneously left in place when generalizing 8-byte io accesses. (Li RongQing)

- Fix missed RCU drain on module exit. (Jiale Yao)

- Fix off-by-one boundary check in migration support within the mlx5 vfio-pci variant driver. (Seongjun Hong)

- Remove drvdata usage convention across vfio-pci-core, allowing variant drivers to freely create their own conventions and enabling a future Rust-based variant driver. A DRM topic branch is also merged in support of this effort, modifying the vga arbiter API to more cleanly remove the drvdata dependency. (Simon Song)

- Fix hisi_acc vfio-pci variant driver to avoid NULL pointer accesses when bound to unsupported devices and also disabling migration support when running on 64K host page size due to BAR mapping constraints. (Longfang Liu)

- Add device IDs for Crescent Island and Nova Lake devices to the Xe vfio-pci variant driver. (Satyanarayana K V P)

- Fix fallback mode in nvgrace-gpu variant driver to use symmetric open and close handlers to avoid reported use-after-free issue. Remove the resulting unnecessary test in the now single-purpose open function. (Andrea Parri)

----------------------------------------------------------------
Abdifatah Suruur (7):
vfio/platform: prevent read-only region mappings from becoming writable vfio/fsl-mc: prevent read-only region mappings from becoming writable vfio/cdx: prevent read-only region mappings from becoming writable vfio/platform: keep logical vm_pgoff in MMIO region mmap vfio/fsl-mc: keep logical vm_pgoff in MMIO region mmap vfio/cdx: keep logical vm_pgoff in MMIO region mmap vfio/cdx: reject non-shared MMIO mmaps

Alex Williamson (6):
vfio: Reject a second cdev open before mutating shared device state
vfio: selftests: Extend mix_and_match timeout to 90s
vfio: selftests: Extend timeout for runner executions
Merge branch 'mlx5-vfio-selftest-v7' of https://github.com/awilliam/linux-vfio into v7.4/vfio/next
vfio: selftests: Verify a failed second open preserves the vf_token
Merge tag 'topic/pci-vgaarb-rework-2026-10-01' of https://gitlab.freedesktop.org/drm/kernel into v7.4/vfio/next

Andrea Parri (2):
vfio/nvgrace-gpu: Use a core-only open_device in fallback mode vfio/nvgrace-gpu: Drop the usemem length check in open_device

Dave Airlie (1):
PCI/VGA: pass a data pointer to be used in the decode callback (v2)

David Matlack (1):
vfio: selftests: Add documentation

Hemanth Selam (1):
vfio: fix typo "stucture" in comment

Hisam Mehboob (1):
vfio: selftests: Include <libgen.h> for basename() on non-glibc builds

Jason Gunthorpe (10):
net/mlx5: Add IFC structures for CQE and WQE
net/mlx5: Move HW constant groups from device.h/cq.h to mlx5_ifc.h net/mlx5: Extract MLX5_SET/GET macros into mlx5_ifc_macros.h net/mlx5: Add ONCE and MMIO accessor variants to mlx5_ifc_macros.h
selftests: Add additional kernel functions to tools/include/
vfio: selftests: Allow drivers to specify required region size
vfio: selftests: Add dev_dbg
vfio: selftests: Add mlx5 driver - HW init and command interface
vfio: selftests: Add mlx5 driver - data path and memcpy ops
vfio: selftests: mlx5 driver - add send_msi support

Jiale Yao (1):
vfio/pci: Drain eventfd RCU callbacks on module exit

Li RongQing (1):
vfio/pci: Restore 8-byte ioeventfd support

Longfang Liu (2):
hisi_acc_vfio_pci: fix NULL dereference in reset_prepare on PF passthrough
hisi_acc_vfio_pci: reject live migration on 64KB page with QM_HW_V3 hardware

Samuel Crossley (1):
vfio/type1: avoid walking reserved-only mappings while unpinning

Satyanarayana K V P (1):
vfio/xe: Add CRI and NVL device IDs

Seongjun Hong (1):
vfio/mlx5: Fix boundary check in set_report_output()

Simon Song (1):
vfio/pci: Remove the core dependency on driver data

 Documentation/driver-api/index.rst                 |    1 +
 Documentation/driver-api/vfio-selftests.rst        |  252 +++
 MAINTAINERS                                        |    1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c         |    9 +-
 drivers/gpu/drm/i915/display/intel_vga.c           |    7 +-
 drivers/gpu/drm/loongson/lsdc_drv.c                |    4 +-
 drivers/gpu/drm/nouveau/nouveau_vga.c              |    6 +-
 drivers/gpu/drm/radeon/radeon_device.c             |    9 +-
 drivers/pci/vgaarb.c                               |   13 +-
 drivers/vfio/cdx/main.c                            |   17 +-
 drivers/vfio/device_cdev.c                         |   12 +
 drivers/vfio/fsl-mc/vfio_fsl_mc.c                  |   15 +-
 drivers/vfio/mdev/mdev_core.c                      |    2 +-
 drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c     |   73 +-
 drivers/vfio/pci/ism/main.c                        |   19 +-
 drivers/vfio/pci/mlx5/cmd.c                        |    2 +-
 drivers/vfio/pci/mlx5/main.c                       |   13 +-
 drivers/vfio/pci/nvgrace-gpu/main.c                |   42 +-
 drivers/vfio/pci/pds/pci_drv.c                     |    8 +-
 drivers/vfio/pci/pds/vfio_dev.c                    |    5 +-
 drivers/vfio/pci/qat/main.c                        |   12 +-
 drivers/vfio/pci/vfio_pci.c                        |   33 +-
 drivers/vfio/pci/vfio_pci_core.c                   |   46 +-
 drivers/vfio/pci/vfio_pci_rdwr.c                   |    3 -
 drivers/vfio/pci/virtio/main.c                     |    8 +-
 drivers/vfio/pci/xe/main.c                         |   13 +-
 drivers/vfio/platform/vfio_platform_common.c       |   15 +-
 drivers/vfio/vfio_iommu_type1.c                    |   12 +-
 drivers/vfio/vfio_main.c                           |    7 -
 include/linux/mlx5/cq.h                            |   10 -
 include/linux/mlx5/device.h                        |  231 +--
 include/linux/mlx5/mlx5_ifc.h                      |  178 ++
 include/linux/mlx5/mlx5_ifc_macros.h               |  185 ++
 include/linux/vfio_pci_core.h                      |   41 +-
 include/linux/vgaarb.h                             |    8 +-
 tools/arch/arm64/include/asm/barrier.h             |    4 +
 tools/arch/x86/include/asm/barrier.h               |    5 +
 tools/include/asm-generic/io.h                     |   28 +
 tools/include/asm/barrier.h                        |    8 +
 tools/include/linux/stddef.h                       |   10 +
 .../selftests/kvm/include/arm64/processor.h        |    4 +-
 tools/testing/selftests/kvm/irq_test.c             |    2 -
 tools/testing/selftests/vfio/.gitignore            |    1 +
 tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c |    1 +
 tools/testing/selftests/vfio/lib/drivers/igb/igb.c |    1 +
 .../testing/selftests/vfio/lib/drivers/ioat/ioat.c |    1 +
 .../testing/selftests/vfio/lib/drivers/mlx5/mlx5.c | 1928 ++++++++++++++++++++
 .../selftests/vfio/lib/drivers/mlx5/mlx5_hw.h      |  114 ++
 .../selftests/vfio/lib/drivers/mlx5/mlx5_ifc.h     |    1 +
 .../vfio/lib/drivers/mlx5/mlx5_ifc_fpga.h          |    1 +
 .../vfio/lib/drivers/mlx5/mlx5_ifc_macros.h        |    1 +
 .../vfio/lib/drivers/nv_falcon/nv_falcon.c         |    1 +
 .../vfio/lib/include/libvfio/vfio_pci_device.h     |   11 +
 .../vfio/lib/include/libvfio/vfio_pci_driver.h     |    6 +
 tools/testing/selftests/vfio/lib/iova_allocator.c  |    7 +-
 tools/testing/selftests/vfio/lib/libvfio.mk        |    1 +
 tools/testing/selftests/vfio/lib/sysfs.c           |    1 +
 tools/testing/selftests/vfio/lib/vfio_pci_driver.c |    6 +
 tools/testing/selftests/vfio/settings              |    5 +
 .../testing/selftests/vfio/vfio_pci_driver_test.c  |    5 +-
 .../selftests/vfio/vfio_pci_sriov_uapi_test.c      |   35 +
 61 files changed, 3080 insertions(+), 420 deletions(-)
 create mode 100644 Documentation/driver-api/vfio-selftests.rst
 create mode 100644 include/linux/mlx5/mlx5_ifc_macros.h
 create mode 100644 tools/include/linux/stddef.h
 create mode 100644 tools/testing/selftests/vfio/lib/drivers/mlx5/mlx5.c
 create mode 100644 tools/testing/selftests/vfio/lib/drivers/mlx5/mlx5_hw.h
 create mode 120000 tools/testing/selftests/vfio/lib/drivers/mlx5/mlx5_ifc.h
 create mode 120000 tools/testing/selftests/vfio/lib/drivers/mlx5/mlx5_ifc_fpga.h
 create mode 120000 tools/testing/selftests/vfio/lib/drivers/mlx5/mlx5_ifc_macros.h
 create mode 100644 tools/testing/selftests/vfio/settings