From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: mtosatti@redhat.com
Subject: [PATCH 0/2] KVM: x86: do not mix raw and monotonic clocks in kvmclock
Date: Wed, 22 Jan 2020 15:22:31 +0100 [thread overview]
Message-ID: <1579702953-24184-1-git-send-email-pbonzini@redhat.com> (raw)
Commit 53fafdbb8b21f ("KVM: x86: switch KVMCLOCK base to monotonic raw
clock") changed kvmclock to use tkr_raw instead of tkr_mono. However,
the default kvmclock_offset for the VM was still based on the monotonic
clock and, if the raw clock drifted enough from the monotonic clock,
this could cause a negative system_time to be written to the guest's
struct pvclock. RHEL5 does not like it and (if it boots fast enough to
observe a negative time value) it hangs.
This series fixes the issue by using the raw clock everywhere.
(And this, ladies and gentlemen, is why I was not applying patches to
the KVM tree. I saw this before Christmas and could only reproduce it
today, since it requires almost 2 weeks of uptime to reproduce on my
machine. Of course, once you have the reproducer the fix is relatively
easy to come up with).
Paolo
Paolo Bonzini (2):
KVM: x86: reorganize pvclock_gtod_data members
KVM: x86: use raw clock values consistently
arch/x86/kvm/x86.c | 67 ++++++++++++++++++++++++++++--------------------------
1 file changed, 35 insertions(+), 32 deletions(-)
--
1.8.3.1
next reply other threads:[~2020-01-22 14:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-22 14:22 Paolo Bonzini [this message]
2020-01-22 14:22 ` [PATCH 1/2] KVM: x86: reorganize pvclock_gtod_data members Paolo Bonzini
2020-01-23 11:32 ` Vitaly Kuznetsov
2020-01-23 11:35 ` Paolo Bonzini
2020-01-22 14:22 ` [PATCH 2/2] KVM: x86: use raw clock values consistently Paolo Bonzini
2020-01-23 13:43 ` Vitaly Kuznetsov
2020-01-23 13:54 ` Paolo Bonzini
2020-01-24 20:36 ` [PATCH 0/2] KVM: x86: do not mix raw and monotonic clocks in kvmclock Marcelo Tosatti
2020-01-25 9:42 ` Paolo Bonzini
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=1579702953-24184-1-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®