[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 2/7] RTC: Update the RTC clock only when read
From: |
Zhang, Yang Z |
Subject: |
Re: [Qemu-devel] [PATCH v4 2/7] RTC: Update the RTC clock only when reading it |
Date: |
Wed, 21 Mar 2012 07:43:02 +0000 |
> -----Original Message-----
> From: Stefano Stabellini [mailto:address@hidden
> Sent: Tuesday, March 20, 2012 10:16 PM
> To: Zhang, Yang Z
> Cc: address@hidden; Paolo Bonzini; address@hidden;
> address@hidden
> 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