KVM PCI Passthrough

314 views
Skip to first unread message

Nick Andre

unread,
Feb 23, 2016, 6:38:41 PM2/23/16
to wmfo-ops
Struggling a bit with this. Has anyone done this before?

I'm getting this error when I go to start the domain:

error: Failed to bind PCI device '0000:03:00.0' to vfio-pci: No such device

Looks like it's unbinding it from the host but can't bind to the vfio device? I'm also getting:

wmfo-admin@tupac:~$ dmesg | grep vfio
[ 1318.782176] vfio-pci: probe of 0000:03:00.0 failed with error -22

Not sure what that error code means.

This is the XML dump of the PCI device (there's a group of two; apparently the PCIe version is the PCI version with a PCIe=>PCI adapter lol):

wmfo-admin@tupac:~$ virsh nodedev-dumpxml pci_0000_03_00_0
<device>
  <name>pci_0000_03_00_0</name>
  <path>/sys/devices/pci0000:00/0000:00:02.2/0000:03:00.0</path>
  <parent>pci_0000_00_02_2</parent>
  <capability type='pci'>
    <domain>0</domain>
    <bus>3</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x8240'>XIO2001 PCI Express-to-PCI Bridge</product>
    <vendor id='0x104c'>Texas Instruments</vendor>
    <iommuGroup number='28'>
      <address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
      <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </iommuGroup>
  </capability>
</device>

Notice they're in a group (03 is the PCI adapter, 04 is the TI multimedia contorller). I don't know if I'm supposed to attach them together or whether I should only attach the controller? Probably depends how the driver is written.

This is with the pci device set to "managed" so qemu should be handling all the management shenanigans. I was able to follow these instructions all the way to the hotplug step but I couldn't figure out what the "guest command interface" was...

--Nick

Nick Andre

unread,
Feb 23, 2016, 7:51:53 PM2/23/16
to wmfo-ops
Still getting the EINVAL error on the vfio-pci probe of the PCIe adapter :/

Meh. Methinks the PCI adapter is problematic. Apparently there was some issue with PCI and passthrough due to the lack of tagging.

Andy Sayler

unread,
Feb 23, 2016, 8:25:50 PM2/23/16
to wmfo-ops
It's been awhile since I've mucked with PCI pass through, but a few thoughts:

+ Sometimes you have to use a special kernel to make pass through work correctly - at least on the host. Not sure if that applies here or not.
+ This is the kind of thing where you are going to want to be using the latest kernel (and maybe even user space tools). If this is still Ubuntu 14.04, make sure you're using the latest LTS kernel (i.e. linux-generic-lts-wily). And you may also want to look for PPAs for newer versions of KVM, etc. Or give 15.10 a whirl...
+ Probably a dumb question, but I assume you've enabled VT-D in the BIOS?

What are you trying to pass through? The AudioScience card?

Beyond that, I'd probably have to turn to forums/stackexchange/IRC for more help.

Maybe you've seen:


--
You received this message because you are subscribed to the Google Groups "wmfo-ops" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wmfo-ops+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andy Sayler

unread,
Feb 23, 2016, 8:27:27 PM2/23/16
to wmfo-ops
Also, you will likely need to modify the kernel command line as per the article in the previous post. I've tripped over that before.


Nick Andre

unread,
Feb 23, 2016, 8:33:40 PM2/23/16
to wmfo...@googlegroups.com
Yeah I can double check that VT-D is enabled -- kvm-ok prints that everything is set. I've added intel_iommu=on to the command line and dmesg is working. 

I want to avoid custom compiling the kernel for obvious reasons.

I'm on 3.19 I believe. 

Yeah I'll take another stab and ask stackoverflow

Nick Andre

unread,
Feb 24, 2016, 7:08:40 PM2/24/16
to wmfo...@googlegroups.com
I subscribed to the qemu-devel elist (btw RIP inbox) and basically they said you can't pass the adapter. So I tried without: 

wmfo-admin@rivendell:~$ lspci

.....

00:07.0 Multimedia audio controller: Texas Instruments TMS320C6414 TMS320C6415 TMS320C6416

!!!! It works! Love when that happens.

Nick Andre

unread,
Feb 24, 2016, 7:23:43 PM2/24/16
to wmfo...@googlegroups.com
And apparently vino encryption is largely unsupported on windows:


Day is going well...
Reply all
Reply to author
Forward
0 new messages