VirtualBox

Changeset 32910 in vbox


Ignore:
Timestamp:
Oct 5, 2010 12:33:56 PM (14 years ago)
Author:
vboxsync
Message:

VMM: hyper heap size selection

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r32908 r32910  
    311311}
    312312
    313 static uint32_t computeHyperHeapSize(ChipsetType_T chipsetType, uint32_t cCpus, bool fHwVirtExtForced)
    314 {
    315     uint32_t singleCpuBaseSize;
    316 
    317     if (cCpus > 1)
    318         return _2M + cCpus * _64K;
    319 
    320     if (chipsetType == ChipsetType_PIIX3)
    321     {
    322         /* Size must be kept like this for saved state compatibility */
    323         return fHwVirtExtForced ? 640*_1K : 1280*_1K;
    324     }
    325 
    326 
    327     return 1280*_1K;
    328 }
    329 
    330313class ConfigError : public iprt::Error
    331314{
     
    700683         */
    701684        PCFGMNODE pMM;
    702         uint32_t cbHyperHeap = computeHyperHeapSize(chipsetType, cCpus, fHwVirtExtForced);
    703685        InsertConfigNode(pRoot, "MM", &pMM);
    704         InsertConfigInteger(pMM, "cbHyperHeap", cbHyperHeap);
     686        InsertConfigInteger(pMM, "CanUseLargerHeap", chipsetType == ChipsetType_ICH9);
    705687
    706688        /*
  • trunk/src/VBox/VMM/MMHyper.cpp

    r32908 r32910  
    4545
    4646
     47DECLINLINE(uint32_t) computeHyperHeapSize(bool fCanUseLargerHeap, uint32_t cCpus, bool fHwVirtExtForced)
     48{
     49    if (cCpus > 1)
     50        return _2M + cCpus * _64K;
     51
     52    if (fCanUseLargerHeap)
     53        return 1280*_1K;
     54    else
     55        /* Size must be kept like this for saved state compatibility */
     56        return fHwVirtExtForced ? 640*_1K : 1280*_1K;
     57}
    4758
    4859
     
    7384     *        precious kernel space on heap for the PATM.
    7485     */
    75     uint32_t cbHyperHeap;
    76     int rc = CFGMR3QueryU32(CFGMR3GetChild(CFGMR3GetRoot(pVM), "MM"), "cbHyperHeap", &cbHyperHeap);
     86    PCFGMNODE pMM = CFGMR3GetChild(CFGMR3GetRoot(pVM), "MM");
     87    bool fCanUseLargerHeap = false;
     88    int rc = CFGMR3QueryBoolDef(pMM, "CanUseLargerHeap", &fCanUseLargerHeap, false);
     89    uint32_t cbHyperHeap = computeHyperHeapSize(fCanUseLargerHeap, pVM->cCpus, VMMIsHwVirtExtForced(pVM));
     90    rc = CFGMR3QueryU32Def(pMM, "cbHyperHeap", &cbHyperHeap, cbHyperHeap);
    7791    AssertLogRelRCReturn(rc, rc);
     92
    7893    cbHyperHeap = RT_ALIGN_32(cbHyperHeap, PAGE_SIZE);
    7994    LogRel(("MM: cbHyperHeap=%#x (%u)\n", cbHyperHeap, cbHyperHeap));
     
    13751390    }
    13761391}
    1377 
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