fix(quickemu): conditionalise KVM-specific CPU flags for Windows

Fixes #1731
This commit is contained in:
Martin Wimpress 2026-01-24 00:46:26 +00:00 committed by Martin Wimpress
parent 5ef6d1ffeb
commit 5090385dbd
1 changed files with 9 additions and 4 deletions

View File

@ -478,10 +478,15 @@ function configure_cpu() {
fi
;;
windows|windows-server)
if [ "${QEMU_VER_SHORT}" -gt 60 ]; then
CPU="-cpu ${CPU_MODEL},+hypervisor,+invtsc,l3-cache=on,migratable=no,hv_passthrough"
else
CPU="-cpu ${CPU_MODEL},+hypervisor,+invtsc,l3-cache=on,migratable=no,hv_frequencies${CPU_KVM_UNHALT},hv_reenlightenment,hv_relaxed,hv_spinlocks=8191,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vendor_id=1234567890ab,hv_vpindex"
# Base CPU flags that work with all accelerators (KVM, HVF, TCG)
CPU="-cpu ${CPU_MODEL},+hypervisor,+invtsc,l3-cache=on"
# KVM-specific flags: migratable and Hyper-V enlightenments
if [ "${QEMU_ACCEL}" == "kvm" ]; then
if [ "${QEMU_VER_SHORT}" -gt 60 ]; then
CPU+=",migratable=no,hv_passthrough"
else
CPU+=",migratable=no,hv_frequencies${CPU_KVM_UNHALT},hv_reenlightenment,hv_relaxed,hv_spinlocks=8191,hv_stimer,hv_synic,hv_time,hv_vapic,hv_vendor_id=1234567890ab,hv_vpindex"
fi
fi
# Disable S3 support in the VM to ensure Windows can boot with SecureBoot enabled
# - https://wiki.archlinux.org/title/QEMU#VM_does_not_boot_when_using_a_Secure_Boot_enabled_OVMF