From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kvbll-0002Wr-NH for qemu-devel@nongnu.org; Thu, 30 Oct 2008 13:57:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kvblj-0002WY-Nw for qemu-devel@nongnu.org; Thu, 30 Oct 2008 13:57:16 -0400 Received: from [199.232.76.173] (port=39761 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kvblj-0002WV-Fl for qemu-devel@nongnu.org; Thu, 30 Oct 2008 13:57:15 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:42257) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kvblj-0000bS-6A for qemu-devel@nongnu.org; Thu, 30 Oct 2008 13:57:15 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e3.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m9UHutbp026936 for ; Thu, 30 Oct 2008 13:56:55 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m9UHutcR057326 for ; Thu, 30 Oct 2008 13:56:55 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m9UHusMQ027662 for ; Thu, 30 Oct 2008 13:56:54 -0400 Subject: Re: [Qemu-devel] [PATCH 1/2] Add HPET emulation to qemu (v3) From: Beth Kon In-Reply-To: <49059CA9.30007@il.qumranet.com> References: <1224245854.3399.7.camel@beth-laptop> <20081017154932.GA14229@shareable.org> <1224529724.3399.27.camel@beth-laptop> <49059CA9.30007@il.qumranet.com> Content-Type: text/plain Date: Thu, 30 Oct 2008 13:57:10 -0400 Message-Id: <1225389430.2933.2.camel@beth-laptop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dor Laor Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Alexander Graf On Mon, 2008-10-27 at 12:49 +0200, Dor Laor wrote: > Beth Kon wrote: > > On Fri, 2008-10-17 at 16:49 +0100, Jamie Lokier wrote: > > > > > Beth Kon wrote: > > > > > > > Clock drift on Linux is in the range of .017% - .019%, loaded and unloaded. I > > > > haven't found a straightforward way to test on Windows and would appreciate > > > > any pointers to existing approaches. > > > > > > > Is there any reason why there should be any clock drift, when the > > > guest is using a non-PIT clock? > > > > > > I'm probably being naive, but with 32-bit or 64-bit HPET counters > > > available to the guest, and accurate values from the CMOS clock > > > emulation, I don't see why drift would accumulate over the long term > > > relative to the host clock. > > > > > > > I was measuring with ntpdate, so the drift is with respect to the ntp > > server pool, not the host clock. But in any case, since timer interrupts > > and reads of the hpet counter are at the mercy of the host scheduler > > (i.e., the qemu process can be swapped out at any time during hpet read > > or timer expiration), I'd guess there would always be some amount of > > inaccuracy. Also, qemu checks for timer expiration (qemu_run_timers) as > > part of a bigger loop (main_loop_wait), so the varying amounts of work > > to do elsewhere in the loop from iteration to iteration would also > > introduce irregular delays. > > > This is exactly why hpet as the other clock emulation in qemu (pit, > rtc, pm?) need > to check whether their irq was really injected. Gleb sent patches for > the rtc, pit. > The idea is to check with the irq chip if the injected irq was really > successful. > I assume these are the patches you're referring to? http://thread.gmane.org/gmane.comp.emulators.kvm.devel/18974/focus=18977 Looks like they were never merged. Does anyone know the history on that? Also, HPET generates edge-triggered interrupts (as dictated by Linux and Windows) so I'm not sure if this scheme could work for it. > Dor -- Elizabeth Kon (Beth) IBM Linux Technology Center Open Hypervisor Team email: eak@us.ibm.com