VirtualBox

Changeset 82862 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 26, 2020 2:47:22 PM (5 years ago)
Author:
vboxsync
Message:

VMM/GMMR0: Darwin must use critsects for the giant lock too as we can preempt mapping stuff. Added GMM_CHUNK_FLAGS_SEEDED for indicating when we can expect a kernel address and when not to. bugref:9627

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/GMMR0.cpp

    r82591 r82862  
    183183 * @remarks This is primarily a way of avoiding the deadlock checks in the
    184184 *          windows driver verifier. */
    185 #if defined(RT_OS_WINDOWS) || defined(DOXYGEN_RUNNING)
     185#if defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN) || defined(DOXYGEN_RUNNING)
    186186# define VBOX_USE_CRIT_SECT_FOR_GIANT
    187187#endif
     
    451451/** Indicates that the chunk is a large page (2MB). */
    452452#define GMM_CHUNK_FLAGS_LARGE_PAGE  UINT16_C(0x0001)
     453/** Indicates that the chunk was locked rather than allocated directly. */
     454#define GMM_CHUNK_FLAGS_SEEDED      UINT16_C(0x0002)
    453455/** @}  */
    454456
     
    21322134    Assert(pGMM->hMtxOwner != RTThreadNativeSelf());
    21332135    Assert(hGVM != NIL_GVM_HANDLE || pGMM->fBoundMemoryMode);
    2134     Assert(fChunkFlags == 0 || fChunkFlags == GMM_CHUNK_FLAGS_LARGE_PAGE);
     2136    Assert(fChunkFlags == 0 || fChunkFlags == GMM_CHUNK_FLAGS_LARGE_PAGE || fChunkFlags == GMM_CHUNK_FLAGS_SEEDED);
    21352137
    21362138#if defined(VBOX_WITH_RAM_IN_KERNEL) && !defined(VBOX_WITH_LINEAR_HOST_PHYS_MEM)
     
    21382140     * Get a ring-0 mapping of the object.
    21392141     */
    2140     uint8_t *pbMapping = (uint8_t *)RTR0MemObjAddress(hMemObj);
     2142    uint8_t *pbMapping = !(fChunkFlags & GMM_CHUNK_FLAGS_SEEDED) ? (uint8_t *)RTR0MemObjAddress(hMemObj) : NULL;
    21412143    if (!pbMapping)
    21422144    {
     
    42914293    if (RT_SUCCESS(rc))
    42924294    {
    4293         rc = gmmR0RegisterChunk(pGMM, &pGVM->gmm.s.Private, hMemObj, pGVM->hSelf, 0 /*fChunkFlags*/, NULL);
     4295        rc = gmmR0RegisterChunk(pGMM, &pGVM->gmm.s.Private, hMemObj, pGVM->hSelf, GMM_CHUNK_FLAGS_SEEDED, NULL);
    42944296        if (RT_SUCCESS(rc))
    42954297            gmmR0MutexRelease(pGMM);
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