[vfio-users] passthrough usb controler pci-e card ?

Alex Williamson alex.williamson at redhat.com
Fri Jan 15 17:59:13 UTC 2016


A couple comments, first, boot time pre-binding to vfio-pci is really
only necessary for devices where the native host drivers behave poorly
if you take the device away from them later.  This is why we do it for
GPUs and their companion sound device, host GPU drivers don't like to
give up the device, it plays poorly with any sort of graphics on the
host, and sequestering the audio device prevents host tools from
getting confused (and there are some bugs in the audio driver limiting
number of attach/detach cycles iirc).

For anything else, you can dynamically unbind the device from the host
driver, bind it to vfio while the VM is running, and give it back to
the host on shutdown.  libvirt will do this automatically for you if
your XML sets managed='yes' for the <hostdev> device.  This is the default, so if you use virt-manager to add the device, just select Add Hardware -> PCI Host Device -> select device -> Finish.  Done.  If for some reason you don't want the device flopping back and forth between host and guest, just run 'virsh nodedev-detach pci_0000_xx_yy_z' at bootup where xx_yy_z is the PCI bus (xx), device (yy), and function (z) numbers, the same as in lspci.  You can adopt some of the GPU methods for doing this if you want it to happen earlier as well, there are lots of ways to do this with modprobe.d (install options, softdep, etc..)

Finally, yes I've seen OVMF hang with some crappy USB controllers.  I'm
not sure if it's dependent on the devices attached or the controller
itself, but cheaper isn't always better when it comes to selecting
devices to use with device assignment.  Thanks,

Alex




More information about the vfio-users mailing list