Re: [PATCH 0/2] RFC: Precise TSC migration

From: Paolo Bonzini
Date: Mon Nov 30 2020 - 12:01:29 EST


On 30/11/20 17:54, Andy Lutomirski wrote:
I*do think* however that we should redefine KVM_CLOCK_TSC_STABLE
in the documentation to state that it only guarantees invariance if the guest
doesn't mess with its own TSC.

Also I think we should consider enabling the X86_FEATURE_TSC_RELIABLE
in the guest kernel, when kvm is detected to avoid the guest even from trying
to sync TSC on newly hotplugged vCPUs.

(The guest doesn't end up touching TSC_ADJUST usually, but it still might
in some cases due to scheduling of guest vCPUs)

(X86_FEATURE_TSC_RELIABLE short circuits tsc synchronization on CPU hotplug,
and TSC clocksource watchdog, and the later we might want to keep).
If you're going to change the guest behavior to be more trusting of
the host, I think
the host should probably signal this to the guest using a new bit.


Yes, a new CPUID bit takes longer to propagate to existing setups, but it is more future proof.

Paolo