feat: Enable L3 cache (#8)

This commit is contained in:
Kroese 2024-02-04 15:03:17 +01:00 committed by GitHub
parent f011637e68
commit 1b8c3a437b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 20 deletions

View file

@ -11,7 +11,7 @@ MON_OPTS="-monitor $MONITOR"
USB_OPTS="-device $USB -device usb-kbd -device usb-tablet"
RAM_OPTS=$(echo "-m $RAM_SIZE" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
CPU_OPTS="-cpu $CPU_FLAGS -smp $CPU_CORES,sockets=1,dies=1,cores=$CPU_CORES,threads=1"
MAC_OPTS="-machine type=${MACHINE},secure=off,gic-version=3,dump-guest-core=off${KVM_OPTS}"
MAC_OPTS="-machine type=${MACHINE},secure=off,dump-guest-core=off${KVM_OPTS}"
DEV_OPTS="-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4"
DEV_OPTS="$DEV_OPTS -object rng-random,id=objrng0,filename=/dev/urandom"
DEV_OPTS="$DEV_OPTS -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c"

View file

@ -34,7 +34,7 @@ BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g')
TMP="$STORAGE/${BASE%.*}.tmp"
rm -f "$TMP"
MSG="Downloading $BASE ..."
MSG="Downloading $BASE..."
info "$MSG" && html "$MSG"
/run/progress.sh "$TMP" "Downloading $BASE ([P])..." &

View file

@ -5,8 +5,7 @@ set -Eeuo pipefail
: "${KVM:="Y"}"
: "${CPU_FLAGS:=""}"
: "${CPU_MODEL:="host"}"
: "${MODEL:="cortex-a53"}"
: "${CPU_MODEL:="cortex-a53"}"
[[ "$ARCH" != "arm"* ]] && KVM="N"
@ -33,34 +32,33 @@ fi
if [[ "$KVM" != [Nn]* ]]; then
CPU_FEATURES="kvm=on"
CPU_MODEL="host"
KVM_OPTS=",accel=kvm -enable-kvm"
if [[ "${BOOT_MODE,,}" == "windows" ]]; then
[ -n "$CPU_FEATURES" ] && CPU_FEATURES="$CPU_FEATURES,"
CPU_FEATURES="$CPU_FEATURES+hypervisor,+invtsc,l3-cache=on,migratable=no,hv_passthrough"
fi
CPU_FEATURES="kvm=on,l3-cache=on,migratable=no"
WIN_FEATURES="+hypervisor,+invtsc,hv_passthrough"
else
KVM_OPTS=""
CPU_FEATURES=""
CPU_FEATURES="l3-cache=on"
WIN_FEATURES="+hypervisor,hv_passthrough"
if [[ "$ARCH" == "arm"* ]]; then
CPU_MODEL="max"
CPU_FEATURES="$CPU_FEATURES,migratable=no"
fi
if [[ "${BOOT_MODE,,}" == "windows" ]]; then
MACHINE="$MACHINE,virtualization=on"
fi
if [[ "${CPU_MODEL,,}" == "host"* ]]; then
fi
if [[ "$ARCH" == "arm"* ]]; then
CPU_MODEL="max"
else
CPU_MODEL="$MODEL"
fi
if [[ "${BOOT_MODE,,}" == "windows" ]]; then
[ -n "$CPU_FEATURES" ] && CPU_FEATURES="$CPU_FEATURES,"
CPU_FEATURES="$CPU_FEATURES${WIN_FEATURES}"
fi
fi
if [ -z "$CPU_FLAGS" ]; then