3

I want to try PCI passthrough. I have passed an old capture video card to a Windows XP guest.

IOMMU is enabled;
vfio_pci is loaded

I run this command:

virsh nodedev-detach pci_0000_05_05_0

lspci -s 00:05 -v

It reports vfio is "running" the PCI device, but when I start XP with PCI devices, it gives me back this error:

Please ensure all devices within the iommu_group are bound to their vfio bus driver.

What did I get wrong?

karel
  • 1,961
  • 2
  • 17
  • 26
elbarna
  • 12,050
  • 22
  • 92
  • 170

1 Answers1

5

I found the solution. First the IOMMU group must be identified; in my case is 11(I found it using lspci and reading pci address,in my case it is 05:05:0)

find /sys/kernel/iommu_groups/ -type l|grep \/11
/sys/kernel/iommu_groups/11/devices/0000:00:14.4
/sys/kernel/iommu_groups/11/devices/0000:05:06.0
/sys/kernel/iommu_groups/11/devices/0000:05:05.0

So we have to add 05:05 and 05:06 (the two PCI cards of the group) to qemu,with libvirt. This is easy using virt-manager add hardware, selecting pci host. Now we boot and..another error appears in dmesg:

"Flags mismatch irq 21. 00000000 (vfio-intx(0000:05:05.0)) vs. 0000000....usb...."

This means our system cannot share interrupts, so we have to remove the device from the host.

So we have to find the interrupts:

cat /proc/interrupts | grep 21

It return for example usb2, so we search for usb dir:

find  /sys/devices/pci0000\:00/0000\:00\:* -iname usb2

,go to usb dir,in my case 13.2:

cd /sys/devices/pci0000\:00/0000\:00\:13.2/

and remove(sic!) from the host:

echo -n 1 > remove

Now when starting the guest,the pci cards are assigned to it.

And for return to us? I will add answer...if I find the solution!

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
elbarna
  • 12,050
  • 22
  • 92
  • 170