Skip to content

whpx, on booting win98, qemu crashes with Failed to emulate PortIO access with EmulatorReturnStatus: 2

Host environment

  • Operating system: Windows 10 22H2
  • OS/kernel version: 19045.2491 (up-to-date as of 20240416)
  • Architecture: x86-64
  • QEMU flavor: qemu-system-x86_64.exe
  • QEMU version: QEMU emulator version 8.2.91 (v9.0.0-rc1-12050-gb494cb57ce)
  • QEMU command line:
    qemu-system-x86_64 -machine type=pc,accel=whpx,kernel-irqchip=off -cpu core2duo -smp "sockets=1,cores=1,threads=1" -m 512 -nodefaults -bios bios-256k.bin -rtc base=localtime -display sdl,gl=on -device VGA,vgamem_mb=128 -audiodev dsound,id=snd1 -device adlib,audiodev=snd1 -audiodev dsound,id=snd2 -device ac97,audiodev=snd2 -boot c -drive index=0,if=ide,media=disk,format=vhdx,file="F:\Win98m40_sys.vhdx" -drive index=1,if=ide,media=disk,format=vhdx,file="F:\Win98m40_data_01.vhdx" -drive index=3,if=ide,media=disk,format=vhdx,file="F:\Win98m40_data_02.vhdx"

Emulated/Virtualized environment

  • Operating system: Win98SE
  • OS/kernel version: 4.10.2222
  • Architecture: x86_64

Description of problem

Q) What is the correct command line arguments to boot win98se with accel whpx

The above given command line crashes partway through the win98se boot process before the desktop shows up

Windows Hypervisor Platform accelerator is operational
C:\vol\scoop_01\SCOOPG\apps\qemu\current\qemu-system-x86_64.exe: warning: GLib-GIO: Failed to open application manifest `C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AppxManifest.xml' for package #34 (`Microsoft.MicrosoftEdge_44.19041.1266.0_neutral__8wekyb3d8bbwe'): error code 0x2
C:\vol\scoop_01\SCOOPG\apps\qemu\current\qemu-system-x86_64.exe: WHPX: Failed to emulate PortIO access with EmulatorReturnStatus: 2
C:\vol\scoop_01\SCOOPG\apps\qemu\current\qemu-system-x86_64.exe: WHPX: Failed to exec a virtual processor

Steps to reproduce

  1. Finish a complete win98 install using -machine type=pc,accel=tcg -cpu qemu64
    qemu-system-x86_64 -machine type=pc,accel=tcg -cpu qemu64 -smp "sockets=1,cores=1,threads=1" -m 512 -nodefaults -bios bios-256k.bin -rtc base=localtime -display sdl,gl=on -device VGA,vgamem_mb=128 -audiodev dsound,id=snd1 -device adlib,audiodev=snd1 -audiodev dsound,id=snd2 -device ac97,audiodev=snd2 -boot c -drive index=0,if=ide,media=disk,format=vhdx,file="F:\Win98m40_sys.vhdx" -drive index=1,if=ide,media=disk,format=vhdx,file="F:\Win98m40_data_01.vhdx" -drive index=3,if=ide,media=disk,format=vhdx,file="F:\Win98m40_data_02.vhdx"
    With all guestos-win98-drivers installed the win98 seems to work satisfactorily.
    Using vga driver from https://github.com/JHRobotics/vmdisp9x/releases
  2. now change processor to -cpu core2duo, it boots . This does not seem to matter, bug exists even with qemu64
  3. now change accel to -machine type=pc,accel=whpx , qemu crashes partway into boot before bringing up desktop.
    with or without kernel-irqchip=off does not matter
    with or without cpu arguments ,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,hv-time also does not matter
  4. Setting back to -machine type=pc,accel=tcg -cpu core2duo restores bootable win98se.

Additional information

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