PCI passthrough doesn't survive host reboot

philled

Renowned Member
May 25, 2015
36
1
73
I have got PCI passthrough running on one of my VMs - a MythBuntu installation (MythTV on Ubuntu 14.04). The PCI device is a DVB-T tuner card. There appear to be 2 PCI devices when you run lspci:
05:02.0 Multimedia video controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
05:02.2 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05)

However, I've found that to get the tuner card working I put this entry in the vm.conf file:
hostpci0: 05:02.2

This is working fine. HOWEVER, when I reboot the Proxmox host the VM won't boot up as it encounters a PCI issue:
kvm: -device pci-assign,host=05:02.2,id=hostpci0,bus=pci.0,addr=0x10: Failed to assign irq for "hostpci0"
Perhaps you are assigning a device that shares an IRQ with another device?: Input/output error
kvm: -device pci-assign,host=05:02.2,id=hostpci0,bus=pci.0,addr=0x10: Device initialization failed.
kvm: -device pci-assign,host=05:02.2,id=hostpci0,bus=pci.0,addr=0x10: Device 'kvm-pci-assign' could not be initialized


I can fix this if I follow this process:
go into the vm.conf file and edit the hostpci0 setting --> boot the vm --> boot fails --> edit the hostpci0 setting back to what it should be --> boot --> success.

How weird is that? What on earth is going on here? Is there some problem initialising the PCI card on boot or something? How can I fix this as having the machine fail on rebooting the host is a show-stopper?
 
I've found the answer to this. I blacklisted the following modules in /etc/modprobe.d/blacklist.conf:

blacklist cx88xx
blacklist cx8800
blacklist cx8802
blacklist cx88_dvb

I think the Proxmox host was loading the modules which meant the guest VM couldn't use them.