none
Are functions for work with Affinity in Kernel mode supported by single-core CPU? RRS feed

  • Question

  • Hi, 

    We developed Kernel mode driver, which should support Windows 7 32-bit and Windows XP Embedded 32-bit(previously it was SP2. Now we have upgraded to SP3. Problem occur under Win XPe with SP2. Under Win XPe SP3 we have not tested) at the same time. Under Windows 7 we have modern Intel multi-core CPU and under Windows XP Embedded we have 10 years old Intel single-core CPU. 

    The point is, that for supporting of Windows 7 we have added work with next functions into our driver: 

    KeQueryActiveProcessors(); 
    KeSetSystemAffinityThread(ApicAffinity); 
    KeRevertToUserAffinityThread();
    KeGetCurrentProcessorNumber();
                                    

    And after this addition we got problems on our Windows XP Embedded machines with single-core CPU's. After 2-3 days of running, - machines just stop/hangs even NumLock on the keyboard hangs. 

    I suppose, that problems occur, because described above functions are supported by Kernel API of XP Embedded, but they do not work on single-core CPU. Am I right? 

    Without these described above functions our driver works under Windows XP Embedded perfect. 

    May be you could assume, what can be the cause of our problems, that we expirience under Windows XP Embedded with single-core...

    --

    Kind regards,

    Oleksii Kyslyi 





    Thursday, March 27, 2014 9:00 AM

Answers

  • Yes these functions exist in WinXP, except of KeRevertToUserAffinityThread, which is undocumented (therefore, not recommended to use).

    The problem likely is in something other than using these functions alone. Maybe there's other bug in the driver (as you know, one never can find the last bug in any given code). On a UP machine, sync errors can manifest exactly as you described: total lock-up. Others probably will give some good advice on catching the bug, using static analyzer etc. - but IIRC the root case is the brain-<censored> design of interaction of the driver and app :-(

    Regards,

    -- pa

    Thursday, March 27, 2014 9:59 AM