qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Timer/clock for Linux
Date: Tue, 25 Apr 2006 22:49:58 +0100	[thread overview]
Message-ID: <200604252249.58711.paul@codesourcery.com> (raw)
In-Reply-To: <20060425213455.GA3092@mail.shareable.org>

> > QEMU reads the clock at each host wakeup, but it cannot compensate if
> > the guest OS requires a higher frequency than the host timer frequency.
> > Having a 1 ms period is definitively better to be able to run a wide
> > range of guest OSes.
>
> I was thinking that if the host is woken later than it intended
> (e.g. after 2ms with setitimer; could be any amount with any syscall
> due to other scheduling delays), then it could fake the timer chip
> time it presents to the guest for a short while as if there wasn't
> really a timing gap, 

This isn't possible with the current system. Qemu uses host signals to 
interrupt itself, ie. to stop executing guest code and process pending 
interrupts. Thus the minimum available length of a "short delay" is bounded 
buy the signal latency that you're trying to compensate for.

One solution (which is also desirable for other reasons) is to implement some 
form of guest cycle counting based on the instructions actually executed. 
Then use that as the high-precision timesource, and use some for of adaptive 
method to keep host and guest clocks in sync.

Paul

  reply	other threads:[~2006-04-25 21:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-12  2:10 [Qemu-devel] [PATCH] Timer/clock for Linux Kazu
     [not found] ` <443E93A3.5060508@weilnetz.de>
2006-04-13 18:11   ` [Qemu-devel] [PATCH] Fix message in configure Stefan Weil
2006-04-24 21:41 ` [Qemu-devel] [PATCH] Timer/clock for Linux Fabrice Bellard
2006-04-25  0:16   ` Jamie Lokier
2006-04-25 21:10     ` Fabrice Bellard
2006-04-25 21:34       ` Jamie Lokier
2006-04-25 21:49         ` Paul Brook [this message]
2006-04-26 13:01           ` Jamie Lokier
2006-04-26 14:21             ` Paul Brook
2006-04-26 17:26               ` Jamie Lokier
2006-04-25 11:04   ` NyOS

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=200604252249.58711.paul@codesourcery.com \
    --to=paul@codesourcery.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).