From 3d83553d6225ff34dfd001036d946789ebcd6126 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 14 May 2024 19:57:58 +0100 Subject: [PATCH] refactor: add CPU_MODEL variable --- quickemu | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/quickemu b/quickemu index dfe9298..02e2d19 100755 --- a/quickemu +++ b/quickemu @@ -541,7 +541,7 @@ function configure_os_quirks() { # Make any OS specific adjustments case ${guest_os} in batocera|*bsd|freedos|haiku|linux*|*solaris) - CPU="-cpu host${CPU_KVM}" + CPU="-cpu ${CPU_MODEL}${CPU_KVM}" if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then CPU="${CPU},topoext" fi @@ -662,9 +662,9 @@ function configure_os_quirks() { ;; windows|windows-server) if [ "${QEMU_VER_SHORT}" -gt 60 ]; then - CPU="-cpu host${CPU_KVM},+hypervisor,+invtsc,l3-cache=on,migratable=no,hv_passthrough" + CPU="-cpu ${CPU_MODEL}${CPU_KVM},+hypervisor,+invtsc,l3-cache=on,migratable=no,hv_passthrough" else - CPU="-cpu host${CPU_KVM},+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" + CPU="-cpu ${CPU_MODEL}${CPU_KVM},+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" fi if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then CPU="${CPU},topoext" @@ -681,7 +681,7 @@ function configure_os_quirks() { fi SMM="on" ;; - *) CPU="-cpu host${CPU_KVM}" + *) CPU="-cpu ${CPU_MODEL}${CPU_KVM}" NET_DEVICE="rtl8139" echo "WARNING! Unrecognised guest OS: ${guest_os}";; esac @@ -1799,11 +1799,13 @@ if command -v gstat &>/dev/null; then fi DARWIN=0 +CPU_MODEL="host" CPU_KVM=",kvm=on" CPU_KVM_UNHALT=",kvm_pv_unhalt" KVM_GUEST_TWEAKS="-global kvm-pit.lost_tick_policy=discard " if [ "$(uname -s)" == "Darwin" ]; then DARWIN=1 + CPU_MODEL="Penryn" CPU_KVM="" CPU_KVM_UNHALT="" KVM_GUEST_TWEAKS=""