VirtualBox

Changeset 8837

Show
Ignore:
Timestamp:
05/15/08 11:35:01 (2 months ago)
Author:
vboxsync
Message:

We are not allowed to execute KeQueryActiveProcessors? at DPC_LEVEL, so we now assume it doesn't change during runtime.
Only Win2k8 appears to support hot-adding of CPUs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/HostDrivers/Support/SUPDRV.h

    r8789 r8837  
    711711    /** Flag to force async GIP timer mode. */ 
    712712    BOOLEAN                 fForceAsyncTsc; 
     713    /** Current CPU affinity mask. */ 
     714    KAFFINITY               uAffinityMask; 
    713715#endif 
    714716#ifdef RT_OS_LINUX 
     
    760762void  VBOXCALL  supdrvOSGipResume(PSUPDRVDEVEXT pDevExt); 
    761763void  VBOXCALL  supdrvOSGipSuspend(PSUPDRVDEVEXT pDevExt); 
    762 unsigned VBOXCALL supdrvOSGetCPUCount(void); 
     764unsigned VBOXCALL supdrvOSGetCPUCount(PSUPDRVDEVEXT pDevExt); 
    763765bool VBOXCALL   supdrvOSGetForcedAsyncTscMode(PSUPDRVDEVEXT pDevExt); 
    764766#endif 
  • trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c

    r8810 r8837  
    39163916     * can be relied upon to have somewhat uniform TSC between the cpus. 
    39173917     */ 
    3918     if (supdrvOSGetCPUCount() > 1) 
     3918    if (supdrvOSGetCPUCount(pDevExt) > 1) 
    39193919    { 
    39203920        uint32_t uEAX, uEBX, uECX, uEDX; 
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r8789 r8837  
    13861386 * @returns Number of cpus. 
    13871387 */ 
    1388 unsigned VBOXCALL supdrvOSGetCPUCount(void
     1388unsigned VBOXCALL supdrvOSGetCPUCount(PSUPDRVDEVEXT pDevExt
    13891389{ 
    13901390#ifdef CONFIG_SMP 
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r8833 r8837  
    537537                } 
    538538 
     539                /* Note: We need to register a callback handler for added cpus (only available in win2k8: KeRegisterProcessorChangeCallback) */ 
     540                /* Note: We are not allowed to call KeQueryActiveProcessors at DPC_LEVEL, so we now assume cpu affinity mask does NOT change. */ 
     541                pDevExt->uAffinityMask = KeQueryActiveProcessors(); 
     542 
    539543                dprintf(("VBoxDrvNtGipInit: ulClockFreq=%ld ulClockInterval=%ld ulClockIntervalActual=%ld Phys=%x%08x\n", 
    540544                         ulClockFreq, ulClockInterval, ulClockIntervalActual, Phys.HighPart, Phys.LowPart)); 
     
    626630            KIRQL oldIrql; 
    627631 
    628             /* KeQueryActiveProcessors must be executed at IRQL < DISPATCH_LEVEL */ 
    629             Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 
    630             KAFFINITY Mask = KeQueryActiveProcessors(); 
     632            KAFFINITY Mask = pDevExt->uAffinityMask; 
    631633 
    632634            /* Raise the IRQL to DISPATCH_LEVEL so we can't be rescheduled to another cpu */ 
     
    756758 * Get the current CPU count. 
    757759 * @returns Number of cpus. 
    758  */ 
    759 unsigned VBOXCALL supdrvOSGetCPUCount(void) 
    760 
    761     /* KeQueryActiveProcessors must be executed at IRQL < DISPATCH_LEVEL */ 
    762     Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 
    763     KAFFINITY Mask = KeQueryActiveProcessors()
     760 * 
     761 * @param   pDevExt     Instance data. 
     762 */ 
     763unsigned VBOXCALL supdrvOSGetCPUCount(PSUPDRVDEVEXT pDevExt) 
     764
     765    KAFFINITY Mask = pDevExt->uAffinityMask
    764766    unsigned cCpus = 0; 
    765767    unsigned iBit; 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy