<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 18, 2015 at 4:14 AM, Phill Edwards <span dir="ltr"><<a href="mailto:philledwards@gmail.com" target="_blank">philledwards@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p dir="ltr">That limitation has it's reasons and exists in systems like virtualbox or hyper-v.<br>
But afaik, if you have two devices in one group, and they both are bound to vfio-pci, you can attach them to different VMs.</p></blockquote></span><div>OK, so this is what I've done. The devices PCI devices having that are in the same IOMMU group and need to be assigned to different VMs are:</div><span class=""><div><br></div><div><font face="monospace, monospace">05:00.0 Ethernet controller [0200]: Intel Corporation 82546EB Gigabit Ethernet Controller (Copper) [8086:1010] (rev 01)</font></div><div><font face="monospace, monospace">        Subsystem: Compaq Computer Corporation NC7170 Gigabit Server Adapter [0e11:00db]</font></div><div><font face="monospace, monospace">        Kernel driver in use: e1000</font></div><div><font face="monospace, monospace">05:00.1 Ethernet controller [0200]: Intel Corporation 82546EB Gigabit Ethernet Controller (Copper) [8086:1010] (rev 01)</font></div><div><font face="monospace, monospace">        Subsystem: Compaq Computer Corporation NC7170 Gigabit Server Adapter [0e11:00db]</font></div><div><font face="monospace, monospace">        Kernel driver in use: e1000</font></div><div><font face="monospace, monospace">05:02.0 Multimedia video controller [0400]: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [14f1:8800] (rev 05)</font></div><div><font face="monospace, monospace">        Subsystem: KWorld Computer Co. Ltd. KWorld/VStream XPert DVB-T [17de:08a6]</font></div><div><font face="monospace, monospace">05:02.2 Multimedia controller [0480]: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] [14f1:8802] (rev 05)</font></div><div><font face="monospace, monospace">        Subsystem: KWorld Computer Co. Ltd. KWorld/VStream XPert DVB-T [17de:08a6]</font></div><div><br></div></span><div>This PCI device also comes up in group 11 so Ive also bound this to vfio-pci:</div><div><span style="font-family:monospace,monospace;font-size:12.8px">00:1e.0 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev a4)</span><br></div><div><span style="font-family:monospace,monospace;font-size:12.8px"><br></span></div><div><span style="font-family:monospace,monospace;font-size:12.8px"><br></span></div><div><font face="arial, helvetica, sans-serif"><span style="font-size:12.8px">From what I understand the way to bind them to vfio-pci is on </span><span style="font-size:12.8px">GRUB_CMDLINE_LINUX in </span><span style="font-size:12.8px">/etc/sysconfig/grub:</span></font></div><div><span style="font-size:12.8px"><font face="monospace, monospace">GRUB_CMDLINE_LINUX="<a href="http://rd.lvm.lv" target="_blank">rd.lvm.lv</a>=centos/root <a href="http://rd.lvm.lv" target="_blank">rd.lvm.lv</a>=centos/swap rhgb quiet iommu=pt intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1 vfio-pci=8086:1010,14f1:8800,14f1:8802,8086:244e"</font></span><br></div><div><br></div><div><span style="font-size:12.8px"><font face="monospace, monospace">lsmod</font></span><span style="font-family:arial,helvetica,sans-serif;font-size:12.8px"> shows that the vfio-pci kernel module isn't loaded after booting so I have to run </span><span style="font-size:12.8px"><font face="monospace, monospace">modprobe vfio-pci</font><font face="arial, helvetica, sans-serif"> on the command line to load it. is this a problem?</font></span></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">I guess I must be doing something wrong as I'm still getting this error:</font></span></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><font face="monospace, monospace"><span style="font-size:12.8px"><div>Unable to complete install: 'internal error: process exited while connecting to monitor: 2015-09-18T10:13:29.896796Z qemu-kvm: -device vfio-pci,host=05:02.0,id=hostdev0,bus=pci.0,addr=0x8: vfio: error, group 11 is not viable, please ensure all devices within the iommu_group are bound to their vfio bus driver.</div><div>2015-09-18T10:13:29.896823Z qemu-kvm: -device vfio-pci,host=05:02.0,id=hostdev0,bus=pci.0,addr=0x8: vfio: failed to get group 11</div><div>2015-09-18T10:13:29.896835Z qemu-kvm: -device vfio-pci,host=05:02.0,id=hostdev0,bus=pci.0,addr=0x8: Device initialization failed.</div><div>2015-09-18T10:13:29.896847Z qemu-kvm: -device vfio-pci,host=05:02.0,id=hostdev0,bus=pci.0,addr=0x8: Device 'vfio-pci' could not be initialized</div></span></font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><font face="arial, helvetica, sans-serif">Aaaarrrrggggghhhh!!!! Why is this so damn difficult...</font></div></div></div></div></blockquote><div><br></div><div>I've already explained this.  It's a hardware limitation.  You cannot do what you want.  You can either assign all of the devices to a single VM or none of them to a VM.  The IOMMU cannot differentiate the devices behind the bridge in order to provide separate IOMMU translations.  Get PCIe devices if you want this sort of flexibility. </div></div></div></div>