Page 1 of 1

[solved] detected frequency

Posted: 8. Dec 2009, 21:21
by vthnts
Hi,

I am using VirtualBox 3.0.10 on an Intel core2duo T9400 at 2.53GHz.
Host OS: Windows Vista
Guest OS: Fedora Core 10 (Linux version 2.6.27.38-170.2.113.fc10.i686)

Everything is fine.
But I am getting a weird detected frequency anytime I reboot the Guest OS...
Here is a sample of detected frequencies:

kernel: Detected 273.212 MHz processor.
kernel: Detected 1630.253 MHz processor.
kernel: Detected 212.622 MHz processor.
kernel: Detected 105.430 MHz processor.
kernel: Detected 2425.616 MHz processor.
kernel: Detected 99.620 MHz processor.

Why is the detected frequency changing?
How can I get the maximum frequency at every reboot?
Thanks for your help!

V.

Re: detected frequency

Posted: 9. Dec 2009, 01:33
by Perryg
Is this on a laptop?
This would be set in the operating system, not in VirtualBox.

Re: detected frequency

Posted: 9. Dec 2009, 07:27
by MarkCranness
Time keeping inside a guest sometimes has problems, and such problems could affect calculations such as the CPU clock you give.
See: http://www.virtualbox.org/ticket/3135
Do you have any: 'TM: Giving up catch-up attempt...' lines in your VBox.log?

Re: detected frequency

Posted: 9. Dec 2009, 10:32
by vthnts
Is this on a laptop?
This would be set in the operating system, not in VirtualBox.
Yup, this is on a laptop.
Do you have any: 'TM: Giving up catch-up attempt...' lines in your VBox.log?
Nope.
But, um... interesting..., here is what I found in the two latest VBox logs while looking for "TM":

00:00:02.714 TM: cTSCTicksPerSecond=0x104ad0c0 (273 338 560) fTSCVirtualized=true fTSCUseRealTSC=false
00:00:01.151 TM: cTSCTicksPerSecond=0x612c7940 (1 630 304 576) fTSCVirtualized=true fTSCUseRealTSC=false

Matching the Fedora boot messages:

kernel: Detected 273.212 MHz processor.
kernel: Detected 1630.253 MHz processor.

Is there a way to fix this or is it a VirtualBox bug?

Re: detected frequency

Posted: 9. Dec 2009, 12:20
by MarkCranness
AMD or Intel CPU, family, model, and what does the fMaybeUseOffsettedHostTSC value say (on the line below)?

Try:

Code: Select all

VBoxManage setextradata "<VMName>" "VBoxInternal/TM/TSCTicksPerSecond" 2530000000
Then turn off the VirtualBox service / time-sync daemon in the guest (I'm not sure how to do that for a Linux VM) and see how the VM time tracks and also if any 'TM: Giving up catch-up attempt...' lines then appear in your VBox.log.
Maybe set 2/3 of that amount, = 1686666667 (based on a crazy theory...)

I'd say it's a VirtualBox bug. I'd say it's VirtualBox doing the best it can to handle a CPU that has a varying TSC clock?

Re: detected frequency

Posted: 9. Dec 2009, 15:44
by vthnts
It used to be fMaybeUseOffsettedHostTSC=true in previous boots.

After executing the code you provided:

00:00:00.799 TM: cTSCTicksPerSecond=0x96ccbc80 (2 530 000 000) fTSCVirtualized=true fTSCUseRealTSC=false
00:00:00.799 TM: fMaybeUseOffsettedHostTSC=false TSCTiedToExecution=false TSCNotTiedToHalt=false

And Fedora now sees the right frequency:

kernel: Detected 2529.899 MHz processor.

A good enough workaround for me.
Thanks a lot!

:D

Re: [solved] detected frequency

Posted: 10. Dec 2009, 00:28
by MarkCranness
(fMaybeUseOffsettedHostTSC was set true when VirtualBox had identified your CPU as having the 'Invariant TSC' feature.)

You might want to check that your VM is keeping time accurately.