From: Paolo Bonzini <pbonzini@redhat.com>
To: Andy Lutomirski <luto@amacapital.net>,
Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm list <kvm@vger.kernel.org>, Radim Krcmar <rkrcmar@redhat.com>,
X86 ML <x86@kernel.org>
Subject: Re: kvmclock doesn't work, help?
Date: Mon, 14 Dec 2015 14:44:15 +0100 [thread overview]
Message-ID: <566EC7AF.3090508@redhat.com> (raw)
In-Reply-To: <CALCETrVhHP6p-XRKhzUQX4QY3ymupriarr3joUCgjQgYa-49Bg@mail.gmail.com>
On 11/12/2015 22:57, Andy Lutomirski wrote:
> I'm still not seeing the issue.
>
> The formula is:
>
> (((rdtsc - pvti->tsc_timestamp) * pvti->tsc_to_system_mul) >>
> pvti->tsc_shift) + pvti->system_time
>
> Obviously, if you reset pvti->tsc_timestamp to the current tsc value
> after suspend/resume, you would also need to update system_time.
>
> I don't see what this has to do with suspend/resume or with whether
> the effective scale factor is greater than or less than one. The only
> suspend/resume interaction I can see is that, if the host allows the
> guest-observed TSC value to jump (which is arguably a bug, what that's
> not important here), it needs to update pvti before resuming the
> guest.
Which is not an issue, since freezing obviously gets all CPUs out of
guest mode.
Marcelo, can you provide an example with made-up values for tsc and pvti?
> Can you clarify concretely what goes wrong here?
>
> (I'm also at a bit of a loss as to why this needs both system_time and
> tsc_timestamp. They're redundant in the sense that you could set
> tsc_timestamp to zero and subtract (tsc_timestamp * tsc_to_system_mul) >>
> tsc_shift to system_time without changing the result of the
> calculation.)
You would have to ensure that all elements of pvti are rounded correctly
whenever the base TSC is updated. Doable, but it does seem simpler to
keep subtract-TSC and add-nanoseconds separate.
Paolo
next prev parent reply other threads:[~2015-12-14 13:44 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 21:10 kvmclock doesn't work, help? Andy Lutomirski
2015-12-09 21:16 ` Paolo Bonzini
2015-12-09 21:49 ` Andy Lutomirski
2015-12-09 22:12 ` Paolo Bonzini
2015-12-09 22:27 ` Andy Lutomirski
2015-12-09 22:42 ` Paolo Bonzini
2015-12-09 22:43 ` Andy Lutomirski
2015-12-10 21:33 ` Marcelo Tosatti
2015-12-10 21:32 ` Marcelo Tosatti
2015-12-11 21:57 ` Andy Lutomirski
2015-12-11 23:48 ` Marcelo Tosatti
2015-12-14 18:07 ` Andy Lutomirski
2015-12-14 21:47 ` Marcelo Tosatti
2015-12-14 13:44 ` Paolo Bonzini [this message]
2015-12-14 22:00 ` Marcelo Tosatti
2015-12-14 22:31 ` Andy Lutomirski
2015-12-14 22:38 ` Marcelo Tosatti
2015-12-15 8:42 ` Paolo Bonzini
2015-12-16 17:48 ` Andy Lutomirski
2015-12-16 18:17 ` Andy Lutomirski
2015-12-16 21:57 ` Marcelo Tosatti
2015-12-17 16:33 ` Andy Lutomirski
2015-12-17 19:08 ` Marcelo Tosatti
2015-12-18 1:12 ` Andy Lutomirski
2015-12-18 11:47 ` Marcelo Tosatti
2015-12-18 19:27 ` Andy Lutomirski
2015-12-18 19:45 ` Marcelo Tosatti
2015-12-18 20:25 ` Andy Lutomirski
2015-12-18 21:49 ` Marcelo Tosatti
2015-12-21 22:49 ` Andy Lutomirski
2015-12-23 19:27 ` Marcelo Tosatti
2015-12-23 23:09 ` Andy Lutomirski
2015-12-19 1:16 ` John Stultz
2015-12-10 21:36 ` Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=566EC7AF.3090508@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mtosatti@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.