From: Keir Fraser Subject: Re: tsc_mode == 1 and hvm guests Date: Thu, 6 May 2010 13:04:40 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini , "xen-devel@lists.xensource.com" Cc: Dan Magenheimer List-Id: xen-devel@lists.xenproject.org Should Cc Dan on this, as he's the original implementer. K. On 06/05/2010 12:41, "Stefano Stabellini" wrote: > Hi all, > going through the vtsc code in xen I realized that vtsc_offset and, more > importantly, vtsc_to_ns/ns_to_vtsc are never used for hvm guests. > That means that if tsc_mode == 1 the rdtsc values returned to pv guests > and the ones returns to hvm guests are fundamentally different because > in the first case they are scaled by the guest tsc frequency and in the > second case they are not. > The fact that noone at the moment is calling tsc_set_info with gtsc_khz > != 0 doesn't help spotting this problem. > > Is there a reason for this or is it just a bug? > > Also there are two gtsc_khz AFAICT: d->arch.tsc_khz and > d->arch.hvm_domain.gtsc_khz, why hvm guests have their own separate > record of the guest tsc frequency, when they never actually change it? > > BTW I noticed these problems because they prevent the pvclock algorithm > from working correctly in a PV on HVM linux guest. > > Thanks, > > Stefano > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel