Re: [PATCH] KVM: x86: Don't snapshot "max" TSC if host TSC is constant
From: David Woodhouse
Date: Fri Feb 25 2022 - 11:34:35 EST
On Fri, 2022-02-25 at 16:21 +0000, Sean Christopherson wrote:
> > I also have questions about the use case for the above patch.... if
> > this is a clean boot and you're just starting to host guests, surely we
> > can wait for the time it takes for the TSC synchronization to complete?
>
> KVM is built into the kernel in their case, the vmx_init() => kvm_init() gets
> automatically called during boot. The VMs aren't started until well after
> synchronization has completed, but KVM has already snapshotted the "bad" value.
Gotcha.
So even when we put my patch in front, to snapshot a value into
kvm->arch.default_tsc_khz, that's happening later at VM creation time
so should also be snapshotting the *good* value.
And at least if it snapshots the bad value, all the vCPUs will be
*consistent*.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature