All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm <kvm@vger.kernel.org>
Cc: Amit Shah <amit.shah@redhat.com>, Eric B Munson <emunson@mgebm.net>
Subject: KVM: x86: fix pvclock guest stopped flag reporting
Date: Thu, 2 Aug 2012 12:33:43 -0300	[thread overview]
Message-ID: <20120802153343.GA12119@amt.cnet> (raw)


kvm_guest_time_update unconditionally clears hv_clock.flags field, 
so the notification never reaches the guest.

Fix it by allowing PVCLOCK_GUEST_STOPPED to passthrough.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 3a53bcc..e8ce10f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1217,7 +1217,9 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
 	vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
 	vcpu->last_kernel_ns = kernel_ns;
 	vcpu->last_guest_tsc = tsc_timestamp;
-	vcpu->hv_clock.flags = 0;
+	/* only support PVCLOCK_GUEST_STOPPED flag ATM */
+	if (vcpu->hv_clock.flags != PVCLOCK_GUEST_STOPPED)
+		vcpu->hv_clock.flags = 0;
 
 	/*
 	 * The interface expects us to write an even number signaling that the

             reply	other threads:[~2012-08-02 15:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 15:33 Marcelo Tosatti [this message]
2012-08-02 15:42 ` KVM: x86: fix pvclock guest stopped flag reporting Avi Kivity
2012-08-02 15:43   ` Marcelo Tosatti
2012-08-02 15:52     ` Avi Kivity
2012-08-02 16:00     ` Marcelo Tosatti
2012-08-03 18:57 ` KVM: x86: fix pvclock guest stopped flag reporting (v2) Marcelo Tosatti
2012-08-07 12:16   ` Amit Shah
2012-08-07 13:18   ` Eric B Munson

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=20120802153343.GA12119@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=emunson@mgebm.net \
    --cc=kvm@vger.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.