Skip to content

Commit

Permalink
fix: Custom CPU model
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Feb 5, 2024
1 parent cace335 commit d30e889
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/proc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -Eeuo pipefail

: "${KVM:="Y"}"
: "${CPU_FLAGS:=""}"
: "${CPU_MODEL:=""}"
: "${DEF_MODEL:="qemu64"}"
: "${CPU_MODEL:="$DEF_MODEL"}"

[ "$ARCH" != "amd64" ] && KVM="N"

Expand Down Expand Up @@ -37,7 +37,7 @@ fi

if [[ "$KVM" != [Nn]* ]]; then

if [[ "$CPU_MODEL" == "$DEF_MODEL" ]]; then
if [ -z "$CPU_MODEL" ]; then
CPU_MODEL="host"
fi

Expand All @@ -52,11 +52,16 @@ else
WIN_FEATURES="+hypervisor,hv_passthrough"

if [[ "$ARCH" == "amd64" ]]; then
if [[ "$CPU_MODEL" == "$DEF_MODEL" ]]; then
KVM_OPTS=" -accel tcg,thread=multi"
fi

if [ -z "$CPU_MODEL" ]; then
if [[ "$ARCH" == "amd64" ]]; then
CPU_MODEL="max"
CPU_FEATURES="$CPU_FEATURES,migratable=no"
else
CPU_MODEL="$DEF_MODEL"
fi
KVM_OPTS=" -accel tcg,thread=multi"
CPU_FEATURES="$CPU_FEATURES,migratable=no"
fi

CPU_FEATURES="$CPU_FEATURES,+ssse3,+sse4.1,+sse4.2"
Expand Down

0 comments on commit d30e889

Please sign in to comment.