From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNM7A-0003VM-IQ for qemu-devel@nongnu.org; Mon, 16 Feb 2015 08:53:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNM74-0007lM-Gc for qemu-devel@nongnu.org; Mon, 16 Feb 2015 08:53:32 -0500 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:51415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNM74-0007l6-9N for qemu-devel@nongnu.org; Mon, 16 Feb 2015 08:53:26 -0500 Received: by mail-wi0-f182.google.com with SMTP id l15so25628053wiw.3 for ; Mon, 16 Feb 2015 05:53:25 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54E1F650.5080508@redhat.com> Date: Mon, 16 Feb 2015 14:53:20 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20150122085127.5276.53895.stgit@PASHA-ISP.def.inno> <20150122085215.5276.8878.stgit@PASHA-ISP.def.inno> <54C9FE31.4090404@redhat.com> <001801d03ee3$c8cb7660$5a626320$@Dovgaluk@ispras.ru> <54CF6FA9.7090600@redhat.com> <28583.7738695138$1422880978@news.gmane.org> <54CF793D.6070404@redhat.com> <6071.25815372473$1424089600@news.gmane.org> <54E1E9B1.7090900@redhat.com> <8198.56250095672$1424093273@news.gmane.org> <54E1F14E.3000107@redhat.com> <39577.5216319182$1424093895@news.gmane.org> In-Reply-To: <39577.5216319182$1424093895@news.gmane.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v8 08/21] cpu: replay instructions sequence List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgaluk , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, alex.bennee@linaro.org, afaerber@suse.de, fred.konrad@greensocs.com On 16/02/2015 14:37, Pavel Dovgaluk wrote: >> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo Bonzini >> On 16/02/2015 14:27, Pavel Dovgaluk wrote: >>>> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo Bonzini >>>> On 16/02/2015 13:26, Pavel Dovgaluk wrote: >>>>>>>>> I think in this case there are no events at all - just reading timers values >>>>>>>>> that were made while recording. >>>>>>>>> We have to replay these reads by waking iothread. >>>>>>> >>>>>>> I think the right place for this is in replay_read_next_clock then. >>>>> It doesn't fit. Log file is not read until all instructions are executed. >>>>> And the next read from the file should be performed by iothread which should >>>>> be notified and waked up. >>>> >>>> I still don't understand. If you're getting EXCP_INTERRUPT it means: >>>> >>>> 1) that cpu_signal was called >>> >>> No, it isn't. That is the branch when icount is expired. >>> And when it is expired in replay mode we have to wake up iothread, >>> because nobody will care about this. >> >> Then it's done here in qemu_tcg_cpu_thread_fn: > > Do you mean that I should put iothread notification right here? It already notifies the iothread. > Or that this code duplicates my patch? > If the second one then I guess that it doesn't help and I need to make additional checks about it. Yes. You can modify your patch to do: int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL); if (deadline == 0) { qemu_clock_notify(QEMU_CLOCK_VIRTUAL); } instead of qemu_notify_event(), and remove these lines from qemu_tcg_cpu_thread_fn. Paolo >> >> if (use_icount) { >> int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL); >> >> if (deadline == 0) { >> qemu_clock_notify(QEMU_CLOCK_VIRTUAL); >> } >> } >> >> If you need to move the 4 lines inside the if elsewhere, that I guess it's okay. > > Pavel Dovgalyuk > > >