qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Timer/clock for Linux


From: Kazu
Subject: [Qemu-devel] [PATCH] Timer/clock for Linux
Date: Wed, 12 Apr 2006 11:10:34 +0900

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]