From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzr23-0005kY-O7 for qemu-devel@nongnu.org; Thu, 18 Jul 2013 12:26:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uzr22-0002Uv-JF for qemu-devel@nongnu.org; Thu, 18 Jul 2013 12:26:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzr22-0002Uo-AL for qemu-devel@nongnu.org; Thu, 18 Jul 2013 12:26:18 -0400 Message-ID: <51E8171E.6070305@redhat.com> Date: Thu, 18 Jul 2013 18:26:06 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1374159757-16383-1-git-send-email-fred.konrad@greensocs.com> <1374159757-16383-2-git-send-email-fred.konrad@greensocs.com> <51E80B66.9010700@redhat.com> <51E8169E.9080100@greensocs.com> In-Reply-To: <51E8169E.9080100@greensocs.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 1/3] icount: base rt_clock on icount. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Frederic Konrad Cc: mark.burton@greensocs.com, qemu-devel@nongnu.org Il 18/07/2013 18:23, Frederic Konrad ha scritto: > On 18/07/2013 17:36, Paolo Bonzini wrote: >> Il 18/07/2013 17:02, fred.konrad@greensocs.com ha scritto: >>> From: KONRAD Frederic >>> >>> This bases rt_clock on icount, as vm_clock. >>> So vm_clock = rt_clock. >>> >>> Signed-off-by: KONRAD Frederic >>> --- >>> qemu-timer.c | 6 +++++- >>> 1 file changed, 5 insertions(+), 1 deletion(-) >>> >>> diff --git a/qemu-timer.c b/qemu-timer.c >>> index b2d95e2..6c607e5 100644 >>> --- a/qemu-timer.c >>> +++ b/qemu-timer.c >>> @@ -401,7 +401,11 @@ int64_t qemu_get_clock_ns(QEMUClock *clock) >>> switch(clock->type) { >>> case QEMU_CLOCK_REALTIME: >>> - return get_clock(); >>> + if (use_icount) { >>> + return cpu_get_icount(); >>> + } else { >>> + return get_clock(); >>> + } >>> default: >>> case QEMU_CLOCK_VIRTUAL: >>> if (use_icount) { >>> >> rt_clock is very little used in general. You should use "-rtc clock=vm" >> if you want to base the RTC on vm_clock. >> >> Paolo > > True but it seems used in some place: > > For example: ui/console.c: > ds->gui_timer = qemu_new_timer_ms(rt_clock, gui_update, ds); > > Maybe it can cause trouble no? In theory it is only used in places where it shouldn't cause trouble (those that do should use the similarly named rtc_clock variable). Paolo