Use this when binding a Linux host device to vfio-pci for KVM passthrough.
VFIO · PCI & Device Passthrough
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.
1. VFIO is the Linux framework for safe userspace device access.
2. Bind devices with vfio-pci ids=vendor:device.
3. Load early (initramfs) to beat host drivers.
4. Blacklist host driver if needed.
5. Check dmesg | grep vfio.
device → vfio-pci → QEMU → guest
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Device not bound to
vfio-pcibefore the host driver claims it. - Missing
vfiomodules in the initramfs.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Bind early to avoid host driver claiming it.
- Use vendor:device IDs.
- Blacklist conflicting drivers if needed.
lsmod | grep vfio— VFIO moduleslspci -nnk | grep -B2 vfio-pci— devices boundcat /etc/modprobe.d/vfio.conf— ids= binding
ReferenceWhy it matters1 section · depth on demand
In depth
VFIO is the Linux framework that exposes devices to user space (QEMU) safely using the IOMMU. The vfio-pci driver claims the device, QEMU maps its BARs and DMA into the guest, and interrupts are delivered via eventfds/posted interrupts.
lsmod | grep vfio
ls /dev/vfio/ # one node per assigned IOMMU group
driverctl set-override 0000:01:00.0 vfio-pci # persistent bind (driverctl)
VFIO also underlies mediated devices (vfio-mdev) used for vGPU and SR-IOV VF assignment.
ReferenceImportant terms & boundaries2 sections · depth on demand
Commands
lspci -nnk | grep -A3 -i vga
dmesg | grep -i vfio
ls /dev/vfio/
Kernel driver in use: vfio-pci confirms the device is reserved for passthrough.
What VFIO does
VFIO is the Linux framework that lets user space (QEMU) safely own a PCI device: the IOMMU maps the device's DMA only to the VM's memory, and interrupts are remapped. Without an IOMMU, VFIO refuses the device (unless unsafe modes are forced).
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in PCI & Device Passthrough → VFIO. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.kernel.org/driver-api/vfio.html · confidence 94%