Skip to content

Regression: QEMU 8.2.0 VFIO GPU guests cannot reboot due to improper reset

Host environment

  • Operating system: Arch Linux (up to date)
  • OS/kernel version: 6.6.8
  • Architecture: x86_64
  • QEMU flavor: qemu-system-x86_64
  • QEMU version: 8.2.0
  • QEMU command line:
    ./qemu-system-x86_64 -name Windows,debug-threads=on -machine q35,accel=kvm,kernel_irqchip=on,vmport=off,mem-merge=off,nvdimm=on -cpu host,kvm=off,vendor=GenuineIntel,vmware-cpuid-freq=on,-hypervisor,+invtsc,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff,hv_vpindex,hv_runtime,hv_crash,hv_time,hv_synic,hv_stimer,hv_tlbflush,hv_ipi,hv_reset,hv_frequencies,hv_avic,hv_stimer_direct,hv_xmm_input,hv_tlbflush_ext,hv_vendor_id=Verequies -smp sockets=1,dies=1,cores=4,threads=2 -m size=32G -overcommit cpu-pm=on,mem-lock=on -fw_cfg opt/ovmf/X-PciMmio64Mb,string=65536 -nodefaults -display none -enable-kvm -msg timestamp=on -rtc base=localtime,clock=host,driftfix=none -boot menu=off,strict=on -global kvm-pit.lost_tick_policy=discard -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=0 -drive file=/VM/OVMF/VM_CODE.fd,if=pflash,format=raw,unit=0,readonly=on -drive file=/VM/OVMF/VM_VARS.fd,if=pflash,format=raw,unit=1 -smbios type=0,vendor='American Megatrends Inc.',version="1620",date="07/08/2021",release="20220807000000.000000+000",uefi="on" -smbios type=1,manufacturer="ASUS",product="PRIME H470-PLUS",version="Rev 1.xx",serial="redacted",uuid="redacted",sku="SKU",family="To be filled by O.E.M." -smbios type=2,manufacturer="ASUSTeK COMPUTER INC.",product="PRIME H470-PLUS",version="Rev 1.xx",serial="redacted",asset="Default string",location="Default string" -smbios type=3,manufacturer="ASUSTeK COMPUTER INC.",serial="redacted",version="Rev 1.xx",asset="Default string",sku="SKU" -smbios type=4,manufacturer="Intel(R) Corporation",version="Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz" -smbios type=17,manufacturer="Corsair",serial="redacted",asset="redacted",part="CMK32GX4M2A2400C14",loc_pfx="ChannelA-DIMM1",bank="BANK 0",speed=2666 -device isa-applesmc,osk="redacted" -audiodev driver=pa,server=/run/user/9999/pulse/native,in.mixing-engine=off,out.mixing-engine=off,timer-period=2500,in.buffer-length=10000,out.buffer-length=10000,id=pulse -object memory-backend-file,share=on,size=256M,mem-path=/tmp/VM-Looking-Glass-Memory-Windows,id=ivshmem -device pcie-root-port,chassis=1,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=01.0,id=pcie-root-port-1 -device vfio-pci-nohotplug,host=03:00.0,bus=pcie-root-port-1,addr=00.0,multifunction=on,x-pci-vendor-id=0x1002,x-pci-device-id=0x73a5,x-pci-sub-vendor-id=0x1849,x-pci-sub-device-id=0x5230,id=host-device-0 -device vfio-pci-nohotplug,host=03:00.1,bus=pcie-root-port-1,addr=00.1,x-pci-vendor-id=0x1002,x-pci-device-id=0xab28,x-pci-sub-vendor-id=0x1002,x-pci-sub-device-id=0xab28,id=host-device-1 -device pcie-root-port,chassis=3,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=03.0,id=pcie-root-port-3 -object iothread,id=iothread-0 -object iothread,id=iothread-1 -device virtio-blk-pci,drive=virtio-blk-disk-0,bus=pcie-root-port-3,addr=00.0,bootindex=1,iothread=iothread-0,num-queues=8,id=virtio-pci-blk-0 -drive file=/dev/sdb,format=raw,if=none,discard=unmap,detect-zeroes=unmap,cache=none,aio=native,id=virtio-blk-disk-0 -device pcie-root-port,chassis=4,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=04.0,id=pcie-root-port-4 -device ich9-ahci,bus=pcie-root-port-4,addr=00.0,id=ich9-ahci-1 -drive file=/VM/ISOs/virtio-win-0.1.240.iso,format=raw,if=none,media=cdrom,readonly=on,id=sata-cd-0 -device ide-cd,bus=ich9-ahci-1.0,drive=sata-cd-0 -drive file=/VM/ISOs/Windows.iso,format=raw,if=none,media=cdrom,readonly=on,id=sata-cd-1 -device ide-cd,bus=ich9-ahci-1.1,drive=sata-cd-1 -device pcie-root-port,chassis=5,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=05.0,id=pcie-root-port-5 -device qemu-xhci,bus=pcie-root-port-5,addr=00.0,id=usb-xhci-0 -object input-linux,id=kbd1,evdev=/dev/input/by-id/usb-event-kbd,grab_all=on,repeat=on,grab-toggle=alt-alt -object input-linux,id=mouse1,evdev=/dev/input/by-id/usb-event-mouse -device usb-mouse,bus=usb-xhci-0.0,port=1,id=usb-tablet-0 -device usb-kbd,bus=usb-xhci-0.0,port=2,id=usb-kbd-0 -device pcie-root-port,chassis=6,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=06.0,id=pcie-root-port-6 -device vfio-pci-nohotplug,host=0a:00.0,bus=pcie-root-port-6,addr=00.0,x-pci-vendor-id=0x1b73,x-pci-device-id=0x1100,x-pci-sub-vendor-id=0x1b73,x-pci-sub-device-id=0x1100,id=host-device-3 -device pcie-root-port,chassis=7,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=07.0,id=pcie-root-port-7 -device ich9-intel-hda,bus=pcie-root-port-7,addr=00.0,id=ich9-intel-hda-0 -device hda-duplex,bus=ich9-intel-hda-0.0,cad=0,audiodev=pulse -device pcie-root-port,chassis=8,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=08.0,id=pcie-root-port-8 -netdev bridge,br=VM-Bridge,id=host-network-0 -device virtio-net-pci,netdev=host-network-0,mac=00:00:00:00:00:00,bus=pcie-root-port-8,addr=00.0 -device pcie-root-port,chassis=9,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=09.0,id=pcie-root-port-9 -netdev bridge,br=VM-Local,id=host-network-1 -device virtio-net-pci,netdev=host-network-1,mac=00:00:00:00:00:00,bus=pcie-root-port-9,addr=00.0 -device pcie-root-port,chassis=10,x-speed=16,x-width=16,hotplug=off,bus=pcie.0,addr=0A.0,id=pcie-root-port-10 -device ivshmem-plain,memdev=ivshmem,bus=pcie-root-port-10,addr=00.0,id=ivshmem-0 -chardev socket,id=monitor-0,path=/tmp/VM-Monitor,server=on,wait=off -mon chardev=monitor-0 -chardev socket,id=chrtpm,path=/VM/swtpm -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 -pidfile /run/VM-redacted.pid>>/VM/VM.log 2>>/VM/VM.log
    

Emulated/Virtualized environment

  • Operating system: Windows 11 Enterprise 23H2
  • Architecture: x86_64

Description of problem

Prior to QEMU 8.2.0 (i.e. 8.1.4), rebooting the guest with VFIO GPU passed through would result in a proper reboot. After updating to QEMU 8.2.0, rebooting the guest results in a black screen due to improper reset behaviour. I was able to narrow this down to commit #3d779aba. Compiling and running with commit #0bddd880 results in the correct behaviour. That is, the GPU properly resets on guest reboot and boots successfully to Windows.

Steps to reproduce

  1. Update to QEMU 8.2.0
  2. Boot Windows 11 23H2
  3. Reboot
  4. Notice a black screen

Additional information

Edited by Hamish Claxton
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information