From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: KVM: x86: fix pvclock guest stopped flag reporting Date: Thu, 2 Aug 2012 12:33:43 -0300 Message-ID: <20120802153343.GA12119@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Amit Shah , Eric B Munson To: kvm Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37388 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636Ab2HBPeg (ORCPT ); Thu, 2 Aug 2012 11:34:36 -0400 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: 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 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