From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X30jY-0002jU-RM for qemu-devel@nongnu.org; Fri, 04 Jul 2014 06:28:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X30jR-0006L3-Aq for qemu-devel@nongnu.org; Fri, 04 Jul 2014 06:28:48 -0400 Received: from greensocs.com ([178.33.234.66]:59898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X30jR-0006Ky-4a for qemu-devel@nongnu.org; Fri, 04 Jul 2014 06:28:41 -0400 Message-ID: <53B681D7.5020005@greensocs.com> Date: Fri, 04 Jul 2014 12:28:39 +0200 From: Frederic Konrad MIME-Version: 1.0 References: <1404231220-17339-1-git-send-email-fred.konrad@greensocs.com> <53B65823.3050006@greensocs.com> <53B65E76.4040900@redhat.com> In-Reply-To: <53B65E76.4040900@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] icount: warp in the main_loop. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, mark.burton@greensocs.com On 04/07/2014 09:57, Paolo Bonzini wrote: > Il 04/07/2014 09:30, Frederic Konrad ha scritto: >>> + /* >>> + * In icount mode, sometimes the VCPU is blocked and an event is >>> needed to >>> + * continue. >>> + * Just warp to make the time grows and have a chance to run the >>> CPU. >>> + */ >>> + qemu_clock_warp(QEMU_CLOCK_VIRTUAL); >>> return ret; >>> } >>> >> Paolo, >> You mentioned some icount patches (I can't find where) can you point me >> to them? >> Did you already had this bug? > > Why is this needed? It's possible that a qemu_clock_warp code is > missing somewhere, but for timers it should be handled here: > > static void timerlist_rearm(QEMUTimerList *timer_list) > { > /* Interrupt execution to force deadline recalculation. */ > qemu_clock_warp(timer_list->clock->type); > timerlist_notify(timer_list); > } > > If the VCPU is blocked, it will set vm_clock_warp_start to the > realtime clock value ("clock") a QEMU_CLOCK_REALTIME timer to the next > deadline ("clock + deadline"). At the next deadline, icount_warp_rt > will increase QEMU_CLOCK_VIRTUAL by "clock - vm_clock_warp_state" > which should trigger the clock event. Right, but when I put a timer eg on QEMU_VIRTUAL_CLOCK the guest is stuck. icount_warp_rt is not called neither qemu_clock_warp(..).. So yes as you said seems a qemu_clock_warp is missing somewhere. Shouldn't icount_warp_rt called regularly to advance the time when the VCPU is not executing? Thanks, Fred > > Paolo