From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvOj6-0001hO-GS for qemu-devel@nongnu.org; Fri, 13 Jun 2014 06:28:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvOj0-0000GX-0C for qemu-devel@nongnu.org; Fri, 13 Jun 2014 06:28:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvOiz-0000E1-NT for qemu-devel@nongnu.org; Fri, 13 Jun 2014 06:28:45 -0400 Message-ID: <539AD24A.2080806@redhat.com> Date: Fri, 13 Jun 2014 12:28:26 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1402652437-13194-1-git-send-email-sebastian.tanase@openwide.fr> <1402652437-13194-5-git-send-email-sebastian.tanase@openwide.fr> In-Reply-To: <1402652437-13194-5-git-send-email-sebastian.tanase@openwide.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH V2 4/5] icount_warp: Take into account initial offset between clocks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sebastian Tanase , qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, jeremy.rosen@openwide.fr, aliguori@amazon.com, wenchaoqemu@gmail.com, quintela@redhat.com, mjt@tls.msk.ru, mst@redhat.com, stefanha@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, michael@walle.cc, camille.begue@openwide.fr, alex@alex.org.uk, crobinso@redhat.com, pierre.lemagourou@openwide.fr, afaerber@suse.de, rth@twiddle.net Il 13/06/2014 11:40, Sebastian Tanase ha scritto: > + /* On x86 target architecture, the PIT reset function (called > + by qemu_system_reset) will end up calling qemu_clock_warp > + and then icount_warp_rt changing vm_clock_warp_start from 0 (initial > + value) to -1. This in turn will make us skip the initial offset > + between the real and virtual clocks (initially virtual clock is 0). > + Therefore we save it in clocks_offset. On ARM, we don't have this > + problem and clocks_offset will be 0. */ > + if (clocks_offset == -1 && icount_align_option) { > + clocks_offset = vm_clock_warp_start; > + } Can we instead just do clocks_offset = qemu_get_clock(QEMU_CLOCK_REALTIME); in qemu_tcg_init_vcpu? Paolo