VirtualBox

Ignore:
Timestamp:
Dec 17, 2009 1:10:34 PM (15 years ago)
Author:
vboxsync
Message:

SUPDrv: RTMpOnAll should be run at PASSIVE_LEVEL on windows, so don't use fast mutexes for protection GIP on Windows.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r25460 r25461  
    357357    memset(pDevExt, 0, sizeof(*pDevExt));
    358358    rc = RTSpinlockCreate(&pDevExt->Spinlock);
    359     if (!rc)
     359    if (RT_SUCCESS(rc))
    360360    {
    361361#ifdef SUPDRV_USE_MUTEX_FOR_LDR
     
    364364        rc = RTSemFastMutexCreate(&pDevExt->mtxLdr);
    365365#endif
    366         if (!rc)
     366        if (RT_SUCCESS(rc))
    367367        {
    368368            rc = RTSemFastMutexCreate(&pDevExt->mtxComponentFactory);
    369             if (!rc)
     369            if (RT_SUCCESS(rc))
    370370            {
     371#ifdef SUPDRV_USE_MUTEX_FOR_LDR
     372                rc = RTSemMutexCreate(&pDevExt->mtxGip);
     373#else
    371374                rc = RTSemFastMutexCreate(&pDevExt->mtxGip);
    372                 if (!rc)
     375#endif
     376                if (RT_SUCCESS(rc))
    373377                {
    374378                    rc = supdrvGipCreate(pDevExt);
     
    432436                    }
    433437
     438#ifdef SUPDRV_USE_MUTEX_FOR_GIP
     439                    RTSemMutexDestroy(pDevExt->mtxGip);
     440                    pDevExt->mtxGip = NIL_RTSEMMUTEX;
     441#else
    434442                    RTSemFastMutexDestroy(pDevExt->mtxGip);
    435443                    pDevExt->mtxGip = NIL_RTSEMFASTMUTEX;
     444#endif
    436445                }
    437446                RTSemFastMutexDestroy(pDevExt->mtxComponentFactory);
     
    471480     * Kill mutexes and spinlocks.
    472481     */
     482#ifdef SUPDRV_USE_MUTEX_FOR_GIP
     483    RTSemMutexDestroy(pDevExt->mtxGip);
     484    pDevExt->mtxGip = NIL_RTSEMMUTEX;
     485#else
    473486    RTSemFastMutexDestroy(pDevExt->mtxGip);
    474487    pDevExt->mtxGip = NIL_RTSEMFASTMUTEX;
     488#endif
    475489#ifdef SUPDRV_USE_MUTEX_FOR_LDR
    476490    RTSemMutexDestroy(pDevExt->mtxLdr);
     
    28352849    AssertPtrNullReturn(pHCPhysGip, VERR_INVALID_POINTER);
    28362850
     2851#ifdef SUPDRV_USE_MUTEX_FOR_GIP
     2852    RTSemMutexRequest(pDevExt->mtxGip);
     2853#else
    28372854    RTSemFastMutexRequest(pDevExt->mtxGip);
     2855#endif
    28382856    if (pDevExt->pGip)
    28392857    {
     
    28982916        Log(("SUPR0GipMap: GIP is not available!\n"));
    28992917    }
     2918#ifdef SUPDRV_USE_MUTEX_FOR_GIP
     2919    RTSemMutexRelease(pDevExt->mtxGip);
     2920#else
    29002921    RTSemFastMutexRelease(pDevExt->mtxGip);
     2922#endif
    29012923
    29022924    /*
     
    29382960    AssertReturn(SUP_IS_SESSION_VALID(pSession), VERR_INVALID_PARAMETER);
    29392961
     2962#ifdef SUPDRV_USE_MUTEX_FOR_GIP
     2963    RTSemMutexRequest(pDevExt->mtxGip);
     2964#else
    29402965    RTSemFastMutexRequest(pDevExt->mtxGip);
     2966#endif
    29412967
    29422968    /*
     
    29652991    }
    29662992
     2993#ifdef SUPDRV_USE_MUTEX_FOR_GIP
     2994    RTSemMutexRelease(pDevExt->mtxGip);
     2995#else
    29672996    RTSemFastMutexRelease(pDevExt->mtxGip);
     2997#endif
    29682998
    29692999    return rc;
  • trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h

    r25460 r25461  
    185185 * @todo fix the mutex implementation on linux and make this the default. */
    186186# define SUPDRV_USE_MUTEX_FOR_LDR
     187
     188/** Use a normal mutex for the GIP so we remain at the same IRQL after
     189 * taking it.
     190 * @todo fix the mutex implementation on linux and make this the default. */
     191# define SUPDRV_USE_MUTEX_FOR_GIP
    187192
    188193/*
     
    607612     * Any changes to any of the GIP members requires ownership of this mutex,
    608613     * except on driver init and termination. */
     614#ifdef SUPDRV_USE_MUTEX_FOR_GIP
     615    RTSEMMUTEX                      mtxGip;
     616#else
    609617    RTSEMFASTMUTEX                  mtxGip;
     618#endif
    610619    /** Pointer to the Global Info Page (GIP). */
    611620    PSUPGLOBALINFOPAGE              pGip;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette