Skip to content

Commit 5090385

Browse files
committed
fix(quickemu): conditionalise KVM-specific CPU flags for Windows
Fixes #1731
1 parent 5ef6d1f commit 5090385

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

quickemu

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,15 @@ function configure_cpu() {
478478
fi
479479
;;
480480
windows|windows-server)
481-
if [ "${QEMU_VER_SHORT}" -gt 60 ]; then
482-
CPU="-cpu ${CPU_MODEL},+hypervisor,+invtsc,l3-cache=on,migratable=no,hv_passthrough"
483-
else
484-
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"
481+
# Base CPU flags that work with all accelerators (KVM, HVF, TCG)
482+
CPU="-cpu ${CPU_MODEL},+hypervisor,+invtsc,l3-cache=on"
483+
# KVM-specific flags: migratable and Hyper-V enlightenments
484+
if [ "${QEMU_ACCEL}" == "kvm" ]; then
485+
if [ "${QEMU_VER_SHORT}" -gt 60 ]; then
486+
CPU+=",migratable=no,hv_passthrough"
487+
else
488+
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"
489+
fi
485490
fi
486491
# Disable S3 support in the VM to ensure Windows can boot with SecureBoot enabled
487492
# - https://wiki.archlinux.org/title/QEMU#VM_does_not_boot_when_using_a_Secure_Boot_enabled_OVMF

0 commit comments

Comments
 (0)