Pcornel
Virtualization · KVM / QEMU

VFIO

Cheat sheet · https://pcornel.dk/topic.php?topic=3802

Back to the Topic

Answer

VFIO is the Linux framework that gives a VM direct, secure access to a physical PCI device such as a GPU or NIC. It uses the IOMMU to isolate the device's memory access; every device in the same IOMMU group must be passed through together.

Remember

  • VFIO driver bound ≠ IOMMU group safe to assign.
  • IOMMU group ≠ individual PCI function when hardware topology groups devices together.
  • VFIO ownership ≠ guest driver loaded.
  • VFIO migration capability is device and QEMU/kernel dependent, not universal.

First checks

  • lspci -nnk | grep -B2 vfio-pci — bound devices
  • cat /etc/modprobe.d/vfio.conf — ids binding
  • dmesg | grep -i vfio — errors

Verify in this order

device → vfio-pci → QEMU

Where it usually breaks

First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.

KVM / QEMU → VFIO reference map

BoundaryWhat to verifyEvidence limit
Definition/configExpected KVM / QEMU → VFIO definition or configuration is presentConfigured state does not prove runtime behavior
RuntimeRelevant KVM/QEMU/libvirt object or process is active without matching errorsRuntime state does not prove dependencies or guest outcome
DependencyHost CPU/memory, storage, network or device backend required by this path is healthyLocal success does not prove the next boundary
AcceptanceOriginal guest/application test succeeds after the change or observationRequired for end-to-end closure

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3802

Confirmation

Confirm action

Continue?