kjliew / qemu-3dfx

MESA GL/3Dfx Glide pass-through for QEMU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vmx_write_mem: mmu_gva_to_gpa a1000 failed

TheRealSonicFan opened this issue · comments

I am not sure if I have screwed up something, but QEMU-3DFX refuses to boot into Windows 95/98SE/ME by indicating an error of "vmx_write_mem: mmu_gva_to_gpa a1000 failed" aftering a displaying the boot splash for a split second. Here's what I did:

  1. System: macOS Monterey 12.7 with an Intel Core i7-8700B processor.
  2. Compilation Steps:
    a) Install MacPorts.
    b) With "sudo su" to elevate privileges as the root in "Terminal", I specified the following commands:

port selfupdate
port upgrade outdated
port install pcre
port install libffi
port install gettext
port install glib2
port install pkgconfig
port install libpixman
port install ninja
port install meson

c) Exit the root by typing "exit" to return to the standard privileges. Then, invoke the following commands:

mkdir ~/myqemu && cd ~/myqemu
git clone https://github.com/kjliew/qemu-3dfx.git
cd qemu-3dfx
wget https://download.qemu.org/qemu-7.2.0.tar.xz
tar xf qemu-7.2.0.tar.xz
cd qemu-7.2.0
rsync -r ../qemu-0/hw/3dfx ./hw/
rsync -r ../qemu-1/hw/mesa ./hw/
patch -p0 -i ../00-qemu720-mesa-glide.patch
bash ../scripts/sign_commit
mkdir ../build && cd ../build
git submodule update –init dtc
../qemu-7.2.0/configure --enable-hvf --enable-cocoa --enable-sdl --enable-slirp --target-list=x86_64-softmmu
make

  1. Follow the guide here and launch QEMU-3DFX once the compilation completes:

https://github.com/kjliew/qemu-3dfx/wiki

Note that I need to alter the boot arguments a bit to ensure QEMU-3DFX works on Mac.

Changes:
a) accel=kvm -> accel=hvf
Reason: macOS does not support KVM virtualization.

b) -cpu host -> -cpu host,-pdpe1g
    Reason: macOS does not support 1GB pages in user mode. Followed the following guide:
    https://stackoverflow.com/questions/60231203/qemu-qcow2-mmu-gva-to-gpa-crash-in-mac-os-x

    These following CPU arguments all rendered QEMU-3DFX to crash with "vmx_write_mem: mmu_gva_to_gpa a1000 failed.":

   * Note: I am not sure if "qemu*" processors works with 1GB pages, so I disabled that feature as my attempts anyway. For processors do not support 1GB pages, I did not explicitly specify the argument to disable the feature.
   
    i) -cpu host
    ii) -cpu host,-pdpe1g
    iii) -cpu qemu32
    iv) -cpu qemu32,-pdpe1g
    v) -cpu qemu32-v1
    vi) -cpu qemu32-v1,-pdpe1g
    vii) -cpu qemu64
    viii) -cpu qemu64,-pdpe1g
    ix) -cpu qemu64-v1
    x) -cpu qemu64-v1,-pdpe1g
    xi) -cpu 486
    xii) -cpu 486-v1
    xiii) -cpu pentium
    xiv) -cpu pentium-v1
    xv) -cpu base

c) -device ac97 -> -device sb16
    Reason: macOS does not support AC97 of QEMU fully. Using "ac97" renders two errors: "audio: Failed to create voice `ac97.pi'" and "audio: Failed to create voice `ac97.mc'."
  1. Installations of Windows 95/98SE/ME were fine, but immediate crashes occurred at "Preparing to start Windows for the first time..." This symptom happens when the guest reboots from HDD after an installation completes.

./qemu-system-x86_64 -nodefaults -rtc base=localtime -display sdl
-M pc,accel=hvf,hpet=off,usb=off -cpu host,-pdpe1g
-device VGA -device lsi -device sb16
-netdev user,id=net0 -device pcnet,rombar=0,netdev=net0
-drive if=floppy,format=raw,file=fd.ima
-drive id=win98,if=none,file=../vmimgs/w98.qcw -device scsi-hd,drive=win98
-cdrom Win98.iso -boot a

Any thoughts?

You were doing mostly everything right, except:

c) -device ac97 -> -device sb16
Reason: macOS does not support AC97 of QEMU fully.
Using "ac97" renders two errors: "audio: Failed to create voice ac97.pi'" and "audio: Failed to create voice ac97.mc'."

The ac97.pi and ac97.mc are audio inputs pcm-in and mic-in which the macOS privacy model has imposed access restrictions only for allowed apps. Those errors can be safely ignored.

vmx_write_mem: mmu_gva_to_gpa a1000 failed

This error is unrelated to qemu-3dfx. You can try out pristine QEMU, either from MacPort, HomeBrew or build-it-yourself, with the same Windows 95/98SE/ME disk image and will likely have the same error. So far, no one had reported success of Apple HVF on accelerating legacy Windows 98/XP VMs on Intel CPUs. Correct me if I was wrong and I do not have access to Intel Mac to check it out myself.

I have the impressions that Apple HVF support on Intel CPUs had been left to rot as the focus shifting to Apple Silicon. If you are still keen on trying out qemu-3dfx, then I think the easiest way is to boot a modern Linux distro on your Mac.

Again, QEMU general usability issues are out of scope of this project.

The ac97.pi and ac97.mc are audio inputs pcm-in and mic-in which the macOS privacy model has imposed access restrictions only for allowed apps. Those errors can be safely ignored.

Understood.

I have the impressions that Apple HVF support on Intel CPUs had been left to rot as the focus shifting to Apple Silicon. If you are still keen on trying out qemu-3dfx, then I think the easiest way is to boot a modern Linux distro on your Mac.

I see... I might be switching to Apple Silicon soon. Hope everything works then.