GVTd not working (black screen) after upgrade to qemu-5.0.0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
New
|
Undecided
|
Unassigned |
Bug Description
Hi QEMU team,
=== Problem Summary ===
I have recently upgraded from QEMU-3.1.0 to to QEMU-5.0.0 on Debian Unstable. Unfortunately GVTd (legacy passthrough of the integrated intel gpu) stopped working correctly. The guest can still see and loads the driver for the GPU, but the screen stays black.
The following is the version used:
$ /usr/bin/
QEMU emulator version 5.0.0 (Debian 1:5.0-5)
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers
=== Investigation/
Running QEMU with trace flags enabled shows the following behavior change for the same VM (left: 3.1.0, right: 5.0.0):
vfio_realize (0000:00:02.0) group 1 vfio_realize (0000:00:02.0) group 1
vfio_listener_
vfio_listener_
vfio_listener_
vfio_listener_
vfio_listener_
vfio_listener_
vfio_listener_
vfio_listener_
vfio_mdev (0000:00:02.0) is_mdev 0 vfio_mdev (0000:00:02.0) is_mdev 0
vfio_get_device Device 0000:00:02.0 flags: 3, regions: 12, irqs: 5 vfio_get_device Device 0000:00:02.0 flags: 3, regions: 12, irqs: 5
vfio_region_setup Device 0000:00:02.0, region 0 "0000:00:02.0 BAR 0", flags: 0x7, offset: 0x0, s vfio_region_setup Device 0000:00:02.0, region 0 "0000:00:02.0 BAR 0", flags: 0x7, offset: 0x0, s
vfio_region_setup Device 0000:00:02.0, region 1 "0000:00:02.0 BAR 1", flags: 0x0, offset: 0x1000 vfio_region_setup Device 0000:00:02.0, region 1 "0000:00:02.0 BAR 1", flags: 0x0, offset: 0x1000
vfio_region_setup Device 0000:00:02.0, region 2 "0000:00:02.0 BAR 2", flags: 0x7, offset: 0x2000 vfio_region_setup Device 0000:00:02.0, region 2 "0000:00:02.0 BAR 2", flags: 0x7, offset: 0x2000
vfio_region_setup Device 0000:00:02.0, region 3 "0000:00:02.0 BAR 3", flags: 0x0, offset: 0x3000 vfio_region_setup Device 0000:00:02.0, region 3 "0000:00:02.0 BAR 3", flags: 0x0, offset: 0x3000
vfio_region_setup Device 0000:00:02.0, region 4 "0000:00:02.0 BAR 4", flags: 0x3, offset: 0x4000 vfio_region_setup Device 0000:00:02.0, region 4 "0000:00:02.0 BAR 4", flags: 0x3, offset: 0x4000
vfio_region_setup Device 0000:00:02.0, region 5 "0000:00:02.0 BAR 5", flags: 0x0, offset: 0x5000 vfio_region_setup Device 0000:00:02.0, region 5 "0000:00:02.0 BAR 5", flags: 0x0, offset: 0x5000
vfio_populate_
0x1000, offset: 0x70000000000, flags: 0x3 0x1000, offset: 0x70000000000, flags: 0x3
vfio_region_mmap Region 0000:00:02.0 BAR 0 mmaps[0] [0x0 - 0xffffff] vfio_region_mmap Region 0000:00:02.0 BAR 0 mmaps[0] [0x0 - 0xffffff]
vfio_region_mmap Region 0000:00:02.0 BAR 2 mmaps[0] [0x0 - 0xfffffff] vfio_region_mmap Region 0000:00:02.0 BAR 2 mmaps[0] [0x0 - 0xfffffff]
vfio_check_pm_reset 0000:00:02.0 Supports PM reset vfio_check_pm_reset 0000:00:02.0 Supports PM reset
vfio_msi_setup 0000:00:02.0 PCI MSI CAP @0xac vfio_msi_setup 0000:00:02.0 PCI MSI CAP @0xac
vfio_check_pcie_flr 0000:00:02.0 Supports FLR via PCIe cap vfio_check_pcie_flr 0000:00:02.0 Supports FLR via PCIe cap
vfio_get_dev_region 0000:00:02.0 index 9, 80008086/18 <
vfio_get_dev_region 0000:00:02.0 index 9, 80008086/18 <
vfio_get_dev_region 0000:00:02.0 index 10, 80008086/28 <
vfio_get_dev_region 0000:00:02.0 index 9, 80008086/18 <
vfio_get_dev_region 0000:00:02.0 index 10, 80008086/28 <
vfio_get_dev_region 0000:00:02.0 index 11, 80008086/38 <
vfio_listener_
vfio_listener_
vfio_listener_
vfio_pci_
vfio_pci_
vfio_pci_
vfio_pci_
vfio_intx_
vfio_intx_enable (0000:00:02.0) vfio_intx_enable (0000:00:02.0)
0x100, offset: 0x70000000000, flags: 0x3 0x100, offset: 0x70000000000, flags: 0x3
vfio_populate_
vfio_pci_reset (0000:00:02.0) vfio_pci_reset (0000:00:02.0)
vfio_intx_
vfio_region_
vfio_region_
vfio_region_
vfio_intx_disable (0000:00:02.0) vfio_intx_disable (0000:00:02.0)
vfio_pci_
vfio_listener_
vfio_listener_
vfio_listener_
vfio_pci_reset_flr 0000:00:02.0 FLR/VFIO_
vfio_intx_enable (0000:00:02.0) vfio_intx_enable (0000:00:02.0)
vfio_listener_
vfio_listener_
vfio_listener_
vfio_listener_
vfio_listener_
We can see here, the following key lines are not printed in 5.0.0:
vfio_pci_
vfio_pci_
vfio_pci_
vfio_pci_
Looking through the code and bisecting the problem (I can provide more detail if helpful), shows the following ifdef statement lines introduce the problem:
https:/
1246 void vfio_bar_
1247 {
1248 vfio_probe_
1249 vfio_probe_
1250 vfio_probe_
1251 vfio_probe_
1252 vfio_probe_
1253 #ifdef CONFIG_VFIO_IGD
1254 vfio_probe_
1255 #endif
1256 }
This was added by the following commits:
Reading through the commit message, I suspect the something may be happening with the Kconfig switches mentioned there.
=== Validation/
I have rebuilt the package with the following two changes:
root@debian:
0a1
> #define CONFIG_VFIO_IGD y
root@debian:
42c42
< default y if PC_PCI
---
> default y
root@debian:
GVTd started working fine again (Screen shows output again).
I have tried with either change alone:
- with only the ifdef in pci-quirks.c compilation fails with linker errors
- with only the Kconfig it compiles, but GVTd still does not work (black screen)
Please take a look and thank you very much for a fantastic product!
TheCatFelix
summary: |
- GVTd not working after upgrade to qemu-5.0.0 + GVTd not working (black screen) after upgrade to qemu-5.0.0 |
I've also posted the bug and fix here:
https:/ /bugs.launchpad .net/qemu/ +bug/1882784
I may be wrong but Legacy IGD assignment doesn't use GVT-g or GVT-d, which is why I missed this ticket when reporting my own.