Skip to content

Qemu/WHPX fails on applying UEFI firmware with -pflash

With Qemu 6.0.91 and previous releases (tested down to 5.1), Qemu fails reproducably when attaching a UEFI firmware with -pflash. Attaching firmware with ´-bios´ works for UEFI firmware in https://www.qemu-advent-calendar.org/2014/download/qemu-xmas-uefi-zork.tar.xz.

Qemu 6.0.91 was compiled for Windows with Msys2. See https://github.com/msys2/MINGW-packages/pull/9201/checks for artifacts.

Failures can be reproduced with Qemu distribution https://qemu.weilnetz.de/w64/qemu-w64-setup-20210805.exe, QEMU emulator version 6.0.91 (v6.1.0-rc1-11877-gde7bafd81c-dirty) as well

Command lines

PASS: -bios with QemuAdvent-Firmware

$ qemu-system-x86_64 -accel whpx,kernel-irqchip=off \
	-bios qemu-xmas-uefi-zork/OVMF-pure-efi.fd
Windows Hypervisor Platform accelerator is operational

FAIL: -drive,if=pflash with QemuAdvent-Firmware

$ qemu-system-x86_64 -accel whpx,kernel-irqchip=off \
	-drive file=qemu-xmas-uefi-zork/OVMF-pure-efi.fd,if=pflash,format=raw,readonly=on
Windows Hypervisor Platform accelerator is operational
D:\msys64\mingw64\bin\qemu-system-x86_64.exe: WHPX: Failed to emulate MMIO access with EmulatorReturnStatus: 2
D:\msys64\mingw64\bin\qemu-system-x86_64.exe: WHPX: Failed to exec a virtual processor

FAIL: -drive,if=pflash with QemuDelivered-Firmware

$ qemu-system-x86_64 -accel whpx,kernel-irqchip=off \
	-drive file=/mingw64/share/qemu/edk2-x86_64-code.fd,if=pflash,format=raw,readonly=on
Windows Hypervisor Platform accelerator is operational
D:\msys64\mingw64\bin\qemu-system-x86_64.exe: WHPX: Failed to emulate MMIO access with EmulatorReturnStatus: 2
D:\msys64\mingw64\bin\qemu-system-x86_64.exe: WHPX: Failed to exec a virtual processor

All above command lines pass on Debian/Buster with 6.0.91 using KVM.

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