From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ucbwm-0003Z4-QD for qemu-devel@nongnu.org; Wed, 15 May 2013 09:40:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ucbwh-0007br-Ss for qemu-devel@nongnu.org; Wed, 15 May 2013 09:40:48 -0400 Received: from ns232118.ovh.net ([178.33.234.66]:47777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ucbwh-0007bf-Bv for qemu-devel@nongnu.org; Wed, 15 May 2013 09:40:43 -0400 Message-ID: <51938F05.8060203@greensocs.com> Date: Wed, 15 May 2013 15:35:01 +0200 From: =?ISO-8859-1?Q?KONRAD_Fr=E9d=E9ric?= MIME-Version: 1.0 References: <51935609.4020705@greensocs.com> <5193849D.4070408@redhat.com> In-Reply-To: <5193849D.4070408@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC] save/restore with icount enabled. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Mark Burton , qemu-devel On 15/05/2013 14:50, Paolo Bonzini wrote: > Il 15/05/2013 11:31, KONRAD Fr=E9d=E9ric ha scritto: >> Hi, >> >> We are trying to do a simple save/restore on the VM with icount enable= d. >> >> We saw that qemu_icount_bias and qemu_icount in cpus.c are not >> saved/restored, >> and icount_extra, icount_decr in CPUState neither, so the vm_clock is = just >> growing normally after restoring the VM is that normal? >> >> We think that this is making the "replay" undeterminastic, which is ba= d for >> reverse execution. >> >> Is there a good reason for them not being saved? > No. You can probably move icount to timers_state. Something like > zeroing qemu_icount in cpu_disable_ticks() is required in order to save > qemu_icount_bias like the other members of timers_state. There is even > a dummy field that you can reuse to avoid the pain of adding a > subsection to vmstate_timers. :) > > Paolo Yes nice point :). What about icount_extra and icount_decr defined in CPU_COMMON? in=20 cpu-defs.h? int64_t icount_extra; /* Instructions until next timer event. */ \ /* Number of cycles left, with interrupt flag in high bit. = \ This allows a single read-compare-cbranch-write sequence to test = \ for both decrementer underflow and exceptions. */ \ union { = \ uint32_t u32; = \ icount_decr_u16 u16; = \ } icount_decr; = \ Thanks, Fred >> Thanks, >> Fred >> >>