Re: [PATCH v7 17/36] KVM: x86: Allow KVM master clock mode when TSCs are offset from each other
From: David Woodhouse
Date: Tue Aug 11 2026 - 13:34:55 EST
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.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature