qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Timer/clock for Linux
@ 2006-04-12  2:10 Kazu
       [not found] ` <443E93A3.5060508@weilnetz.de>
  2006-04-24 21:41 ` [Qemu-devel] [PATCH] Timer/clock for Linux Fabrice Bellard
  0 siblings, 2 replies; 11+ messages in thread
From: Kazu @ 2006-04-12  2:10 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-04-26 17:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-12  2:10 [Qemu-devel] [PATCH] Timer/clock for Linux Kazu
     [not found] ` <443E93A3.5060508@weilnetz.de>
2006-04-13 18:11   ` [Qemu-devel] [PATCH] Fix message in configure Stefan Weil
2006-04-24 21:41 ` [Qemu-devel] [PATCH] Timer/clock for Linux Fabrice Bellard
2006-04-25  0:16   ` Jamie Lokier
2006-04-25 21:10     ` Fabrice Bellard
2006-04-25 21:34       ` Jamie Lokier
2006-04-25 21:49         ` Paul Brook
2006-04-26 13:01           ` Jamie Lokier
2006-04-26 14:21             ` Paul Brook
2006-04-26 17:26               ` Jamie Lokier
2006-04-25 11:04   ` NyOS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).