As soon as the Windows 8 RTC issue appeared, we started our own investigation and found out, that only Intel setups were affected. But still there were quite a few questions unanswered like for example: which timer is Windows 8 actually using, are there really no issues on AMD and why is the issue fixed, when you move to an Intel when you installed Windows 8 using an AMD platform? Credit also goes to Franck D. from CPUID, who was kind enough to provide us with a tool to read out different timers and their frequency.
Background information
ACPI Timer: Also known as PM Timer is an external hardware timer
that has a fixed frequency of 3.579545 MHz.
HPET Timer: HPET stands for High Precision Event Timer, it is an external hardware timer that has a fixed frequency of 14.31818 MHz
RTC Timer: RTC stands for Real-Time Clock. It is a software timer that reads an hardware timer to count. It is being used by Windows and most softwares as the reference clock to measure time.
TSC Timer: TSC stands for TimeStampCounter. It is an hardware based timer that has a variable frequency. Its frequency
was equal to the processor's frequency and that was a problem as it would be affected by spread-spectrum and power management
features lowering the processor's clock speed implemented on newer processors. This was eventually solved
in later processor designs by making the TSC clock independent of the processor
frequency.
QPC Timer: or QueryPerformanceCounter is a native Windows API that access a high resolution timer and is used to calculate elapsed time. In other words a software timer that reads an hardware timer too. It was originally designed to use the TSC Timer but then modified to use a fixed frequency timer such as ACPI or HPET.
DMI Frequency: Better known as bus frequency is the BCLK on Intel platforms and HTT on AMD platforms. It's a fixed frequency that can be changed in the BIOS or on the fly in Windows.
[pagebreak]
Windows 8 testing on Intel
First we had to try again the tool to see if it behaves the same as before and if the new information it provides are right.
Without changing the bus frequency in windows everything is normal, all timers are displaying the same time.
Now after changing the bus frequency, in this case downclocking from 100 MHz to 95 MHz:
Here is something new, before we knew the RTC was affected but now we can see that the QPC Timer too is affected and displays the same time as the RTC Timer after 180s.
For the next test we booted at 95 MHz directly from the BIOS to show you that the issue only happens when changing the bus frequency in windows 8:
Here all timers display the same time like at 100 MHz which is normal but there is something
that changed. The QPC Timer's frequency is of 3.25 MHz now and previously it was
3.42 MHz. This is a very interesting information since it shows that changing the bus frequency has an effect on the frequency of this timer. Furthermore we see the following: 100 MHz /
3.42 MHz = 95 MHz / 3.25 MHz = ~ 29.24. So it looks like the QPC is using the
DMI frequency as timer source or a timer that makes use of the DMI frequency.
Before switching to the AMD platform here is a resume of what we learned from the Haswell testing:
- RTC and QPC Timers use the same hardware source (timer or frequency).
- This source is sensitive to bus frequency change. In other words Windows 8 seems to use an internal hardware timer
or directly the DMI frequency instead of an external hardware timer such as HPET or ACPI.
[pagebreak]
Windows 8 testing on AMD
Now lets do a fresh Windows 8 install on an AMD platform and see what happens:
Everything seems to be fine here obviously. No bus frequency changes were made, all timers have the right frequency and time.
We rebooted the system and downclocked the bus frequency from 200 to 180 in Windows 8 using an overclocking tool.
As you can see downclocking didn't affect the RTC timer nor the QPC timer on AMD, everything is fine. But, if you look closer you see the QPC timer has changed since, now at 14.32 MHz (same frequency as the HPET, meaning it uses the HPET as source), previously at 4.12 MHz (DMI?).
We will come back on this strange change on a later stage.
Like with Intel, we booted at lower bus frequency from the BIOS to see what happens:
All timers display the same time and the same frequencies as before, everything normal.
As the QPC seems to use the HPET timer (because of the same frequency) we wanted to see what happens if you disable the latter in the BIOS:
Obviously the HPET timer can't be read anymore so the tool doesn't display anything for the HPET Timer.
Furthermore as the QPC Timer is unable to use the HPET it changed source and is now using the ACPI Timer
which can be seen thanks to the displayed frequency which is the same as the ACPI Timer (3.58 MHz).
Okay now what happens when you enable HPET in BIOS again?
The QPC Timer frequency changed to 14.32 MHz again meaning it makes use of the HPET again.
Before further testing, here is a resume of what we learned from the AMD testing:
- Right after finishing the installation of Windows 8 on an AMD platform, the QPC seem to use the same kind of timer as on Intel. After reboot it uses the HPET if available or ACPI.
- By default, on AMD/Windows 8, the QPC use the HPET as timer source if this one is available, ACPI otherwise.
- RTC and QPC Timers use the same hardware timer source?
- AMD is not affected by the "Windows 8 RTC Bug"
[pagebreak]
Windows 8 installed on AMD testing on Intel
We took the drive where we installed Windows 8 on the AMD platform and plugged it to the Intel platform to see what happens.
Very interesting, now the QPC's frequency is 14.32 MHz, in other words the QPC is now using the HPET as timer source. In this case, as we saw previously changing the bus frequency from Windows isn't affecting anymore. All timers display the same time.
AMD just cured Intel!
Why, How? It's coming, be patient!
We wanted to change the name of the Windows 8 install in the boot menu so we opened bcdedit to do so and we noticed that one parameter was present on the AMD installation and not on the Intel one. This parameter is called "useplatformclock" and is set to "Yes" on the AMD installation and missing on the Intel's.
Lets change it to No and see what happens.
And here we go, the "Windows 8 RTC Bug" is back, look at the QPC Timer, its frequency tells us it's using back the
DMI frequency. We are getting somewhere.
Resume:
- The "useplatformclock" paramater is missing in the BCD of a Windows 8 installed on Intel (=> set to "No").
- The "useplatformclock" paramater is present in the BCD of a Windows 8 installed on AMD and is set to "Yes".
- Adding the "useplatformclock" and set it to yes on Intel has the effect to fix the "Windows 8 RTC Bug".
- Removing the "useplatformclock" or setting it to No brings back the "Windows 8 RTC Bug".
[pagebreak]
Is AMD really problem-free
During the previous test we made an interesting discovery which leads us the the next step, can you affect an AMD system then?
Yes
How to do it:
Run cmd as admin and paste the following line:
bcdedit /set {current} useplatformclock No
or
bcdedit /deletevalue {current} useplatformclock
But, it affects the AMD platform only on the next boot because after that, Windows 8 automatically set/add back the "useplatformclock" parameter in the BCD and set it to "Yes".
Some kind of autofix that isn't present when you install Windows 8 on an Intel
platform.
[pagebreak]
What about Windows 7
We decided to install Windows 7 on Intel to see if you can affect it the same way. By default, the "useplatformclock" parameter is also not present in the BCD, after downclocking from Windows here is what happens:
That's it, we know now what's happening, this screenshot tells us the following:
- The QPC Timer is using the DMI frequency by default, a timer source that is sensitive to bus frequency change.
- The RTC Timer is not using the same source as the QPC on Windows 7.
- The RTC Timer is not sensitive to bus frequency change meaning it uses an external hardware timer such as HPET or ACPI.
What happens if you add the "useplatformclock" parameter to Windows' 7 BCD and set it to Yes:
The QPC is now using the HPET and is not affected by bus frequency change anymore.
[pagebreak]
Conclusion
- Windows 8 benchmarking results cannot be trusted since it is very easy to fool the RTC.
- AMD can be affected too.
- Windows 7 doesn't have this issue unless somebody know how to make the RTC use the same timer source as the QPC.
In other words use the DMI as source.
- Windows 8 is the only one to blame here as the RTC is set to use the same timer source as the QPC and this one fails to use an external hardware timer source on Intel platforms and use the
DMI frequency instead due to missing/faulty BCD parameter.
- To fix it: run cmd as admin and paste "bcdedit /set {current} useplatformclock Yes"