Re: [PATCH v2 1/3] KVM: x86: implement KVM_{GET|SET}_TSC_STATE
From: Thomas Gleixner
Date: Thu Dec 10 2020 - 18:20:08 EST
On Thu, Dec 10 2020 at 12:26, Marcelo Tosatti wrote:
> On Wed, Dec 09, 2020 at 09:58:23PM +0100, Thomas Gleixner wrote:
>> Marcelo,
>>
>> On Wed, Dec 09 2020 at 13:34, Marcelo Tosatti wrote:
>> > On Tue, Dec 08, 2020 at 10:33:15PM +0100, Thomas Gleixner wrote:
>> >> On Tue, Dec 08 2020 at 15:11, Marcelo Tosatti wrote:
>> >> > max_cycles overflow. Sent a message to Maxim describing it.
>> >>
>> >> Truly helpful. Why the hell did you not talk to me when you ran into
>> >> that the first time?
>> >
>> > Because
>> >
>> > 1) Users wanted CLOCK_BOOTTIME to stop counting while the VM
>> > is paused (so we wanted to stop guest clock when VM is paused anyway).
>>
>> How is that supposed to work w/o the guest kernels help if you have to
>> keep clock realtime up to date?
>
> Upon VM resume, we notify NTP daemon in the guest to sync realtime
> clock.
Brilliant. What happens if there is no NTP daemon? What happens if the
NTP daemon is not part of the virt orchestration magic and cannot be
notified, then it will notice the time jump after the next update
interval.
What about correctness?
ALL CLOCK_* stop and resume when the VM is resumed at the point where
they stopped.
So up to the point where NTP catches up and corrects clock realtime and
TAI other processes can observe that time jumped in the outside world,
e.g. via a network packet or whatever, but there is no reason why time
should have jumped outside vs. the local one.
You really all live in a seperate universe creating your own rules how
things which other people work hard on to get it correct can be screwed
over.
Of course this all is nowhere documented in detail. At least a quick
search with about 10 different keyword combinations revealed absolutely
nothing.
This features first, correctness later frenzy is insane and it better
stops now before you pile even more crap on the existing steaming pile
of insanities.
Thanks,
tglx