Pcornel
Virtualization · PCI & Device Passthrough

VFIO

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

Back to the Topic

Answer

VFIO is the Linux kernel framework that safely hands PCI devices to user space, which QEMU/KVM uses for passthrough. Bind the device to vfio-pci (by vendor:device ID) so the host driver releases it before the VM starts.

Remember

  • Bind early to avoid host driver claiming it.
  • Use vendor:device IDs.
  • Blacklist conflicting drivers if needed.

First checks

  • lsmod | grep vfio — VFIO modules
  • lspci -nnk | grep -B2 vfio-pci — devices bound
  • cat /etc/modprobe.d/vfio.conf — ids= binding

Verify in this order

device → vfio-pci → QEMU → guest

Where it usually breaks

First mismatch in host capability/IOMMU/NUMA → hypervisor allocation/mapping → virtual hardware model → guest driver/enumeration → workload use; preserve identity/native error/pre-state before mutation.

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

Confirmation

Confirm action

Continue?