From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2yNY-0003RW-Th for qemu-devel@nongnu.org; Fri, 04 Jul 2014 03:58:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2yNS-00024i-PF for qemu-devel@nongnu.org; Fri, 04 Jul 2014 03:57:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2yNS-00022j-Hk for qemu-devel@nongnu.org; Fri, 04 Jul 2014 03:57:50 -0400 Message-ID: <53B65E76.4040900@redhat.com> Date: Fri, 04 Jul 2014 09:57:42 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1404231220-17339-1-git-send-email-fred.konrad@greensocs.com> <53B65823.3050006@greensocs.com> In-Reply-To: <53B65823.3050006@greensocs.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: Frederic Konrad , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, mark.burton@greensocs.com 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. Paolo