From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [ RfC / patch ] kvmclock fixes Date: Mon, 21 Apr 2008 19:57:17 +1000 Message-ID: <480C64FD.4040004@goop.org> References: <20080407213457.GA4473@dmt> <20080419152947.GA30610@dmt> <5d6222a80804190922me58c7d1ycb5c38bcf13b94a8@mail.gmail.com> <20080419164947.GA31253@dmt> <480C3F05.1060009@redhat.com> <480C516D.7080809@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti To: Gerd Hoffmann Return-path: In-Reply-To: <480C516D.7080809@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Gerd Hoffmann wrote: > * Host: make kvm pv clock really compatible with xen pv clock. > * Guest/xen: factor out some xen clock code into a separate > source file (pvclock.[ch]), so kvm can reuse it. > * Guest/kvm: make kvm clock compatible with xen clock by using > the common code bits. > I guess saving on code duplication is good... > +cycle_t pvclock_clocksource_read(struct kvm_vcpu_time_info *src) > +{ > + struct pvclock_shadow_time *shadow = &get_cpu_var(shadow_time); > + cycle_t ret; > + > + pvclock_get_time_values(shadow, src); > + ret = shadow->system_timestamp + pvclock_get_nsec_offset(shadow); > You need to put this in a loop in case the system clock parameters change between the pvclock_get_time_values() and pvclock_get_nsec_offset(). How does kvm deal with suspend/resume with respect to time? Is the "system" timestamp guaranteed to remain monotonic? For Xen, I think we'll need to maintain an offset between the initial system timestamp and whatever it is after resuming. J ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone