WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] tsc_mode == 1 and hvm guests

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel] tsc_mode == 1 and hvm guests
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Thu, 6 May 2010 08:03:51 -0700 (PDT)
Cc: "Xu, Dongxiao" <dongxiao.xu@xxxxxxxxx>, "Zhang, Xiantao" <xiantao.zhang@xxxxxxxxx>
Delivery-date: Thu, 06 May 2010 08:05:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C8086EE8.13654%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1005061225520.11380@kaball-desktop C8086EE8.13654%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Actually, I did the PV changes for vtsc and Intel (I think
Dongxiao or Xiantao, but I'm not sure) did the HV
changes for vtsc.

vtsc_to_ns is exposed to userland (even on HV) via a
cpuid leaf so an app using TSC can determine the scaling
and convert to ns.

IIRC gtsc_khz is non-zero on restore (at least for PV)

It wouldn't surprise me to find that there are some
minor inconsistencies in all the vtsc stuff
between HV and PV.  My goal was to get it (and pvrdtscp)
working for PV in time for 4.0 bit freeze.

Dan

> -----Original Message-----
> From: Keir Fraser [mailto:keir.fraser@xxxxxxxxxxxxx]
> Sent: Thursday, May 06, 2010 6:05 AM
> To: Stefano Stabellini; xen-devel@xxxxxxxxxxxxxxxxxxx
> Cc: Dan Magenheimer
> Subject: Re: [Xen-devel] tsc_mode == 1 and hvm guests
> 
> Should Cc Dan on this, as he's the original implementer.
> 
>  K.
> 
> On 06/05/2010 12:41, "Stefano Stabellini"
> <Stefano.Stabellini@xxxxxxxxxxxxx>
> 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@xxxxxxxxxxxxxxxxxxx
> > http://lists.xensource.com/xen-devel
> 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel