qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [patch] option -no-tsc for i386 with speedstep


From: Massimo Dal Zotto
Subject: [Qemu-devel] [patch] option -no-tsc for i386 with speedstep
Date: Mon, 25 Apr 2005 13:15:32 +0200
User-agent: Mutt/1.5.6+20040523i

When qemu runs on an i386 cpu with speedstep enabled the clock of the
guest os is not in sync with the clock on the host os because the
vm_timer used for irq 0 generates interrupts at wrong rate when
the host cpu frequency changes.

The problem is that the vm_timer uses the rdtsc instruction and the value
of ticks_per_sec, computed at start time, for calculating the expire time
of vm_timers. While ticks_per_sec is constant the values returned by
rdtsc are dependent on the current cpu clock, which is not constant if
speedstep is used.

The problem can be cleary observed by running "xclock -update 1" in the
guest os and observing how the clock speed varies with the cpu freqency.

The following patch fixes the problem by adding a new option -no-tsc for
the i386 architecture which can be used to disable rdtsc when running on
a cpu with speedstep enabled.

The patch works for me but I don't know if this is the best way of fixing
this bug. If anyone has a better suggestion it is welcome.

-- 
Massimo Dal Zotto <address@hidden>

Attachment: qemu-notsc.patch
Description: Text document


reply via email to

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