From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [KVM timekeeping fixes 1/4] Fix kvmclock bug Date: Mon, 20 Sep 2010 12:41:20 -0300 Message-ID: <20100920154120.GB3088@amt.cnet> References: <1284856695-19438-1-git-send-email-zamsden@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, Avi Kivity , Glauber Costa , linux-kernel@vger.kernel.org To: Zachary Amsden Return-path: Content-Disposition: inline In-Reply-To: <1284856695-19438-1-git-send-email-zamsden@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Sat, Sep 18, 2010 at 02:38:12PM -1000, Zachary Amsden wrote: > If preempted after kvmclock values are updated, but before hardware > virtualization is entered, the last tsc time as read by the guest is > never set. It underflows the next time kvmclock is updated if there > has not yet been a successful entry / exit into hardware virt. > > Fix this by simply setting last_tsc to the newly read tsc value so > that any computed nsec advance of kvmclock is nulled. > > Signed-off-by: Zachary Amsden Applied, thanks.