Installation guide

Chapter 12.
107
PCI passthrough
This chapter covers using PCI passthrough with KVM.
Certain hardware platforms allow virtualized guests to directly access various hardware devices and
components. This process in virtualization is known as passthrough. Passthrough is known as device
assignment in some of the KVM documentation and the KVM code.
The KVM hypervisor supports attaching PCI devices on the host system to virtualized guests.
PCI passthrough allows guests to have exclusive access to PCI devices for a range of tasks. PCI
passthrough allows PCI devices to appear and behave as if they were physically attached to the guest
operating system. PCI passthrough can improve the I/O performance of devices attached to virtualized
guests.
Almost all PCI and PCI Express devices that support passthrough, except for graphics cards, can be
directly attached to virtualized guests with PCI passthrough.
PCI passthrough is only available on hardware platforms supporting either Intel VT-d or AMD IOMMU.
These Intel VT-d or AMD IOMMU extensions must be enabled in BIOS for PCI passthrough to
function.
Red Hat Enterprise Linux 6.0 and newer supports hot plugging PCI passthrough devices into
virtualized guests.
Out of the 32 available PCI devices for a guest 4 are not removable. This means there are only 28
PCI slots available for additional devices per guest. Every para-virtualized network or block device
uses one slot. Each guest can use up to 28 additional devices made up of any combination of para-
virtualized network, para-virtualized disk devices, or other PCI devices using VT-d.
Procedure 12.1. Preparing an Intel system for PCI passthrough
1. Enable the Intel VT-d extensions
The Intel VT-d extensions provides hardware support for directly assigning a physical devices to
guest.
The VT-d extensions are required for PCI passthrough with Red Hat Enterprise Linux. The
extensions must be enabled in the BIOS. Some system manufacturers disable these extensions
by default.
These extensions are often called various terms in BIOS which differ from manufacturer to
manufacturer. Consult your system manufacturer's documentation.
2. Activate Intel VT-d in the kernel
Activate Intel VT-d in the kernel by appending the intel_iommu=on parameter to the kernel line
of the kernel line in the /boot/grub/grub.conf file.
The example below is a modified grub.conf file with Intel VT-d activated.
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-36.x86-645)
root (hd0,0)
kernel /vmlinuz-2.6.32-36.x86-64 ro root=/dev/VolGroup00/LogVol00 rhgb
quiet intel_iommu=on
initrd /initrd-2.6.32-36.x86-64.img