qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Hahn <hahn@univention.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/3] stop the periodic RTC update timer
Date: Wed, 11 Jan 2012 08:25:38 +0100	[thread overview]
Message-ID: <201201110825.41752.hahn@univention.de> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E0240C7@SHSMSX102.ccr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]

Hello,

On Wednesday 11 January 2012 01:56:25 Zhang, Yang Z wrote:
> > -----Original Message-----
> > From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> > 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      hahn@univention.de
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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2012-01-11  7:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-06  7:37 [Qemu-devel] [PATCH 3/3] stop the periodic RTC update timer Zhang, Yang Z
2012-01-06 17:26 ` Jan Kiszka
2012-01-09  7:10   ` Zhang, Yang Z
2012-01-09  8:19 ` Paolo Bonzini
2012-01-10  6:37   ` Zhang, Yang Z
2012-01-10  9:24     ` Paolo Bonzini
2012-01-11  0:56       ` Zhang, Yang Z
2012-01-11  7:24         ` Paolo Bonzini
2012-01-12  0:51           ` Zhang, Yang Z
2012-01-11  7:25         ` Philipp Hahn [this message]
2012-01-11 13:10 ` Marcelo Tosatti
2012-01-12  0:00   ` Zhang, Yang Z
2012-01-12  9:26     ` Paolo Bonzini
2012-01-12 10:20       ` Marcelo Tosatti
2012-01-12 10:43         ` Paolo Bonzini
2012-01-12  9:59     ` Marcelo Tosatti
2012-01-12 10:03       ` Marcelo Tosatti
2012-01-12 10:12         ` Zhang, Yang Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201201110825.41752.hahn@univention.de \
    --to=hahn@univention.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).