[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJfpegs6PKe0HCO9hdMDRLckRrfOjFcSPpyMpvGceOCiqc4KqA@mail.gmail.com>
Date: Fri, 5 Jun 2020 12:21:29 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
Vincenzo Frascino <vincenzo.frascino@....com>,
Juergen Gross <jgross@...e.com>, linux-kernel@...r.kernel.org
Subject: Re: system time goes weird in kvm guest after host suspend/resume
On Fri, Jun 5, 2020 at 12:12 PM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> Paolo Bonzini <pbonzini@...hat.com> writes:
> > On 04/06/20 21:28, Miklos Szeredi wrote:
> >> time(2) returns good time, while clock_gettime(2) returns bad time.
> >> Here's an example:
> >>
> >> time=1591298725 RT=1591300383 MONO=39582 MONO_RAW=39582 BOOT=39582
> >> time=1591298726 RT=1591300383 MONO=39582 MONO_RAW=39582 BOOT=39582
> >> time=1591298727 RT=1591300383 MONO=39582 MONO_RAW=39582 BOOT=39582
> >> time=1591298728 RT=1591300383 MONO=39582 MONO_RAW=39582 BOOT=39582
> >> time=1591298729 RT=1591300383 MONO=39582 MONO_RAW=39582 BOOT=39582
> >>
> >> As you can see, only time(2) is updated, the others remain the same.
> >> date(1) uses clock_gettime(CLOCK_REALTIME) so that shows the bad date.
> >>
> >> When the correct time reaches the value returned by CLOCK_REALTIME,
> >> the value jumps exactly 2199 seconds.
>
> Which value jumps?
The time value returned by clock_gettime() and gettimeofday() jumps by
2199s after the resume of host, and then again and again jumps with a
period of 2^41 ns.
Only time() returns the correct value and that appears to use the VDSO
since there's no time() syscall in strace.
> I can actually now reproduce, but I won't be able to investigate that
> before monday.
No problem. Good news that you can reproduce it now.
Thanks,
Miklos
Powered by blists - more mailing lists