feat: Display KVM warning on x64 CPU's (#78)

This commit is contained in:
Kroese 2024-05-19 21:21:15 +02:00 committed by GitHub
parent 997bb53ab4
commit 7606acd228
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,7 +8,10 @@ set -Eeuo pipefail
: "${CPU_MODEL:=""}" : "${CPU_MODEL:=""}"
: "${DEF_MODEL:="neoverse-n1"}" : "${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 if [[ "$KVM" != [Nn]* ]]; then
@ -54,7 +57,7 @@ else
KVM_OPTS=" -accel tcg,thread=multi" KVM_OPTS=" -accel tcg,thread=multi"
if [ -z "$CPU_MODEL" ]; then if [ -z "$CPU_MODEL" ]; then
if [[ "$ARCH" == "arm"* ]]; then if [[ "${ARCH,,}" == "arm64" ]]; then
CPU_MODEL="max,pauth-impdef=on" CPU_MODEL="max,pauth-impdef=on"
else else
CPU_MODEL="$DEF_MODEL" CPU_MODEL="$DEF_MODEL"