|
|
 |
|
|
|
|
|
|
|
xen-bugs
[Xen-bugs] [Bug 1291] New: TSC not accurate in Windows HVM
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1291
Summary: TSC not accurate in Windows HVM
Product: Xen
Version: unstable
Platform: All
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Hypervisor
AssignedTo: xen-bugs@xxxxxxxxxxxxxxxxxxx
ReportedBy: haicheng.li@xxxxxxxxx
Environment:
------------
Service OS (ia32/ia32e/IA64): all
Guest OS (ia32/ia32e/IA64): all
Change Set: 17776
Hardware: Montevina
Bug detailed description:
--------------------------
Windows has a function, QueryPerformanceCounter to retrieve the current value
of the high-resolution performance counter. It is used with
QueryPerformanceFrequency to measure short time intervals. We can calculate the
difference between two QueryPerformanceCounter() calls. Then divide the
difference by the QueryPerformanceFrequency to determine the number of seconds
elapsed.
I did an experiment on Native Windows and HVM Windows:
Calculate the difference of QueryPerformanceCounter() before/after 10 second
and divide it by QueryPerformanceFrequency.
On Native Windows, QueryPerformanceFrequency return a value which is same as
pmtimer frequency. And the time elapsed calculated by the API is near 10s(about
9800ms).
On HVM Windows, QueryPerformanceFrequency returen a valuse which is same as TSC
timer. And the time elapsed calculated by the API always fluctuate. (Sometimes
9100+ ms, sometimes 3000+ ms).
Following is the testing codes:
#include <windows.h>
#include <stdio.h>
#include <winbase.h>
#include <stdlib.h>
#include <time.h>
#include <intsafe.h>
int __cdecl main()
{
LARGE_INTEGER Freq;
LARGE_INTEGER Begin;
LARGE_INTEGER End;
LONGLONG diff;
QueryPerformanceFrequency(&Freq);
QueryPerformanceCounter(&Begin);
Sleep(10000);
QueryPerformanceCounter(&End);
printf("%I64d\n",(End.QuadPart - Begin.QuadPart));
printf("Check 10s sleep with QueryPerformance %I64d\n",((End.QuadPart -
Begin.QuadPart)*1000/Freq.QuadPart));
printf("Frequecny is %I64d\n",Freq.QuadPart);
}
--
Configure bugmail:
http://bugzilla.xensource.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Xen-bugs mailing list
Xen-bugs@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-bugs
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-bugs] [Bug 1291] New: TSC not accurate in Windows HVM,
bugzilla-daemon <=
|
|
|
|
|