feat: best guess for arach64 VMs on aarch64/arm64 hosts

This commit is contained in:
Martin Wimpress 2024-05-17 13:53:08 +01:00 committed by Martin Wimpress
parent ff02a7b2cb
commit 3e6acd8c98
1 changed files with 9 additions and 2 deletions

View File

@ -306,8 +306,15 @@ function configure_cpu() {
QEMU_ACCEL="kvm" QEMU_ACCEL="kvm"
fi fi
# If the architecture of the VM is different from the host, disable acceleration if [ "${ARCH_VM}" == "aarch64" ]; then
if [ "${ARCH_VM}" != "${ARCH_HOST}" ]; then # Support to run aarch64 VMs (best guess; untested)
# https://qemu-project.gitlab.io/qemu/system/arm/virt.html
case ${ARCH_HOST} in
arm64|aarch64) CPU_MODEL="max"
MACHINE_TYPE="virt,highmem=off";;
esac
elif [ "${ARCH_VM}" != "${ARCH_HOST}" ]; then
# If the architecture of the VM is different from the host, disable acceleration
CPU_MODEL="qemu64" CPU_MODEL="qemu64"
CPU_KVM_UNHALT="" CPU_KVM_UNHALT=""
QEMU_ACCEL="tcg" QEMU_ACCEL="tcg"