<div dir="ltr"><pre><code><span style="font-family:arial,helvetica,sans-serif">I purchased a cheap £3 USB PCI card to fit into a Supermicro X11SAE-F. </span></code><code><span style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">USB card is a Belkin 5 Port USB 2.0 PCI Card 4 Int / 1 Ext Ports from <a href="http://Scan.co.uk">Scan.co.uk</a>, item number LN46145. It uses an NEC chipset.</span> The configuration of this card is proving tricky due to a duplicate assignment of device and vendors IDs as evidenced with <span style="font-family:monospace,monospace">lspci -nn</span>.</span><br></code></pre><pre><code><br><font size="2">05:01.0 USB controller [0c03]: NEC Corporation OHCI USB Controller [1033:0035] (rev 43)
05:01.1 USB controller [0c03]: NEC Corporation OHCI USB Controller [1033:0035] (rev 43)
05:01.2 USB controller [0c03]: NEC Corporation uPD72010x USB 2.0 Controller [1033:00e0] (rev 04)<br><br></font></code>1033:0035 <span style="font-family:arial,helvetica,sans-serif">specified from</span> 05:01.0 <span style="font-family:arial,helvetica,sans-serif">and</span> 05:01.1. <span style="font-family:arial,helvetica,sans-serif">If I add all of these to</span> <code>/etc/modprobe.d/vfio.conf</code> <span style="font-family:arial,helvetica,sans-serif">alongside my GPU IDs then QEMU fails to start the guest complaining it can't attach to</span> 05:01.1. <span style="font-family:arial,helvetica,sans-serif">The error is this:<br></span><br><font size="2"><span style="font-family:monospace,monospace">Error starting domain: internal error: qemu unexpectedly closed the monitor: 2017-11-16T19:58:16.522974Z qemu-system-x86_64: -chardev pty,id=charserial0: char device redirected to /dev/pts/1 (label charserial0)
2017-11-16T19:58:17.917457Z qemu-system-x86_64: -device vfio-pci,host=05:01.1,id=hostdev3,bus=pci.0,addr=0xc: vfio error: 0000:05:01.1: failed to setup INTx fd: Operation not permitted

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 125, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 82, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1505, in startup
    self._backend.create()
  File "/usr/lib/python2.7/site-packages/libvirt.py", line 1069, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error: qemu unexpectedly closed the monitor: 2017-11-16T19:58:16.522974Z qemu-system-x86_64: -chardev pty,id=charserial0: char device redirected to /dev/pts/1 (label charserial0)
2017-11-16T19:58:17.917457Z qemu-system-x86_64: -device vfio-pci,host=05:01.1,id=hostdev3,bus=pci.0,addr=0xc: vfio error: 0000:05:01.1: failed to setup INTx fd: Operation not permitted</span></font><span style="font-family:arial,helvetica,sans-serif"></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">My host OS is Arch running the <span style="font-family:monospace,monospace">linux-vfio</span> kernel for ACS support on an i7 6700k. <span style="font-family:monospace,monospace">vt-d</span> is otherwise working perfectly.<br><br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">The devices are not being grabbed by vfio-pci as I would hope at boot.<br><br></span><br><span style="font-family:arial,helvetica,sans-serif"><code>05:01.0 USB controller: NEC Corporation OHCI USB Controller (rev 43)
    Subsystem: NEC Corporation USB Controller
    Kernel driver in use: ohci-pci
    Kernel modules: ohci_pci
05:01.1 USB controller: NEC Corporation OHCI USB Controller (rev 43)
    Subsystem: NEC Corporation USB Controller
    Kernel driver in use: ohci-pci
    Kernel modules: ohci_pci
05:01.2 USB controller: NEC Corporation uPD72010x USB 2.0 Controller (rev 04)
    Subsystem: Device 0ee4:3383
    Kernel driver in use: ehci-pci
    Kernel modules: ehci_pci<br><br></code></span></pre><pre><font face="arial,helvetica,sans-serif">Following some help I received elsewhere I tried the manual approach which did successfully bind the devices to vfio-pci but I still ended up with the guest not starting due to the IRQ conflict below:<br></font><br><font face="arial,helvetica,sans-serif"><code>[   93.950195] vfio-pci 0000:05:01.0: enabling device (0000 -> 0002)
[   94.000193] vfio-pci 0000:05:01.2: enabling device (0000 -> 0002)
[   94.034477] genirq: Flags mismatch irq 17. 00000000 (vfio-intx(0000:05:01.2)) vs. 00000080 (idma64.1)
<br></code></font></pre><pre><font face="arial,helvetica,sans-serif"><code><span style="font-family:arial,helvetica,sans-serif">Manual bind steps followed:</span><br></code></font></pre><pre><br><font face="arial,helvetica,sans-serif"><code>echo 0000:05:01.0 > /sys/bus/pci/devices/0000:05:01.0/driver/unbind
echo 0000:05:01.1 > /sys/bus/pci/devices/0000:05:01.1/driver/unbind
echo 0000:05:01.2 > /sys/bus/pci/devices/0000:05:01.2/driver/unbind

echo 1033 0035 > /sys/bus/pci/drivers/vfio-pci/new_id
echo 1033 00e0 > /sys/bus/pci/drivers/vfio-pci/new_id

echo 0000:05:01.0 > /sys/bus/pci/drivers/vfio-pci/bind
echo 0000:05:01.1 > /sys/bus/pci/drivers/vfio-pci/bind
echo 0000:05:01.2 > /sys/bus/pci/drivers/vfio-pci/bind<br><br></code></font></pre><pre><font face="arial,helvetica,sans-serif"><code># lspci -k<br></code></font></pre><pre><code>05:01.0 USB controller: NEC Corporation OHCI USB Controller (rev 43)
Subsystem: NEC Corporation USB Controller
Kernel driver in use: vfio-pci
Kernel modules: ohci_pci</code><br><font face="arial,helvetica,sans-serif"><code></code></font></pre><pre><font face="arial,helvetica,sans-serif">At this point I'm fairly certain the card is garbage and unsalvageable, is it?</font><br></pre><pre><code></code></pre></div>