refactor: enable topoext on AuthenticAMD for everything except macOS

This commit is contained in:
Martin Wimpress 2024-05-16 11:12:54 +01:00 committed by Martin Wimpress
parent aaeb413e3e
commit 4a7f4a4932
1 changed files with 4 additions and 10 deletions

View File

@ -581,10 +581,6 @@ function configure_os_quirks() {
case ${guest_os} in case ${guest_os} in
batocera|*bsd|freedos|haiku|linux*|*solaris) batocera|*bsd|freedos|haiku|linux*|*solaris)
CPU="-cpu ${CPU_MODEL}" CPU="-cpu ${CPU_MODEL}"
if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then
CPU="${CPU},topoext"
fi
if [ "${guest_os}" == "freebsd" ] || [ "${guest_os}" == "ghostbsd" ]; then if [ "${guest_os}" == "freebsd" ] || [ "${guest_os}" == "ghostbsd" ]; then
mouse="usb" mouse="usb"
elif [ "${guest_os}" == "batocera" ] || [ "${guest_os}" == "freedos" ] || [ "${guest_os}" == "haiku" ]; then elif [ "${guest_os}" == "batocera" ] || [ "${guest_os}" == "freedos" ] || [ "${guest_os}" == "haiku" ]; then
@ -606,9 +602,6 @@ function configure_os_quirks() {
;; ;;
kolibrios|reactos) kolibrios|reactos)
CPU="-cpu qemu32" CPU="-cpu qemu32"
if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then
CPU="${CPU},topoext"
fi
MACHINE_TYPE="pc" MACHINE_TYPE="pc"
case ${guest_os} in case ${guest_os} in
kolibrios) NET_DEVICE="rtl8139";; kolibrios) NET_DEVICE="rtl8139";;
@ -716,9 +709,6 @@ function configure_os_quirks() {
else 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" 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"
fi fi
if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then
CPU="${CPU},topoext"
fi
# Disable S3 support in the VM to ensure Windows can boot with SecureBoot enabled # 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 # - https://wiki.archlinux.org/title/QEMU#VM_does_not_boot_when_using_a_Secure_Boot_enabled_OVMF
GUEST_TWEAKS+=" -global ICH9-LPC.disable_s3=1" GUEST_TWEAKS+=" -global ICH9-LPC.disable_s3=1"
@ -739,6 +729,10 @@ function configure_os_quirks() {
NET_DEVICE="rtl8139" NET_DEVICE="rtl8139"
echo "WARNING! Unrecognised guest OS: ${guest_os}";; echo "WARNING! Unrecognised guest OS: ${guest_os}";;
esac esac
if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ] && [ "${guest_os}" != "macos" ]; then
CPU+=",topoext"
fi
} }
function configure_storage() { function configure_storage() {