VirtualBox

Changeset 82896 in vbox


Ignore:
Timestamp:
Jan 28, 2020 9:43:45 PM (5 years ago)
Author:
vboxsync
Message:

PGMPool: PGMR0PoolGrow should return failure when allocating the first batch of pages fails. It and the caller PGMR3PoolGrow should report the incident to the release log. bugref:9627

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r82895 r82896  
    49954995        int rc = VMMRZCallRing3NoCpu(pVM, VMMCALLRING3_PGM_POOL_GROW, 0);
    49964996#endif
    4997         if (RT_FAILURE(rc))
    4998             return rc;
     4997        if (rc == VINF_SUCCESS)
     4998        { /* likely */ }
     4999        else
     5000        {
     5001            if (RT_FAILURE(rc))
     5002                return rc;
     5003        }
     5004
    49995005        STAM_PROFILE_ADV_RESUME(&pPool->StatAlloc, a);
    50005006        if (pPool->iFreeHead != NIL_PGMPOOL_IDX)
  • trunk/src/VBox/VMM/VMMR0/PGMR0Pool.cpp

    r82567 r82896  
    4646    PPGMPOOL pPool = pGVM->pgm.s.pPoolR0;
    4747    AssertReturn(pPool->cCurPages < pPool->cMaxPages, VERR_PGM_POOL_MAXED_OUT_ALREADY);
     48    AssertReturn(pPool->pVMR3 == pGVM->pVMR3, VERR_PGM_POOL_IPE);
     49    AssertReturn(pPool->pVMR0 == pGVM, VERR_PGM_POOL_IPE);
    4850
    4951    /* With 32-bit guests and no EPT, the CR3 limits the root pages to low
     
    139141            RTR0MemObjFree(hMemObj, true /*fFreeMappings*/);
    140142        }
     143        if (cCurPages > 0)
     144            rc = -rc;
     145        else
     146            LogRel(("PGMR0PoolGrow: rc=%Rrc cNewPages=%#x cCurPages=%#x cMaxPages=%#x fCanUseHighMemory=%d\n",
     147                    rc, cNewPages, cCurPages, cMaxPages, fCanUseHighMemory));
    141148    }
    142149    RTCritSectLeave(&pGVM->pgmr0.s.PoolGrowCritSect);
    143     return VINF_SUCCESS;
     150    return rc;
    144151}
    145152
  • trunk/src/VBox/VMM/VMMR3/PGMPool.cpp

    r82895 r82896  
    485485    /* This used to do a lot of stuff, but it has moved to ring-0 (PGMR0PoolGrow). */
    486486    AssertReturn(pVM->pgm.s.pPoolR3->cCurPages < pVM->pgm.s.pPoolR3->cMaxPages, VERR_PGM_POOL_MAXED_OUT_ALREADY);
    487     return VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_PGM_POOL_GROW, 0, NULL);
     487    int rc = VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_PGM_POOL_GROW, 0, NULL);
     488    if (rc == VINF_SUCCESS)
     489        return rc;
     490    LogRel(("PGMR3PoolGrow: rc=%Rrc cCurPages=%#x cMaxPages=%#x\n",
     491            rc, pVM->pgm.s.pPoolR3->cCurPages, pVM->pgm.s.pPoolR3->cMaxPages));
     492    return rc;
    488493}
    489494
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