> -----Original Message----- > From: Stefano Stabellini [mailto:stefano.stabell...@eu.citrix.com] > Sent: Tuesday, March 20, 2012 10:16 PM > To: Zhang, Yang Z > Cc: qemu-de...@nongnu.org; Paolo Bonzini; aligu...@us.ibm.com; > kvm@vger.kernel.org > Subject: Re: [Qemu-devel] [PATCH v4 2/7] RTC: Update the RTC clock only when > reading it > > On Mon, 19 Mar 2012, Zhang, Yang Z wrote: > > There has no need to use two periodic timer to update RTC time. In this > > patch, > we only update it when guest reading it. > > So the basic idea here is that we don't need to two periodic timers > because we are going to calculate the RTC guest time from QEMU's > host_clock. > > I only have a couple of observations: > > - shouldn't we use QEMU rtc_clock, rather than host_clock? Right. It should be rtc_clock not host_clock
> - it would be better to use shifts rather than divisions whenever > possible, they are much cheaper; Agree. > - rtc_calibrate_time seems to be the new functions that updates the > guest rtc time based on QEMU host_clock. Are you sure we are calling > it all the times we need to call it? Could we just call it at the > beginning of cmos_ioport_write and cmos_ioport_read? No. If the RTC_B_SET is set or divider reset is held, we should not call the rtc_calibrate_time. best regards yang -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html