From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 3/3] stop the periodic RTC update timer
Date: Thu, 12 Jan 2012 08:20:31 -0200 [thread overview]
Message-ID: <20120112102031.GA31635@amt.cnet> (raw)
In-Reply-To: <4F0EA739.1040707@redhat.com>
On Thu, Jan 12, 2012 at 10:26:17AM +0100, Paolo Bonzini wrote:
> On 01/12/2012 01:00 AM, Zhang, Yang Z wrote:
> >>Regarding the UIP bit, a guest could read it in a loop and wait
> >>for the value to change. But you can emulate it in
> >>cmos_ioport_read by reading the host time, that is, return 1
> >>during 244us, 0 for remaining of the second, and have that in
> >>sync with update-cycle-ended interrupt if its enabled.
> >
> >Yes. Guest may use the loop to read RTC, but the point is the guest
> >is waiting for the UIP changed to 0. If this bit always equal to 0 ,
> >guest will never go into the loop. For real RTC, this may wrong,
> >because the RTC cannot give you the valid value during the update
> >cycle. But the virtual RTC doesn't' need this logic, whenever you
> >read it, it will always return the right value to you.
>
> The point is not _correctness_. It is _atomicity_.
Quoting you earlier
"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."
Agree with the first point, but the second, the emulated RTC never
returns a bogus read.
So what is your point, exactly? And what that has to do with UIP always
returning 0?
next prev parent reply other threads:[~2012-01-12 10:21 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
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 [this message]
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=20120112102031.GA31635@amt.cnet \
--to=mtosatti@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--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).