In debugging a virtbench bug on KVM, I seemed to uncover some weird behaviors with gettimeofday() and KVM with newer kernels. The attached program will run a tight loop of code a certain number of times and measure it's duration with gettimeofday(). With a stock ubuntu 2.6.20-15 kernel, I see pretty reasonable behavior in the guest: ./loop 0 0 ./loop 100 0.5 ./loop 10000 0.150 ./loop 1000000 0.15954 Note the format is . so it's behaving quite well. Now, with a 2.6.22-rc4 kernel, using the same kernel config (saying N to all of the new features), we get: ./loop 0 0.16 ./loop 100 0.0 ./loop 10000 0.0 ./loop 1000000 0.20008 It's pretty erratic. If I run if a few times at any rate, sometimes I get 0.0 and sometimes I get a more sane result. I've attached the .config for 2.6.22-rc4 and loop.c. I haven't yet starting bisecting KVM versions and kernel versions. I know the time stuff has changed a lot in 2.6.21,22 so I'm wondering if someone has an idea of what the problem could be. The same problem occurs with AMD and Intel. Regards, Anthony Liguori