VirtualBox

Changeset 33192 in vbox for trunk/src/VBox/VMM/MMHyper.cpp


Ignore:
Timestamp:
Oct 18, 2010 11:54:33 AM (14 years ago)
Author:
vboxsync
Message:

Need more space for the hypervisor heap for large memory guests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/MMHyper.cpp

    r32910 r33192  
    4545
    4646
    47 DECLINLINE(uint32_t) computeHyperHeapSize(bool fCanUseLargerHeap, uint32_t cCpus, bool fHwVirtExtForced)
    48 {
    49     if (cCpus > 1)
    50         return _2M + cCpus * _64K;
     47DECLINLINE(uint32_t) mmR3ComputeHyperHeapSize(PVM pVM, bool fCanUseLargerHeap)
     48{
     49    bool fHwVirtExtForced = VMMIsHwVirtExtForced(pVM);
     50
     51    if (pVM->cCpus > 1)
     52        return _1M + pVM->cCpus * 2 * _64K;
    5153
    5254    if (fCanUseLargerHeap)
    5355        return 1280*_1K;
    5456    else
    55         /* Size must be kept like this for saved state compatibility */
    56         return fHwVirtExtForced ? 640*_1K : 1280*_1K;
     57    if (fHwVirtExtForced)
     58    {
     59        /* Need a bit more space for large memory guests. */
     60        if (pVM->mm.s.cbRamBase >= _4G)
     61            return _1M;
     62        else
     63            return 640 * _1K;
     64    }
     65    else
     66        /* Size must be kept like this for saved state compatibility (only for raw mode though). */
     67        return 1280*_1K;
    5768}
    5869
     
    8798    bool fCanUseLargerHeap = false;
    8899    int rc = CFGMR3QueryBoolDef(pMM, "CanUseLargerHeap", &fCanUseLargerHeap, false);
    89     uint32_t cbHyperHeap = computeHyperHeapSize(fCanUseLargerHeap, pVM->cCpus, VMMIsHwVirtExtForced(pVM));
     100    uint32_t cbHyperHeap = mmR3ComputeHyperHeapSize(pVM, fCanUseLargerHeap);
    90101    rc = CFGMR3QueryU32Def(pMM, "cbHyperHeap", &cbHyperHeap, cbHyperHeap);
    91102    AssertLogRelRCReturn(rc, rc);
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