From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: RFC: VMX: initialize TSC offset relative to vm creation time Date: Thu, 30 Oct 2008 08:20:22 -0200 Message-ID: <20081030102022.GA2981@dmt.cnet> References: <20080910205842.GA12514@dmt.cnet> <48CB47A6.1050301@qumranet.com> <20081027234259.GA21753@dmt.cnet> <49075B9E.1020007@cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm-devel , Chris Wright , Glauber de Oliveira Costa , Benjamin Serebrin To: "David S. Ahern" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:34187 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751939AbYJ3KVf (ORCPT ); Thu, 30 Oct 2008 06:21:35 -0400 Content-Disposition: inline In-Reply-To: <49075B9E.1020007@cisco.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Oct 28, 2008 at 12:36:14PM -0600, David S. Ahern wrote: > > > That is, the fact that KVM does not handle unsynced TSC's on the host is > > not an argument against this patch which clearly fixes a bug. > > > > Take commit 019960ae9933161c2809fa4ee608ba30d9639fd2 for example. > > > > Has anything changed "recently" with the TSC code? Recently here being > the past 2 months since you first crafted the patch. I ask because in > the past few runs based on kvm.git trees (e.g., as recently as a pull on > 10/26), this tsc offset patch no longer fixes the problem. Hi David, Can you share showtime output? Works for me. > > The following one does fix the problem with kvm.git pulled on 10/26/08: > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 64e2439..d5da717 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -860,7 +860,7 @@ static void guest_write_tsc(u64 guest_tsc) > u64 host_tsc; > > rdtscll(host_tsc); > - vmcs_write64(TSC_OFFSET, guest_tsc - host_tsc); > + vmcs_write64(TSC_OFFSET, 0); > } > > /* > > This is the vmx counterpart (or at least to my understanding) to a > suggestion Ben had for the svm code. > > david