From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhOFU-00029k-4U for qemu-devel@nongnu.org; Wed, 11 Mar 2009 09:13:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhOFR-00028R-Kz for qemu-devel@nongnu.org; Wed, 11 Mar 2009 09:13:26 -0400 Received: from [199.232.76.173] (port=50764 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhOFR-00028O-Ey for qemu-devel@nongnu.org; Wed, 11 Mar 2009 09:13:25 -0400 Received: from mx20.gnu.org ([199.232.41.8]:59144) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LhOFR-0002kY-J0 for qemu-devel@nongnu.org; Wed, 11 Mar 2009 09:13:25 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhOFP-0001SQ-Ta for qemu-devel@nongnu.org; Wed, 11 Mar 2009 09:13:24 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Re: Precise guest instruction count. Date: Wed, 11 Mar 2009 13:13:20 +0000 References: <761ea48b0903110342i3317f650hd00302ca47bf9843@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903111313.20980.paul@codesourcery.com> 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 Cc: Steffen Liebergeld > By turning of all timers in Qemu I hope to disable all timer interrupts for > the guest. The results I get are not correct for the first time the code is > run, but for all subsequent runs. In the first run, the instruction count > has 12 additional instructions, which are not actually executed. > > What is the cause of those additional instructions? Probably you're not reading the correct value. Like I said, for performance reasons the counter is only valid at certain points. Try instead implementing your timer as a peripheral. Paul