Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable L3 cache and multi-threaded TCG #618

Merged
merged 2 commits into from
Feb 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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