From c9f477517a96f4599ed3d1edfa0dad4d1ce505e6 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 16 Apr 2024 22:46:16 +0100 Subject: [PATCH] fix: disable HPET based on the version of QEMU being used. Fixes #1001 --- quickemu | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/quickemu b/quickemu index af19d78..775c0fe 100755 --- a/quickemu +++ b/quickemu @@ -548,7 +548,14 @@ function vm_boot() { OSK=$(echo "bheuneqjbexolgurfrjbeqfthneqrqcyrnfrqbagfgrny(p)NccyrPbzchgreVap" | tr 'A-Za-z' 'N-ZA-Mn-za-m') # Disable S3 support in the VM to prevent macOS suspending during install - GUEST_TWEAKS="-no-hpet -global kvm-pit.lost_tick_policy=discard -global ICH9-LPC.disable_s3=1 -device isa-applesmc,osk=${OSK}" + GUEST_TWEAKS="-global kvm-pit.lost_tick_policy=discard -global ICH9-LPC.disable_s3=1 -device isa-applesmc,osk=${OSK}" + + # Disable High Precision Timer + if [ "${QEMU_VER_SHORT}" -ge 70 ]; then + MACHINE_TYPE+=",hpet=off" + else + GUEST_TWEAKS+=" -no-hpet" + fi # Tune Qemu optimisations based on the macOS release, or fallback to lowest # common supported options if none is specified. @@ -596,7 +603,14 @@ function vm_boot() { 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 - GUEST_TWEAKS="-no-hpet -global kvm-pit.lost_tick_policy=discard -global ICH9-LPC.disable_s3=1" + GUEST_TWEAKS="-global kvm-pit.lost_tick_policy=discard -global ICH9-LPC.disable_s3=1" + + # Disable High Precision Timer + if [ "${QEMU_VER_SHORT}" -ge 70 ]; then + MACHINE_TYPE+=",hpet=off" + else + GUEST_TWEAKS+=" -no-hpet" + fi if [ -z "${disk_size}" ]; then disk_size="64G"