Re: [PATCH v7 17/36] KVM: x86: Allow KVM master clock mode when TSCs are offset from each other
David Woodhouse <[email protected]>
| Newsgroups | org.xenproject.lists.xen-devel,org.kernel.vger.kvm,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2026-08-11 at 09:40 -0700, Sean Christopherson wrote: > > > > > FWIW in my local tree I've just extended the pvclock_migration_test to > > test precisely the thing you were concerned about: three vCPUs with > > divergent TSC offsets, migrated by setting each vCPU's TSC and then > > invoking KVM_SET_CLOCK_GUEST once, through vCPU0. > > I wasn't actually concerned about migration, I was concerned about time going > backwards from the guest's perspective. But KVM_[SG]ET_CLOCK_GUEST is *purely* for migration. And your variant just added a dependency on wallclock time back into it again, where wallclock should *only* be used for setting the TSC, and even then *only* for a live *migration* to a different host, not a live *update* via kexec/KHO on the same host, where the TSC should be restored as an offset from the host TSC.
smime.p7s
(application/pkcs7-signature, 6 KB) - not displayed