From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cR1Px-0006bO-HI for qemu-devel@nongnu.org; Tue, 10 Jan 2017 13:45:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cR1Pw-0002lT-IE for qemu-devel@nongnu.org; Tue, 10 Jan 2017 13:45:09 -0500 Received: from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244]:36314) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cR1Pw-0002l5-Bs for qemu-devel@nongnu.org; Tue, 10 Jan 2017 13:45:08 -0500 Received: by mail-io0-x244.google.com with SMTP id q20so12349613ioi.3 for ; Tue, 10 Jan 2017 10:45:08 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Max Filippov Date: Tue, 10 Jan 2017 10:45:06 -0800 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] implementing architectural timers using QEMU timers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Frederic Konrad Cc: qemu-devel , Pavel Dovgaluk , Alex Bligh , Richard Henderson On Tue, Jan 10, 2017 at 1:10 AM, Frederic Konrad wrote: > On 01/09/2017 04:18 PM, Max Filippov wrote: >> I'm trying to reimplement xtensa CCOUNT (cycle counter) and >> CCOMPARE (CCOUNT-based timer interrupts) using QEMU >> timers. That is CCOUNT value is derived from the >> QEMU_CLOCK_VIRTUAL clock and CCOMPARE interrupts are >> generated from the QEMU_CLOCK_VIRTUAL timer callbacks. >> The code is here: >> https://github.com/OSLL/qemu-xtensa/commits/xtensa-ccount >> >> I've got the following issues doing that: >> >> - I thought that could be improved in -icount mode, so I tried that. >> It is better with -icount, but it's still not 100% accurate. That is >> I was able to observe guest reading QEMU clock value that is >> past QEMU timer deadline before that timer callback was >> invoked. >> >> That sounds like a bug to me, is it? > > Did you try "sleep" icount option? > > eg: > -icount 1,sleep=off That doesn't seem to change anything. -- Thanks. -- Max