none
Windows 8 and APIC timer

    Question

  • Hello,

    My name is Franck Delattre, I'm the author of the CPU detection program CPU-Z.

    CPU-Z makes a great use of the APÏC timer for clock computation, and unfortunately, it seems that Windows 8 does use that timer as well. Starting with the customer preview, it becomes impossible to use that timer any longer, that results in a dummy clock speed report.

    So, I'm a bit out of ideas about what to do in that case, and I would not like to stop using that APIC timer, since it provides excellent results. My point is to know if there could be a way to make a shared use of that timer by Windows 8, so all programs that are using it could continue to use it.

    As a side note, most hardware detection programs are concerned : AIDA64 from Tamas Miklos, and HWINFO32 from Martin Malik. Our tools are widely used in the hardware industry for monitoring and detection purposes, this is a major issue for us, our clients and our hardware vendors partners.

    Any help would be really appreciated.

    Thanks in advance, and best regards,

    Franck Delattre

    CPUID

    Monday, March 05, 2012 2:54 PM

Answers

  • the APIC timer is not a sharable resource, nor was it safe to use in win7. you were getting lucky. In win7 the OS uses the APIC timer when the OS has turned on profiling.  What about using QPC?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 08, 2012 6:29 PM

All replies

  • Could anyone from MSFT please comment on this?

    Why is the APIC timer utilized by the system? It wouldn't be so bad if the latest release didn't stop/clear the counter (developer builds don't do this). Or is there any other way how 3rd parties could use this counter ?

    Thursday, March 08, 2012 2:00 PM
  • I'm not from Microsoft but really trying to depend on that APIC was always a bad idea.  I know of system vendors who grabbed it for their own use, and so would have shut you out.   The other problem is that since it is a single resource only one third party can use it, so relying on this could always cause problems.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Thursday, March 08, 2012 2:13 PM
  • That's true, thanks for the reply. Anyway, I haven't seen anyone else utilizing this yet.
    EDIT: Heh, just noticed the other thread on this forum about using LAPIC for timer interrupts :) http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/fe6b9b5f-5fba-4ac7-bf14-5d15b4d6d4d6

    Maybe an API for that would be nice... Still hoping to get some feedback from MSFT...



    Thursday, March 08, 2012 2:18 PM
  • the APIC timer is not a sharable resource, nor was it safe to use in win7. you were getting lucky. In win7 the OS uses the APIC timer when the OS has turned on profiling.  What about using QPC?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 08, 2012 6:29 PM
  • Thanks. Indeed, seems we all were lucky and it worked perfectly on several thousands of machines yet..

    What is QPC?

    Thursday, March 08, 2012 7:58 PM
  • QueryPerformanceCounter

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 08, 2012 8:30 PM
  • I believe this doesn't solve our problem - to calculate the current CPU clock (indirectly). The APIC counter runs at bus clock (FSB or BCLK), so we use(d) that one to get precise frequency of this clock.
    To which hardware counter is the QPC bound to?

    Thursday, March 08, 2012 8:54 PM
  • To which hardware counter is the QPC bound to?

    This is a good question. AFAIK it depends on the platform. Sometimes it uses rdtsc, sometimes HPET.

    Your proposal to enable sharing of the LAPIC timer somehow is worth consideration.  But how about old programs not aware of it?

    -- pa


    • Edited by Pavel A Thursday, March 08, 2012 9:13 PM
    Thursday, March 08, 2012 9:10 PM
  • This is a good question. AFAIK it depends on the platform. Sometimes it uses rdtsc, sometimes HPET.

    Your proposal to enable sharing of the LAPIC timer somehow is worth consideration.  But how about old programs not aware of it?

    -- pa

    TSC or HPET was what I thought too. Unfortunately neither of them can be used for our purposes. TSC is invariant on later CPUs (runs always at the HFM frequency) and HPET is independant on CPU clock.

    Programs accessing the LAPIC counter directly would be deemed "incompatible".
    For us, everything would be OK in case nobody would perform changes to the coutner running (change divider on the fly or stop/restart it). We just need to sample its values and then calculate based on the current divider used. We do not make any changes to it. So the main question for us is:
    Why does Win8 need this counter and in case it really needs it, is it really needed to reconfigure/start/stop that counter on the fly? Would it be possible to revert back to the way they have been used in previous builds (no changes to the counter config on the fly) ? That would be pretty ok for us.
    Or create an API, that would allow sharing...

    Thursday, March 08, 2012 9:40 PM
  • Or create an API, that would allow sharing...

    It even does not have to be a API - maybe just some global flag, event  and so on. If you see it raised, you don't touch the timer.

    The happiness must go on.

    /* Unhappy people may develop addiction to fruit or start seeing tiny green robots */

    -- pa

    • Edited by Pavel A Thursday, March 08, 2012 10:47 PM
    Thursday, March 08, 2012 10:39 PM