From: Tim Deegan Subject: Re: common time reference between domU and dom0 Date: Fri, 10 Dec 2010 10:51:15 +0000 Message-ID: <20101210105115.GJ9912@whitby.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline 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: Keir Fraser Cc: James Harper , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org At 10:45 +0000 on 10 Dec (1291977908), Keir Fraser wrote: > On 10/12/2010 10:20, "James Harper" wrote: > > >> On 10/12/2010 08:23, "James Harper" > > wrote: > >> > >>>> > >>>> System time, as exposed to guests by Xen, should be good enough. > >>>> > >>> > >>> How is this exposed for HVM systems? > >> > >> Given all HVM guest time sources are trapped to the hypervisor, > > including > >> TSC, you may as well just use the HVMOP_get_time hypercall. > >> > > > > Is that a new call? I don't see it mentioned in 4.0-testing anywhere. > > Yeah I think it's in 4.1 only. > > > Is there a fallback if HVMOP_get_time doesn't exist? > > Switch on vtsc (might be default) and just use RDTSC? Might be good enough. IIRC HVMOP_get_time was added because from Windows drivers you can't tell what the Windows kernel has done to the TSC so you can't use it to get system time yourself. It seems to me that exposing the TSC offset alongside the rest of the shared info would fix that but maybe you'd be as well off backporting HVMOP_get_time instead. Tim. -- Tim Deegan Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)