From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FY8s2-00009j-2t for qemu-devel@nongnu.org; Mon, 24 Apr 2006 17:45:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FY8s0-00008Z-RL for qemu-devel@nongnu.org; Mon, 24 Apr 2006 17:45:25 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FY8s0-00008L-LU for qemu-devel@nongnu.org; Mon, 24 Apr 2006 17:45:24 -0400 Received: from [84.96.92.55] (helo=smtP.neuf.fr) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FY8uK-0008UA-AI for qemu-devel@nongnu.org; Mon, 24 Apr 2006 17:47:48 -0400 Received: from [84.102.211.156] by sp604004mt.gpm.neuf.ld (Sun Java System Messaging Server 6.2-5.05 (built Feb 16 2006)) with ESMTP id <0IY800G06XMBASL0@sp604004mt.gpm.neuf.ld> for qemu-devel@nongnu.org; Mon, 24 Apr 2006 23:42:11 +0200 (CEST) Date: Mon, 24 Apr 2006 23:41:23 +0200 From: Fabrice Bellard Subject: Re: [Qemu-devel] [PATCH] Timer/clock for Linux In-reply-to: <001501c65dd6$484d7c60$0464a8c0@athlon> Message-id: <444D4603.6090007@bellard.org> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT References: <001501c65dd6$484d7c60$0464a8c0@athlon> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, Can other people confirm that it is better to always use /dev/rtc on Linux ? Is there a way to get the real resolution of the host timer ? Fabrice. Kazu wrote: > Hi, > > I made a little patch of timer/clock for Linux host. It always trys to use > /dev/rtc. > getitimer doesn't report a correct interval value. > > http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20060407-linux-timer.patch > > To get a precise timer/clock., do: > (1) Set max-user-freq 1024 as root. > > [Linux host] # echo 1024 > /proc/sys/dev/rtc/max-user-freq > > It is necessary to set it everytime you reboot the host OS. Write it to > /etc/rc.d/rc.local. > > (2) Apply the patch and build a binary. > > (1) is necessary and (2) is optional. I think latest kernel doesn't need the > patch. When I use 2.6.11-1.11369_FC4 host, it is necessary to apply (2). But > when 2.6.15-1.1831_FC4 host, it is not. > > If you don't set max-user-freq, the clock in Windows 2000 guest is unstable > while IE is running. > > Timer uses RTC(Real Time Clock). If it can not be used, setitimer/getitimer > are used. > If the timer's interval is set to 999 us, the interval becomes 2ms. It is > the > cause that a guest OS clock is 1/2 slow than the real time. Recent Linux > kernel is 4ms and clock is 1/4 slow. > > > Tested environments are: > Windows 2000 guest /FC4 kernel-2.6.11-1.1831_FC4 host > FC4-i386-rescuecd.iso guest/FC4 kernel-2.6.11-1.1831_FC4 host > > Windows 2000 guest /FC4 kernel-2.6.15-1.1831_FC4 host > FC4-i386-rescuecd.iso guest/FC4 kernel-2.6.15-1.1831_FC4 host > > I have not tested Linux 2.4 host. > The clock of guest OS on x86_64 host is unstable. 1ms interval interrupts > occure but the clock in Windows 2000 guest on x86_64 host doesn't work well. > > Regards, > Kazu > > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel > >