Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

VFIO · PCI & Device Passthrough

Direct 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.

When to use this

Use this when binding a Linux host device to vfio-pci for KVM passthrough.

First 30 seconds

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.

Operational verification

device → vfio-pci → QEMU → guest

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
virtualization-hardware
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformvirtualization-hardware
Scope / prerequisiteUse this when binding a Linux host device to vfio-pci for KVM passthrough.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Common mistakes Narrow the fault
  • Device not bound to vfio-pci before the host driver claims it.
  • Missing vfio modules in the initramfs.
Evidence references

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.

observation · 1
Key points
  • Bind early to avoid host driver claiming it.
  • Use vendor:device IDs.
  • Blacklist conflicting drivers if needed.
Key checks
  • lsmod | grep vfio — VFIO modules
  • lspci -nnk | grep -B2 vfio-pci — devices bound
  • cat /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).

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docvirtualization-hardware current

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%
Confirmation

Confirm action

Continue?