All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about commit 1adf528ec3bd ("hw/rtc/pl031: Send RTC_CHANGE QMP event")
@ 2022-05-18  9:55 jokenzhang via
  2022-05-18 12:16 ` Eric Auger
  0 siblings, 1 reply; 2+ messages in thread
From: jokenzhang via @ 2022-05-18  9:55 UTC (permalink / raw)
  To: eric.auger, qemu-devel, qemu-arm; +Cc: wanghaibin.wang

Hi Eric,

Have you ever tested the value reported by the PL031 RTC_CHANGE when
the qemu clock is using the virtual clock, which is not identical to
mc146818.

For instance, adding 20s to the guest RTC value, the expected value should be
20, but the actual value is 1652863291:

{"timestamp": {"seconds": 1652863355, "microseconds": 298846}, "event": "RTC_CHANGE", "data": {"offset":
1652863291}}

This is tested with qemu option "-rtc base=utc,clock=vm"

>         s->tick_offset += value - pl031_get_count(s);
>+
>+        qemu_get_timedate(&tm, s->tick_offset);
>+        qapi_event_send_rtc_change(qemu_timedate_diff(&tm));

It may be caused by the calculation of the new reference time. The new reference
time is calculated with s->tick_offset and rtc_ref_start_datetime, and
s->tick_offset is initialized with rtc_ref_start_datetime, resulting that the
rtc_ref_start_datetime is double counting.


Thanks


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-18 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18  9:55 Question about commit 1adf528ec3bd ("hw/rtc/pl031: Send RTC_CHANGE QMP event") jokenzhang via
2022-05-18 12:16 ` Eric Auger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.