freenode
Desktop & Graphics

Rust VFIO PCI abstractions land with NVIDIA vGPU driver

A twelve-patch series wires nova-core SR-IOV into VFIO so NVIDIA virtual functions can be assigned to userspace.

Simon Song has posted a second revision of work that brings Rust VFIO PCI support to the kernel and pairs it with an NVIDIA vGPU variant driver built on nova-core.

The series extends earlier Rust VFIO PCI work from Zhi Wang. It adds typed PCI helpers and VFIO abstractions so a driver written in Rust can register with vfio-pci-core, manage DMA ownership, and handle reset, AER, bind, and runtime PM through a shared PCI adapter rather than a one-off path. VFIO then exposes the PCI device to userspace as usual.

On top of that stack, an NVIDIA-specific VFIO variant uses nova-core's typed SR-IOV physical-function interface to create, reset, and release vGPU instances. Nova identifies each instance by the virtual function's index on its PF. The variant matches NVIDIA devices via a VFIO override-only ID so userspace can select it for assignment; devices without an available Nova vGPU interface fall back to ordinary PCI passthrough. First open creates the instance, last close tears it down, and firmware reset is coordinated with PCI reset while the assigned BAR1 aperture is enforced.

Danilo Krummrich contributed core pieces of the Rust PCI and VFIO layer, including override-only VFIO device IDs, VF index lookup on bound devices, and the DMA-management flag VFIO variants need. Song's v2 folds reset, bind, AER, and runtime-PM callbacks into the shared PCI adapter and drops a duplicate VFIO-only adapter, so variant drivers reuse one registration path.

The practical result is a Rust path from nova-core-managed NVIDIA VFs into VFIO, aimed at assigning those vGPUs cleanly to userspace and virtual machines without bolting a second PCI callback stack onto the driver.