qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] stop the periodic RTC update timer


From: Philipp Hahn
Subject: Re: [Qemu-devel] [PATCH 3/3] stop the periodic RTC update timer
Date: Wed, 11 Jan 2012 08:25:38 +0100
User-agent: KMail/1.9.10 (enterprise35 20100903.1171286)

Hello,

On Wednesday 11 January 2012 01:56:25 Zhang, Yang Z wrote:
> > -----Original Message-----
> > From: Paolo Bonzini [mailto:address@hidden
> > Sent: Tuesday, January 10, 2012 5:25 PM
> >
> > >> Also, I'm not sure if the update in progress flag still works.
> > >> Clients are supposed to wait for UIP=0 before reading the RTC, and an
> > >> update is supposed to be at least 220 microseconds away when UIP=0.
> > >
> > > Hardware need a period time to update clock and it would not provide
> > > the right value during the update. So it uses UIP to notify the
> > > software doesn't believe the value if the UIP is set. For emulation,
> > > you can read RTC at any time and it always gives you the right value.
> > > So there is no need to emulate UIP.
> >
> > This is incorrect, for two reasons.  First, the UIP is in the spec, and
> > we have to implement it.  Second, reading the clock is not atomic, and
> > waiting for UIP=0 gives you 220 microseconds during which you know that
> > the read will appear atomic.
>
> For a simulator, we need to follow the spec strictly and simulate hardware
> as precisely as possible. But QEMU is a generic machine emulator and
> virtualizer. It's not a hardware simulator. If there is an easy way we can
> provide the same function, why we chose the complicated one? Also, is there
> an actual case that break with my patch?

FYI:
But you must not break existing implementations (of any (closed-source) OS), 
which depend on that behaviour of the RTC. Have a look at get_cmos_time() of 
the Xen hypervisor for example (that is the one I have been looking at at the 
past few hours), which explicitliy waits for the falling edge of UIP to get 
sub-second precision. This would break if you no longer simulate UIP.

Sincerely
Philipp
-- 
Philipp Hahn           Open Source Software Engineer      address@hidden
Univention GmbH        Linux for Your Business        fon: +49 421 22 232- 0
Mary-Somerville-Str.1  D-28359 Bremen                 fax: +49 421 22 232-99
                                                   http://www.univention.de/

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]