qemu 2.4.0 hangs using vfio for pci passthrough of graphics card
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
2.3.0 (manjaro distro package) works fine. 2.4.0 (manjaro or the arch vanilla one) hangs on the SeaBIOS screen when saying "Press F12 for boot menu". All tested with the same hardware, OS, command and configuration. It also starts without the GPU passed through, even with the USB passed through. I am using the latest SeaBIOS 1.8.2.
The release notes say:
VFIO
Support for resetting AMD Bonaire and Hawaii GPUs
Platform device passthrough support for Calxeda xgmac devices
So maybe something there broke it.
I am using the arch qemu 2.4.0 PKGBUILD (modified to have make -j8 and removed iscsi, gluster, ceph, etc.), which uses vanilla sources and no patches. https:/
I am not using a frontend. I am using a script I wrote that generates the command below.
Guest OS here would be 64 bit windows 7, but it didn't start so that's not relevant. Also a Manjaro Linux VM won't start.
CPU is AMD FX-8150; board is Gigabyte GA-990FXA-UD5 (990FX chipset).
full command line (without the \ after each line) is:
qemu-system-x86_64
-enable-kvm
-M q35
-m 3584
-cpu host
-boot c
-smp 7,sockets=
-vga none
-device ioh3420,
-device vfio-pci,
-device vfio-pci,
-device vfio-pci,
-device vfio-pci,
-usb
-device ahci,bus=
-drive file=/dev/
-drive media=cdrom,
-netdev type=tap,
-device virtio-
-monitor stdio
-boot menu=on
$ lspci -nn | grep -E "04:00.
00:14.2 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) [1002:4383] (rev 40)
00:16.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller [1002:4397]
00:16.2 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller [1002:4396]
04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Bonaire XTX [Radeon R7 260X] [1002:6658]
Also I have this one that also hangs:
05:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Juniper XT [Radeon HD 6770] [1002:68ba]
no longer affects: | qemu (Gentoo Linux) |
Changed in qemu: | |
status: | New → Fix Released |
I ran a bisect, and here's the result:
b8eb5512fd8a115 f164edbbe897cdf 8884920ccb is the first bad commit f164edbbe897cdf 8884920ccb
commit b8eb5512fd8a115
Author: Nadav Amit <email address hidden>
Date: Mon Apr 13 02:32:08 2015 +0300
target-i386: disable LINT0 after reset
Due to old Seabios bug, QEMU reenable LINT0 after reset. This bug is long gone
and therefore this hack is no longer needed. Since it violates the
specifications, it is removed.
Signed-off-by: Nadav Amit <email address hidden>
Message-Id: <email address hidden>
Signed-off-by: Paolo Bonzini <email address hidden>
:040000 040000 a8ec76841b8d4e8 37c2cd0d0b82e08 c0717a0ec6 d33744231c98c9f 588cefbc92f4161 83f639706f M hw
$ git diff 7398dfc7799a500 97803db4796c7ed b6cd7d47a1 b8eb5512fd8a115 f164edbbe897cdf 8884920ccb
diff --git a/hw/intc/ apic_common. c b/hw/intc/ apic_common. c apic_common. c apic_common. c common( DeviceState *dev) >vapic_ base_update( s);
index 042e960..d38d24b 100644
--- a/hw/intc/
+++ b/hw/intc/
@@ -243,15 +243,6 @@ static void apic_reset_
info-
apic_ init_reset( dev); APIC_LVT_ LINT0] = 0x700;
-
- if (bsp) {
- /*
- * LINT0 delivery mode on CPU #0 is set to ExtInt at initialization
- * time typically by BIOS, so PIC interrupt can be delivered to the
- * processor when local APIC is enabled.
- */
- s->lvt[
- }
}
/* This function is only used for old state version 1 and 2 */
And then to confirm it:
git checkout v2.4.0 f164edbbe897cdf 8884920ccb
git revert b8eb5512fd8a115
And this build works. :)