2.6.0 hangs linux vm using vfio for pci passthrough of graphics card
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Not a duplicate of my old bug 1488363
qemu version 2.5.1 works fine
qemu version 2.6.0 fails
seabios 1.9.2-1
using kernel 4.5.5 with grsecurity
I built using the arch packaging tools, but commented out all the patch code, so it should be vanilla.
The problem is just that I start a Linux vm using either my radeon R7 260x or radeon HD 6770, and with qemu 2.6.0, it looks normal until after the grub menu, and then the screen looks broken (with mostly black, and some pixely junk spread horizontally in a few places on the screen... first we thought maybe the monitor died). I'm not sure if it's before or only at the moment where the screen resolution changes (I could check that or record it on request). Also, the VM is not pingable and does not respond to "system_powerdown" on qemu monitor.
However, the same setup works fine with windows 8. And it works fine without graphics cards passed through. A usb controller passed through works fine too.
And then I ran a bisect...
commit 2d82f8a3cdb276b
Author: Alex Williamson <email address hidden>
Date: Thu Mar 10 09:39:08 2016 -0700
Match common vfio code with setup, exit, and finalize functions for
BAR, quirk, and VGA management. VGA is also changed to dynamic
:040000 040000 0acfd49b6ecae78
then confirm it by reverting that commit
git checkout v2.6.0
git revert 2d82f8a3cdb276b
git mergetool -t kdiff3
"select all from C", save
not sure if this is the right way to do this...but it compiles and works (bug fixed)
git commit -m "revert 2d82f8a3cdb276b
And that 2.6.0 build with that one patch reverted works fine.
And here's the qemu command (missing \ at the end of the lines)
qemu-system-x86_64 1,cores= 8,threads= 1 bus=pcie. 0,addr= 1c.0,port= 1,chassis= 1,id=root. 1 host=05: 00.0,bus= root.1, multifunction= on,x-vga= on,addr= 0.0,romfile= /mnt/archive/ software/ vgarom/ Sapphire. HD6770. 1024/Sapphire. HD6770. 1024.120105. rom host=00: 13.0,bus= pcie.0 host=00: 13.2,bus= pcie.0 pcie.0, id=ahci ssd/manjaro- a,id=disk1, format= raw,if= virtio, index=0, media=disk, discard= on archive/ software/ manjaro/ manjaro- net-0.8. 12-openrc- x86_64. iso,id= isocd1, index=2, media=cdrom isocd2, index=3, media=cdrom id=cdrom, index=5, media=cdrom id=net0, ifname= tap-7a net-pci, netdev= net0,mac= 00:01:02: 03:04:05
-enable-kvm
-M q35
-m 3584
-cpu host
-boot c
-smp 8,sockets=
-vga none
-device ioh3420,
-device vfio-pci,
-device vfio-pci,
-device vfio-pci,
-usb
-device ahci,bus=
-drive file=/dev/
-drive file=/mnt/
-drive file=,id=
-drive media=cdrom,
-netdev type=tap,
-device virtio-
-monitor stdio
-boot menu=on
-vnc :12