Skip to content

Commit

Permalink
feat: Enable L3 cache and multi-threaded TCG (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Feb 4, 2024
1 parent 53cc699 commit 4c67343
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/proc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -Eeuo pipefail
: "${KVM:="Y"}"
: "${HOST_CPU:=""}"
: "${CPU_FLAGS:=""}"
: "${CPU_MODEL:="host"}"
: "${CPU_MODEL:="qemu64"}"

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

Expand Down Expand Up @@ -37,8 +37,9 @@ fi

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

CPU_FEATURES="kvm=on"
CPU_MODEL="host"
KVM_OPTS=",accel=kvm -enable-kvm"
CPU_FEATURES="kvm=on,l3-cache=on,migratable=no"

if ! grep -qE '^flags.* (sse4_2)' /proc/cpuinfo; then
error "Your host CPU does not have the SSE4.2 instruction set that Virtual DSM requires to boot."
Expand All @@ -49,17 +50,16 @@ if [[ "$KVM" != [Nn]* ]]; then
else

KVM_OPTS=""
CPU_FEATURES="+ssse3,+sse4.1,+sse4.2"
CPU_FEATURES="l3-cache=on"

if [[ "${CPU_MODEL,,}" == "host"* ]]; then
if [[ "$ARCH" == "amd64" ]]; then
CPU_MODEL="max"
KVM_OPTS=" -accel tcg,thread=multi"
CPU_FEATURES="$CPU_FEATURES,migratable=no"
fi

if [[ "$ARCH" == "amd64" ]]; then
CPU_MODEL="max"
else
CPU_MODEL="qemu64"
fi
CPU_FEATURES="$CPU_FEATURES,+ssse3,+sse4.1,+sse4.2"

fi
fi

if [ -z "$CPU_FLAGS" ]; then
Expand Down

0 comments on commit 4c67343

Please sign in to comment.