From: Massimo Dal Zotto <dz@debian.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch] option -no-tsc for i386 with speedstep
Date: Mon, 25 Apr 2005 22:17:06 +0200 [thread overview]
Message-ID: <20050425201706.GA11602@dizzy.ath.cx> (raw)
In-Reply-To: <426D3DBE.9080307@bellard.org>
On Mon, Apr 25, 2005 at 08:58:06PM +0200, Fabrice Bellard wrote:
>
> This is not the best way to fix the bug. I see 4 solutions:
>
> - Compute ticks_per_sec every n seconds and update the timers accordingly.
This won't work well if an userpace scaling governor is continuously
changing the cpu frequency depending on system load (which is often
generated by qemu itself) as happens on my laptop.
> - Use a virtual cycle counter and update ticks_per_sec dynamically. This
> solution has the advantage of not needing any precise host timer (= very
> portable), but it will slow down QEMU a bit.
How could a virtual cycle counter measure real time with accuracy?
> - Use a specific driver to get the time efficiently (= without system
> call) or to know when the host frequency changes
>
> - Disable speedstep or use a CPU for which the rdtsc period does not
> vary even if the CPU frequency changes (the P4 has this feature if I
> remember correctly and all well designed CPUs should have such a feature !).
Speedstep is needed to save battery charge and my cpu, which is a
recent centrino, returns a variable rdtsc result. We are condemned
to use whichever cpu laptop makers decide to put in our laptops.
The tsc timer code in kernel 2.6 has an algorithm to compute a constant
clock rate from a variable tsc but I don't know how this could be ported
in user space. Could this code be reused, maybe with the help of kqemu?
In the meantime until we find a better solution could you give us some
explanation on why using a microseconds clock from gettimeofday instead
of rdtsc the guest os clock runs always 20% slower?
Having an almost precise system clock is a normal requirement and I
believe than even a sub-optimal solution would be better than a
constantly wrong clock like many of us are experiencing.
--
Massimo Dal Zotto
next prev parent reply other threads:[~2005-04-25 20:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-25 11:15 [Qemu-devel] [patch] option -no-tsc for i386 with speedstep Massimo Dal Zotto
2005-04-25 15:44 ` [Qemu-devel] " Heike C. Zimmerer
2005-04-25 17:07 ` [Qemu-devel] " Jim C. Brown
2005-04-25 17:28 ` Paul Brook
2005-04-25 17:44 ` Massimo Dal Zotto
2005-04-25 17:47 ` [Qemu-devel] " Heike C. Zimmerer
2005-04-25 18:58 ` [Qemu-devel] " Fabrice Bellard
2005-04-25 20:17 ` Massimo Dal Zotto [this message]
2005-04-25 20:24 ` Jonas Maebe
2005-04-25 20:38 ` Filip Navara
2005-04-25 21:03 ` Lionel Ulmer
2005-04-25 22:45 ` Taras Glek
2005-04-25 21:46 ` [Qemu-devel] [patch] option -no-tsc for i386 with speedstep (solved) Massimo Dal Zotto
2005-04-26 6:50 ` Jonas Maebe
2005-04-26 3:03 ` [Qemu-devel] [patch] option -no-tsc for i386 with speedstep Kyle Hayes
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=20050425201706.GA11602@dizzy.ath.cx \
--to=dz@debian.org \
--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).