Skip to content

Tool to help bind a PCI device and its IOMMU group to the VFIO driver.

License

Notifications You must be signed in to change notification settings

marcelo-gonzalez/vfio-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tool to help bind a PCI device and its IOMMU group to the VFIO driver.

For example, to bind the PCI device backing a network interface to the
VFIO driver for use in a VM via passthrough:

# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff
#
# su
# modprobe vfio-pci
# vfio-config bind eth0
eth0 => 0000:05:00.0
0000:05:00.0 now bound to vfio-pci
0000:08:00.0 now bound to vfio-pci
0000:01:00.0 now bound to vfio-pci
0000:06:00.0 now bound to vfio-pci
0000:01:00.1 now bound to vfio-pci


Now passthrough should be possible:

# qemu-system-x86_64 -enable-kvm -hda ~/my.img -kernel ~/linux/arch/x86/boot/bzImage \
  -append "root=/dev/foo rw" -device vfio-pci,host=05:00.0 -nic none

To reset the group just bound:

# vfio-config reset --group 0000:05:00.0
Removed 0000:05:00.0
Removed 0000:08:00.0
Removed 0000:01:00.0
Removed 0000:06:00.0
Removed 0000:01:00.1
Issued PCI bus rescan

About

Tool to help bind a PCI device and its IOMMU group to the VFIO driver.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published