Skip to content

Commit

Permalink
feat: Display KVM warning on x64 CPU's (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored May 19, 2024
1 parent 997bb53 commit 7606acd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/proc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 7606acd

Please sign in to comment.