From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtaki-0007PP-PU for qemu-devel@nongnu.org; Wed, 26 Nov 2014 06:27:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xtakd-0006No-RI for qemu-devel@nongnu.org; Wed, 26 Nov 2014 06:27:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtakd-0006Ng-J2 for qemu-devel@nongnu.org; Wed, 26 Nov 2014 06:27:15 -0500 Message-ID: <5475B901.302@redhat.com> Date: Wed, 26 Nov 2014 12:26:57 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20141126103841.7772.11864.stgit@PASHA-ISP> <20141126104055.7772.18799.stgit@PASHA-ISP> In-Reply-To: <20141126104055.7772.18799.stgit@PASHA-ISP> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v5 23/31] cpus: make icount warp deterministic in replay mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.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 On 26/11/2014 11:40, Pavel Dovgalyuk wrote: > This patch adds saving and replaying warping parameters in record and replay > modes. These parameters affect on virtual clock values and therefore should > be deterministic. > > Signed-off-by: Pavel Dovgalyuk I think this makes warping behave better when you "stop" and "cont" the VM. We should apply this independent of the rest of the series. Paolo > --- > cpus.c | 14 +++++++------- > 1 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/cpus.c b/cpus.c > index 707bf34..f6a6319 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -370,7 +370,7 @@ static void icount_warp_rt(void *opaque) > > seqlock_write_lock(&timers_state.vm_clock_seqlock); > if (runstate_is_running()) { > - int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); > + int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT); > int64_t warp_delta; > > warp_delta = clock - vm_clock_warp_start; > @@ -444,7 +444,7 @@ void qemu_clock_warp(QEMUClockType type) > } > > /* We want to use the earliest deadline from ALL vm_clocks */ > - clock = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); > + clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT); > deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL); > if (deadline < 0) { > return; > @@ -537,8 +537,8 @@ void configure_icount(QemuOpts *opts, Error **errp) > return; > } > icount_align_option = qemu_opt_get_bool(opts, "align", false); > - icount_warp_timer = timer_new_ns(QEMU_CLOCK_REALTIME, > - icount_warp_rt, NULL); > + icount_warp_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT, > + icount_warp_rt, NULL); > if (strcmp(option, "auto") != 0) { > errno = 0; > icount_time_shift = strtol(option, &rem_str, 0); > @@ -562,10 +562,10 @@ void configure_icount(QemuOpts *opts, Error **errp) > the virtual time trigger catches emulated time passing too fast. > Realtime triggers occur even when idle, so use them less frequently > than VM triggers. */ > - icount_rt_timer = timer_new_ms(QEMU_CLOCK_REALTIME, > - icount_adjust_rt, NULL); > + icount_rt_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL_RT, > + icount_adjust_rt, NULL); > timer_mod(icount_rt_timer, > - qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + 1000); > + qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_RT) + 1000); > icount_vm_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, > icount_adjust_vm, NULL); > timer_mod(icount_vm_timer, >