Skip to contentSkip to conversation

Timing problems

Qemu-devel Alexander Toresson 5 participants 6 messages Jun 29, 2005 – Nov 8, 2005

lore
Share & tools
lore
#0 lore raw

I'm running windows 2000 in qemu 0.7.0 with kqemu 0.6.2-1 on i386 debian linux. First thing I tried to do was to run a benchmark program (qemu w/o kqemu vs qemu w/ kqemu). I got strange results, and I also noted that timing didn't seem to be that good, so I re-tried to run the benchmark program, but with the date & clock settings window in the background. This is the result: The more cpu that is used in the virtual cpu, the faster time flies by. For example, when it's nearly idle, time is too slow. If it goes from idle to 100% cpu-use, time flies by at 5x the speed it should. This is true both when I use kqemu and when I don't. This cpu is capable of speedstep, but I have disabled it while doing this test. I think I would get even more weird results if I enabled it.
This makes it impossible to run a benchmark and get any useful results out of it. Also, trying to run a game on qemu would be a disaster. However, running normal programs aren't any problem. Except that I have to be very quick when changing resolution in w2k (it should wait 15s, now time flies away and those 15 becomes 2s :)).

Before compiling qemu 0.7.0 with kqemu 0.6.2-1, I ran qemu 0.6.something, taken from the debian testing repository, and it had the same problem.

Regards, Alexander Toresson

PS. I'm susprised nobody has seen this problem before. Is it just me who experience it?

#1 lore raw
Quoted 6 lines · Alexander Toresson

I'm running windows 2000 in qemu 0.7.0 with kqemu 0.6.2-1 on i386 debian linux. First thing I tried to do was to run a benchmark program (qemu w/o kqemu vs qemu w/ kqemu). I got strange results, and I also noted that timing didn't seem to be that good, so I re-tried to run the benchmark program, but with the date & clock settings window in the background. This is the result: The more cpu that is used in the

Quoted 8 lines

virtual cpu, the faster time flies by. For example, when it's nearly idle, time is too slow. If it goes from idle to 100% cpu-use, time flies by at 5x the speed it should. This is true both when I use kqemu and when I don't. This cpu is capable of speedstep, but I have disabled it while doing this test. I think I would get even more weird results if I enabled it.
This makes it impossible to run a benchmark and get any useful results out of it. Also, trying to run a game on qemu would be a disaster.

Not necessarily, Age of Empires 2 runs quite well under Qemu + Win98SE (on an Athlon 2600+, host: Debian Linux, kernel 2.6.9).

Quoted 4 lines

However, running normal programs aren't any problem. Except that I have to be very quick when changing resolution in w2k (it should wait 15s, now time flies away and those 15 becomes 2s :)).

Quoted 8 lines

Before compiling qemu 0.7.0 with kqemu 0.6.2-1, I ran qemu 0.6.something, taken from the debian testing repository, and it had the same problem.

Regards, Alexander Toresson

PS. I'm susprised nobody has seen this problem before. Is it just me who experience it?

Although I use Visual Studio 5 and Age of Empires 2 inside Qemu (with Win98SE and Win2k), I never noticed such problems, and the Windows clock always seemed quite right (and VC++ stresses the CPU quite a lot!). But admittedly I never ran benchmarks or had a closer look at the guest system time.

Regards,
Oliver Gerlich

Quoted 8 lines

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

#3 lore raw
In reply to Alexander Toresson
Quoted 18 lines · Alexander Toresson

I'm running windows 2000 in qemu 0.7.0 with kqemu 0.6.2-1 on i386 debian linux. First thing I tried to do was to run a benchmark program (qemu w/o kqemu vs qemu w/ kqemu). I got strange results, and I also noted that timing didn't seem to be that good, so I re-tried to run the benchmark program, but with the date & clock settings window in the background. This is the result: The more cpu that is used in the virtual cpu, the faster time flies by. For example, when it's nearly idle, time is too slow. If it goes from idle to 100% cpu-use, time flies by at 5x the speed it should. This is true both when I use kqemu and when I don't. This cpu is capable of speedstep, but I have disabled it while doing this test. I think I would get even more weird results if I enabled it.
This makes it impossible to run a benchmark and get any useful results out of it. Also, trying to run a game on qemu would be a disaster. However, running normal programs aren't any problem. Except that I have to be very quick when changing resolution in w2k (it should wait 15s, now time flies away and those 15 becomes 2s :)).

Quoted 9 lines

Before compiling qemu 0.7.0 with kqemu 0.6.2-1, I ran qemu 0.6.something, taken from the debian testing repository, and it had the same problem.

Regards, Alexander Toresson

PS. I'm susprised nobody has seen this problem before. Is it just me who experience it?

CPU frequency scaling might be the cause. If your OS uses speedstep or similar tech QEMU timers will misbehave.

Signature · 1 line
mailto:[email protected]
#2 lore raw
In reply to Oliver Gerlich
Quoted 29 lines · Oliver Gerlich
Quoted 6 lines · Alexander Toresson

I'm running windows 2000 in qemu 0.7.0 with kqemu 0.6.2-1 on i386 debian linux. First thing I tried to do was to run a benchmark program (qemu w/o kqemu vs qemu w/ kqemu). I got strange results, and I also noted that timing didn't seem to be that good, so I re-tried to run the benchmark program, but with the date & clock settings window in the background. This is the result: The more cpu that is used in the

Quoted 8 lines

virtual cpu, the faster time flies by. For example, when it's nearly idle, time is too slow. If it goes from idle to 100% cpu-use, time flies by at 5x the speed it should. This is true both when I use kqemu and when I don't. This cpu is capable of speedstep, but I have disabled it while doing this test. I think I would get even more weird results if I enabled it.
This makes it impossible to run a benchmark and get any useful results out of it. Also, trying to run a game on qemu would be a disaster.

Not necessarily, Age of Empires 2 runs quite well under Qemu + Win98SE (on an Athlon 2600+, host: Debian Linux, kernel 2.6.9).

Quoted 10 lines

However, running normal programs aren't any problem. Except that I have to be very quick when changing resolution in w2k (it should wait 15s, now time flies away and those 15 becomes 2s :)).

Before compiling qemu 0.7.0 with kqemu 0.6.2-1, I ran qemu 0.6.something, taken from the debian testing repository, and it had the same problem.

Regards, Alexander Toresson

Quoted 9 lines
Quoted 2 lines

PS. I'm susprised nobody has seen this problem before. Is it just me who experience it?

Although I use Visual Studio 5 and Age of Empires 2 inside Qemu (with Win98SE and Win2k), I never noticed such problems, and the Windows clock always seemed quite right (and VC++ stresses the CPU quite a lot!). But admittedly I never ran benchmarks or had a closer look at the guest system time.

Well, it happens any time I stress the cpu. Having the clock settings window open and then double-clicking on My Documents is enough to see the clock accelerate and then go back to normal speed.

Quoted 2 lines · malc

CPU frequency scaling might be the cause. If your OS uses speedstep or similar tech QEMU timers will misbehave.

This was tested when speedstep was disabled, which I did by shutting down powernowd. Then cat /proc/cpuinfo shows 1.86ghz constantly, which is the maximum cpu frequency.

Regards, Alexander Toresson

#4 lore raw
In reply to Alexander Toresson
Quoted 4 lines · Alexander Toresson <alexander.toresson <at> gmail.com> writes:

time flies by at 5x the speed it should.

PS. I'm susprised nobody has seen this problem before. Is it just me who experience it?

No, I experience this as well.

I'm running Qemu 0.7.2 with Linux 2.6.14 (vanilla kernel) as host OS and Windows XP Professional as guest OS. If the VM is running and actively using CPU, time runs much faster in the guest than in the host. On the other hand, if the VM is mostly idle, time is slower in the guest than in the host OS.

This odd clock behavior seems to cause other problems in the guest OS, particularly during boot/service initialization.

I can recreate this behavior with or without KQemu.

I can recreate this behavior with or without CPU frequency scaling enabled.

It is frustrating, and I would be very happy if someone could suggest a fix or workaround.

Thanks,
Mike Smith
[email protected]

#5 lore raw

Hi,
people have had this problem with SpeedStep machines, where it is related to qemu timing being based on CPU cycle count, which is thereby messed up.
Since it seems to occur with frequency scaling disabled as well, could this be related to running on a HyperThreading CPU? Not sure what happens there with the cycle counts, but to verify, you could try to apply my previously posted patch that substituted the built-in mechanism with realtime clock calls (was for 0.7.1, though, I think). Best,
Sven

Am Montag, den 07.11.2005, 22:46 +0000 schrieb Michael Smith:

Quoted 37 lines
Quoted 4 lines · Alexander Toresson <alexander.toresson <at> gmail.com> writes:

time flies by at 5x the speed it should.

PS. I'm susprised nobody has seen this problem before. Is it just me who experience it?

No, I experience this as well.

I'm running Qemu 0.7.2 with Linux 2.6.14 (vanilla kernel) as host OS and Windows XP Professional as guest OS. If the VM is running and actively using CPU, time runs much faster in the guest than in the host. On the other hand, if the VM is mostly idle, time is slower in the guest than in the host OS.

This odd clock behavior seems to cause other problems in the guest OS, particularly during boot/service initialization.

I can recreate this behavior with or without KQemu.

I can recreate this behavior with or without CPU frequency scaling enabled.

It is frustrating, and I would be very happy if someone could suggest a fix or workaround.

Thanks,
Mike Smith
[email protected]

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel