<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 7, 2016 at 10:34 AM, Stein van Broekhoven <span dir="ltr"><<a href="mailto:stein@aapjeisbaas.nl" target="_blank">stein@aapjeisbaas.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear All,<br>
<br>
I can't get the video card which is using vfio to connect to my vm:<br>
lspci -nnk<br>
06:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Turks XT [Radeon HD 6670/7670] [1002:6758]<br>
        Subsystem: ASUSTeK Computer Inc. Device [1043:03ea]<br>
        Kernel driver in use: vfio-pci<br>
        Kernel modules: radeon, fglrx<br>
06:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Turks/Whistler HDMI Audio [Radeon HD 6000 Series] [1002:aa90]<br>
        Subsystem: ASUSTeK Computer Inc. Device [1043:aa90]<br>
        Kernel driver in use: vfio-pci<br>
        Kernel modules: snd_hda_intel<br>
<br>
I start the vm from cli with qemu command with sudo<br>
The devices 06:00.0 and 06:00.1 are together in group 22<br>
I added /dev/vfio/22 to acl in qemu config<br></blockquote><div><br></div><div>You should never need to touch this acl list, besides it's for libvirt which you're not using if you're using the qemu command.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When using vfio_iommu_type1.allow_unsafe_interrupts=1 on start vm I get the error:<br>
stdout:<br>
qemu-system-x86_64: -device vfio-pci,host=06:00.0,addr=09.0,multifunction=on: vfio: Error: Failed to setup INTx fd: Device or resource busy<br>
qemu-system-x86_64: -device vfio-pci,host=06:00.0,addr=09.0,multifunction=on: Device initialization failed<br>
dmesg:<br>
genirq: Flags mismatch irq 55. 00000080 (vfio-intx(0000:06:00.0)) vs. 00000800 (fglrx[1]@PCI:6:0:0)<br>
<br>
Without vfio_iommu_type1.allow_unsafe_interrupts=1 on start vm I get the error:<br>
stdout:<br>
vfio: failed to set iommu for container: Operation not permitted<br>
dmesg:<br>
vfio_iommu_type1_attach_group: No interrupt remapping support.  Use the module param "allow_unsafe_interrupts" to enable VFIO IOMMU support on this platform<br>
<br>
system:<br>
sabertooth 990FX v1.1<br>
AMD FX-8120<br>
main GPU: Radeon HD 5xxx<br>
VM GPU: Radeon HD 6xxx<br>
Manjaro (arch) kernel 4.1<br></blockquote><div><br></div><div>looks like fglrx is still holding onto the IRQ and there's a flags mismatch, you should prevent fglrx from claiming the GPU by using pci-stub or vfio-pci to claim the device directly.  990FX should support interrupt remapping, so it's likely not enabled in your kernel. </div></div></div></div>