From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DQ79A-0001ct-PV for qemu-devel@nongnu.org; Mon, 25 Apr 2005 13:13:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DQ799-0001cV-9e for qemu-devel@nongnu.org; Mon, 25 Apr 2005 13:13:24 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQ799-0001cS-6c for qemu-devel@nongnu.org; Mon, 25 Apr 2005 13:13:23 -0400 Received: from [128.8.10.162] (helo=po0.wam.umd.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DQ77G-0004I1-3Z for qemu-devel@nongnu.org; Mon, 25 Apr 2005 13:11:26 -0400 Date: Mon, 25 Apr 2005 13:07:52 -0400 From: "Jim C. Brown" Subject: Re: [Qemu-devel] [patch] option -no-tsc for i386 with speedstep Message-ID: <20050425170752.GA20078@jbrown.mylinuxbox.org> References: <20050425111532.GA2554@dizzy.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050425111532.GA2554@dizzy.ath.cx> 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, dz@debian.org On Mon, Apr 25, 2005 at 01:15:32PM +0200, Massimo Dal Zotto wrote: > The patch works for me but I don't know if this is the best way of fixing > this bug. If anyone has a better suggestion it is welcome. > > -- > Massimo Dal Zotto I just want to point out that your patches break qemu for almost every platform other than i386. > +#ifdef __i386__ > +static int notsc = 0; > +extern int64_t get_clock(void); > +#endif > @@ -502,6 +506,9 @@ > int64_t cpu_get_real_ticks(void) > { > int64_t val; > + if (notsc) { > + return get_clock(); > + } > asm volatile ("rdtsc" : "=A" (val)); > return val; > } You probably want to do this, because notsc is only declared for the i386 platform. int64_t cpu_get_real_ticks(void) { int64_t val; +#ifdef __i386__ + if (notsc) { + return get_clock(); + } +#endif asm volatile ("rdtsc" : "=A" (val)); return val; } -- Infinite complexity begets infinite beauty. Infinite precision begets infinite perfection.