fix: gok vm: use cpu:host on macOS with Hypervisor.framework#100
Conversation
|
cc. @stapelberg |
|
Closing and reopening to kick off testing again |
|
I'm surprised others haven't seen this 😅 |
I’m running qemu 10.2.2 from NixOS 26.05 (matches what’s in nixpkgs-unstable) and am not seeing this issue. Are you running on an x86-64 host, too? |
| qemu.Args = append(qemu.Args, | ||
| "-machine", "virt,highmem=off", | ||
| "-cpu", "cortex-a72", | ||
| "-cpu", "host", |
There was a problem hiding this comment.
Unfortunately, -cpu=host does not work for me?
% qemu-system-aarch64 -name dr -boot order=d -drive file=/tmp/gokrazy-vm1161502338,format=raw -device i6300esb,id=watchdog0 -watchdog-action reset -smp 32 -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::8080-:80,hostfwd=tcp::8022-:22 -m 1024 -machine virt,highmem=off -cpu cortex-a72 -bios /tmp/gokrazy-vm1861489883/arm64-QEMU_EFI.fd
^Cqemu: terminating on signal 2
% qemu-system-aarch64 -name dr -boot order=d -drive file=/tmp/gokrazy-vm1161502338,format=raw -device i6300esb,id=watchdog0 -watchdog-action reset -smp 32 -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::8080-:80,hostfwd=tcp::8022-:22 -m 1024 -machine virt,highmem=off -cpu host -bios /tmp/gokrazy-vm1861489883/arm64-QEMU_EFI.fd
qemu-system-aarch64: unable to find CPU model 'host'
Nope, running it on macOS's Darwin arm64 The error is quite strange because Even running it manually doesn't work |
|
According to Gemini this might be a macOS only issue..
We could potentially use |
macOS Hypervisor.framework (HVF) does not support named CPU models like cortex-a72 in QEMU 10; only host and max are valid. Use -cpu host when HVF acceleration is active and keep cortex-a72 for all other cases (Linux KVM, cross-arch software emulation). ref: https://www.qemu.org/docs/master/system/arm/cpu-features.html
9f953fd to
0776dfb
Compare
I've updated the PR in this direction. Hopefully that's reasonable. TY! |
|
Thanks! |
macOS Hypervisor.framework (HVF) does not support named CPU models
like cortex-a72 in QEMU 10; only host and max are valid.
Use -cpu host when HVF acceleration is active and keep cortex-a72
for all other cases (Linux KVM, cross-arch software emulation).
ref: https://www.qemu.org/docs/master/system/arm/cpu-features.html