From 010a7093656ab7631cab83ed76abadddffcfb1a1 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 9 Jun 2024 13:06:00 +0200 Subject: [PATCH] feat: Verify clocksource is TSC --- src/proc.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/proc.sh b/src/proc.sh index 08c61c6..68658c2 100644 --- a/src/proc.sh +++ b/src/proc.sh @@ -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