feat: Verify clocksource is TSC

This commit is contained in:
Kroese 2024-06-09 13:06:00 +02:00 committed by GitHub
parent 2ece865417
commit 010a709365
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,7 @@ fi
if [[ "$KVM" != [Nn]* ]]; then
CPU_FEATURES="kvm=on,l3-cache=on,+hypervisor"
CLOCK="/sys/devices/system/clocksource/clocksource0/current_clocksource"
KVM_OPTS=",accel=kvm -enable-kvm -global kvm-pit.lost_tick_policy=discard"
if ! grep -qw "sse4_2" <<< "$flags"; then
@ -64,6 +65,15 @@ if [[ "$KVM" != [Nn]* ]]; then
CPU_FEATURES+=",migratable=no"
fi
if [ -f "$CLOCK" ]; then
CLOCK=$(<"$CLOCK")
if [[ "${CLOCK,,}" != "tsc" ]]; then
warn "unexpected clocksource: $CLOCK"
fi
else
warn "file \"$CLOCK\" cannot not found?"
fi
if grep -qw "svm" <<< "$flags"; then
# AMD processor