qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: steven.seeger@flightsystems.net, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] ppc icount questions
Date: Fri, 12 Jan 2018 17:52:57 +0100	[thread overview]
Message-ID: <2177d773-9d69-f432-9353-4553e098cf1f@redhat.com> (raw)
In-Reply-To: <2465248.BadtJazF69@wirbelwind>

On 12/01/2018 17:19, Steven Seeger wrote:
> A good example of this would be that say I have an interrupt that occurs every 
> second. If I were to print out the virtual time that interrupt occurs in the 
> device model, I should see a time of:
> 
> 1.000000
> 2.000000
> 3.000000
> 4.000000
> 
> etc
> 
> Instead, I see:
> 
> 1.000000
> 2.000013
> 3.000074
> 4.000022

What is the guest doing in the meanwhile?

> When the timer function is called in the device model, I arm the timer again 
> with qemu_get_clock_ns(QEMU_CLOCK_VIRTUAL + 1000000000ULL) and expect this 
> time to be exaclty 1 second of virtual time later.
> 
> Either the virtual time is increasing without instructions executing or the 
> granularity of when the timer is serviced relative to virtual time is not 
> exact. I think the latter is happening. Is this because a tcg codeblock must 
> execute completely and this causes increases in virtual time based on the 
> number of instructions in that block, and the number of instructions varies?

virtual time increases only when instructions are executed, or when the
CPUs are idle (in the latter case, behavior depends on "-icount sleep":
if on, it increases at the same pace as real time, if off, it jumps
immediately to the next deadline).

Paolo

  reply	other threads:[~2018-01-12 16:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 16:19 [Qemu-devel] ppc icount questions Steven Seeger
2018-01-12 16:52 ` Paolo Bonzini [this message]
2018-01-12 17:12   ` Steven Seeger
2018-01-12 17:19     ` Paolo Bonzini
2018-01-12 18:03       ` Steven Seeger
2018-01-12 18:11         ` Paolo Bonzini
2018-01-12 18:35           ` Steven Seeger

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=2177d773-9d69-f432-9353-4553e098cf1f@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=steven.seeger@flightsystems.net \
    /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).