From 7606acd228619ebcda44b17e11f1c524de2c44d0 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 19 May 2024 21:21:15 +0200 Subject: [PATCH] feat: Display KVM warning on x64 CPU's (#78) --- src/proc.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/proc.sh b/src/proc.sh index c73760a..60b8529 100644 --- a/src/proc.sh +++ b/src/proc.sh @@ -8,7 +8,10 @@ set -Eeuo pipefail : "${CPU_MODEL:=""}" : "${DEF_MODEL:="neoverse-n1"}" -[[ "${ARCH,,}" != "arm"* ]] && KVM="N" + if [[ "${ARCH,,}" != "arm64" ]]; then + KVM="N" + warn "your CPU architecture is ${ARCH} and cannot provide KVM acceleration for ARM64 instructions, this will cause a major loss of performance." +fi if [[ "$KVM" != [Nn]* ]]; then @@ -54,7 +57,7 @@ else KVM_OPTS=" -accel tcg,thread=multi" if [ -z "$CPU_MODEL" ]; then - if [[ "$ARCH" == "arm"* ]]; then + if [[ "${ARCH,,}" == "arm64" ]]; then CPU_MODEL="max,pauth-impdef=on" else CPU_MODEL="$DEF_MODEL"