On Saturday, 14.11.2015 at 19:07, Antti Kantee wrote:
> On 06/07/15 08:37, Martin Lucina wrote:
> >On Saturday, 04.07.2015 at 11:30, Antti Kantee wrote:
> >>>>However, I am concerned about the case where the host has SMP.  Is
> >>>>tsc always sufficiently virtualized?
> >>>
> >>>To be honest, I don't know. See the references at the end of this email.
> >>>The answer is "probably, yes" but we'll have to wait and see what happens
> >>>in reality when people start using it.
> >>>[...]
> >>Bug shakedowns are one thing, but it would be nice to see the author
> >>extrude more confidence than "probably" for if the introduced
> >>technique is not fundamentally broken...
> >
> >Let me put it this way: The Intel manuals say:
> >
> >a) Invariant TSC is the "architectural way going forward".
> >b) OS writers should use the TSC for timekeeping if it is invariant.
> >c) VMX extensions provide all the appropriate hooks for virtualizing TSC.
> >
> >I'm confident that the technique I'm using is the right way to do things
> >today, on modern (since 2008) hardware.
> >
> >I cannot make any statements about how well hypervisors actually implement
> >c) above, hence the "we'll have to wait and see what happens".
> 
> Your and englishm's log for GCE shows "WARNING: Processor claims to not
> support invariant TSC.", so either the feature test is broken or timekeeping
> is broken on GCE.
> 
> https://www.freelists.org/post/rumpkernel-users/First-boot-on-Google-Compute-Engine
> https://gist.github.com/englishm/52db261c84fc941df322#file-gistfile1-txt-L327
> 
> I filed a Rumprun issue:
> https://github.com/rumpkernel/rumprun/issues/61
> 

The test is not broken. KVM will not export an invariant TSC unless
explicitly told to do so, and it also implies disabling migration.

Try it yourself -- on a TSC invariant machine the relevant qemu runes are
"-cpu host,migratable=no,+invtsc". Without those you will keep getting the
warning.

As to whether or not timekeeping is actually broken in the case where the
test fails, hard to say. Tentative answer is "probably, but need to
actually do some long-running scientific testing to find out".

The way KVM pvclock is designed it seems to imply the guest should use TSC
regardless, but presumably with some kind of $BACKUP_PARANOIA. More
investigation needed.


Reply via email to