From: renzo@cs.unibo.it (Renzo Davoli)
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] QEMU News
Date: Thu, 1 Apr 2004 10:55:25 +0200 [thread overview]
Message-ID: <20040401085525.GB4722@cs.unibo.it> (raw)
In-Reply-To: <406B18AE.7080804@bellard.org>
[-- Attachment #1: Type: text/plain, Size: 619 bytes --]
On Wed, Mar 31, 2004 at 09:14:54PM +0200, Fabrice Bellard wrote:
> - Timer API for the device drivers (similar to the Linux kernel timers).
> It will enable the use of a virtual cycle counter to have a fully
> deterministic emulation (useful for debugging).
There is a bug. On a P4 I have got a SIGFPE.
The fix is here attached.
The asm call inside cpu_get_real_ticks (file vl.c) must be defined
volatile.
It seems that otherwise somewhere (gcc?) a code optimization instead
of evaluating twice the same instruction takes the former output value,
thus the count of tick per seconds results to be zero.
ciao
renzo
[-- Attachment #2: vl.c.patch --]
[-- Type: text/plain, Size: 266 bytes --]
--- vl.c.orig 2004-04-01 10:44:57.000000000 +0200
+++ vl.c 2004-04-01 10:38:25.000000000 +0200
@@ -341,7 +341,7 @@
int64_t cpu_get_real_ticks(void)
{
int64_t val;
- asm("rdtsc" : "=A" (val));
+ asm volatile ("rdtsc" : "=A" (val));
return val;
}
next prev parent reply other threads:[~2004-04-01 8:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-31 19:14 [Qemu-devel] QEMU News Fabrice Bellard
2004-04-01 8:55 ` Renzo Davoli [this message]
2004-04-01 10:50 ` Jean-Michel POURE
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=20040401085525.GB4722@cs.unibo.it \
--to=renzo@cs.unibo.it \
--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).