Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B8xzU-0006yj-Ee for qemu-devel@nongnu.org; Thu, 01 Apr 2004 03:56:00 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B8xyx-0006t1-E1 for qemu-devel@nongnu.org; Thu, 01 Apr 2004 03:55:58 -0500 Received: from [130.136.10.114] (helo=pob.cs.unibo.it) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B8xyx-0006sr-3U for qemu-devel@nongnu.org; Thu, 01 Apr 2004 03:55:27 -0500 Date: Thu, 1 Apr 2004 10:55:25 +0200 Subject: Re: [Qemu-devel] QEMU News Message-ID: <20040401085525.GB4722@cs.unibo.it> References: <406B18AE.7080804@bellard.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: <406B18AE.7080804@bellard.org> From: renzo@cs.unibo.it (Renzo Davoli) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="vl.c.patch" --- 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; } --HcAYCG3uE/tztfnV--