From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtv6k-0002Sx-QL for qemu-devel@nongnu.org; Thu, 27 Nov 2014 04:11:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xtv6d-0004cO-AV for qemu-devel@nongnu.org; Thu, 27 Nov 2014 04:11:26 -0500 Received: from mail.ispras.ru ([83.149.199.45]:57210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtv6d-0004cG-3G for qemu-devel@nongnu.org; Thu, 27 Nov 2014 04:11:19 -0500 From: "Pavel Dovgaluk" References: <20141126103841.7772.11864.stgit@PASHA-ISP> <20141126104049.7772.3594.stgit@PASHA-ISP> <5475B3AB.1040402@redhat.com> In-Reply-To: <5475B3AB.1040402@redhat.com> Date: Thu, 27 Nov 2014 12:11:21 +0300 Message-ID: <001301d00a22$1d21bae0$576530a0$@Dovgaluk@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: ru Subject: Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Paolo Bonzini' , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, rbilson@qnx.com, alex.bennee@linaro.org, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, afaerber@suse.de, fred.konrad@greensocs.com > From: Paolo Bonzini [mailto:pbonzini@redhat.com] > On 26/11/2014 11:40, Pavel Dovgalyuk wrote: > > + * @QEMU_CLOCK_VIRTUAL_RT: realtime clock used for icount warp > > + * > > + * This clock runs as a realtime clock, but is used for icount warp > > + * and thus should be traced with record/replay to make warp = function > > + * behave deterministically. > > */ >=20 > I think it should also stop/restart across "stop" and "cont" commands, > similar to QEMU_CLOCK_VIRTUAL. This is as simple as changing > get_clock() to cpu_get_clock(). >=20 > This way, QEMU_CLOCK_VIRTUAL_RT is "what QEMU_CLOCK_VIRTUAL does = without > -icount". This makes a lot of sense and can be merged in 2.3 > independent of the rest of the series. I've updated QEMU to master and started testing changed that you = proposed. And one more problem came out here. The problem is related to patch = 60e68042cf70f271308dc6b4b22b609d054af929 It changes x86_cpu_has_work function. And this function instead of just = checking the CPU state changes it: - return ((cs->interrupt_request & (CPU_INTERRUPT_HARD | - CPU_INTERRUPT_POLL)) && +#if !defined(CONFIG_USER_ONLY) + if (cs->interrupt_request & CPU_INTERRUPT_POLL) { + apic_poll_irq(cpu->apic_state); + cpu_reset_interrupt(cs, CPU_INTERRUPT_POLL); + } +#endif + + return ((cs->interrupt_request & CPU_INTERRUPT_HARD) && These changes break the deterministic execution, because cpu_has_work() = may be called at any moment of the execution. When POLL interrupt request is processed by x86_cpu_exec_interrupt = function, as it were before, everything is ok, because I ensure that these calls occur at the same = moments in record/replay. Pavel Dovgalyuk