Changeset 17541 in vbox
- Timestamp:
- Mar 8, 2009 8:51:17 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 43976
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/param.h
r17535 r17541 60 60 #define MM_HYPER_DYNAMIC_SIZE (16 * PAGE_SIZE) 61 61 62 /** The default size of the below 4GB RAM hole. */ 63 #define MM_RAM_HOLE_SIZE_DEFAULT (512U * _1M) 64 62 65 /** @} */ 63 66 -
trunk/src/VBox/VMM/CFGM.cpp
r14070 r17541 769 769 rc = CFGMR3InsertString(pRoot, "Name", "Default VM"); 770 770 UPDATERC(); 771 rc = CFGMR3InsertInteger(pRoot, "RamSize", 128 * _1M); 771 rc = CFGMR3InsertInteger(pRoot, "RamSize", 128U * _1M); 772 UPDATERC(); 773 rc = CFGMR3InsertInteger(pRoot, "RamHoleSize", 512U * _1M); 772 774 UPDATERC(); 773 775 rc = CFGMR3InsertInteger(pRoot, "TimerMillies", 10); … … 839 841 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); 840 842 UPDATERC(); 841 rc = CFGMR3InsertInteger(pCfg, "RamSize", 128 * _1M); 843 rc = CFGMR3InsertInteger(pCfg, "RamSize", 128U * _1M); 844 UPDATERC(); 845 rc = CFGMR3InsertInteger(pCfg, "RamHoleSize", 512U * _1M); 842 846 UPDATERC(); 843 847 rc = CFGMR3InsertString(pCfg, "BootDevice0", "IDE"); -
trunk/src/VBox/VMM/MM.cpp
r17513 r17541 303 303 AssertMsgRCReturn(rc, ("Configuration error: Failed to query integer \"RamPreAlloc\", rc=%Rrc.\n", rc), rc); 304 304 305 /** @cfgm{RamSize, uint64_t, 0, 0, UINT64_MAX}305 /** @cfgm{RamSize, uint64_t, 0, 16TB, 0} 306 306 * Specifies the size of the base RAM that is to be set up during 307 307 * VM initialization. … … 313 313 else 314 314 AssertMsgRCReturn(rc, ("Configuration error: Failed to query integer \"RamSize\", rc=%Rrc.\n", rc), rc); 315 315 AssertLogRelMsg(!(cbRam & ~X86_PTE_PAE_PG_MASK), ("%RGp\n", cbRam)); 316 316 cbRam &= X86_PTE_PAE_PG_MASK; 317 pVM->mm.s.cbRamBase = cbRam; /* Warning: don't move this code to MMR3Init without fixing REMR3Init. */ 318 Log(("MM: %RU64 bytes of RAM%s\n", cbRam, fPreAlloc ? " (PreAlloc)" : "")); 317 pVM->mm.s.cbRamBase = cbRam; 318 319 /** @cfgm{RamHoleSize, uint32_t, 0, 4032MB, 512MB} 320 * Specifies the size of the memory hole. The memory hole is used 321 * to avoid mapping RAM to the range normally used for PCI memory regions. 322 * Must be aligned on a 4MB boundrary. */ 323 uint32_t cbRamHole; 324 rc = CFGMR3QueryU32Def(CFGMR3GetRoot(pVM), "RamHoleSize", &cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT); 325 AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query integer \"RamHoleSize\", rc=%Rrc.\n", rc), rc); 326 AssertLogRelMsgReturn(cbRamHole <= 4032U * _1M, 327 ("Configuration error: \"RamHoleSize\"=%#RX32 is too large.\n", cbRamHole), VERR_OUT_OF_RANGE); 328 AssertLogRelMsgReturn(cbRamHole > 16 * _1M, 329 ("Configuration error: \"RamHoleSize\"=%#RX32 is too large.\n", cbRamHole), VERR_OUT_OF_RANGE); 330 AssertLogRelMsgReturn(!(cbRamHole & (_4M - 1)), 331 ("Configuration error: \"RamHoleSize\"=%#RX32 is misaligned.\n", cbRamHole), VERR_OUT_OF_RANGE); 332 uint64_t const offRamHole = _4G - cbRamHole; 333 if (cbRam < offRamHole) 334 Log(("MM: %RU64 bytes of RAM%s\n", cbRam, fPreAlloc ? " (PreAlloc)" : "")); 335 else 336 Log(("MM: %RU64 bytes of RAM%s with a hole at %RU64 up to 4GB.\n", cbRam, fPreAlloc ? " (PreAlloc)" : "", offRamHole)); 319 337 320 338 /** @cfgm{MM/Policy, string, no overcommitment} … … 393 411 * Setup the base ram (PGM). 394 412 */ 395 rc = PGMR3PhysRegisterRam(pVM, 0, cbRam, "Base RAM");396 413 #ifdef VBOX_WITH_NEW_PHYS_CODE 397 if (RT_SUCCESS(rc) && fPreAlloc) 414 if (cbRam > offRamHole) 415 { 416 rc = PGMR3PhysRegisterRam(pVM, 0, offRamHole, "Base RAM"); 417 if (RT_SUCCESS(rc)) 418 rc = PGMR3PhysRegisterRam(pVM, _4G, cbRam - offRamHole, "Above 4GB Base RAM"); 419 } 420 else 421 rc = PGMR3PhysRegisterRam(pVM, 0, RT_MIN(cbRam, offRamHole), "Base RAM"); 422 if ( RT_SUCCESS(rc) 423 && fPreAlloc) 398 424 { 399 425 /** @todo RamPreAlloc should be handled at the very end of the VM creation. (lazy bird) */ … … 401 427 } 402 428 #else 429 rc = PGMR3PhysRegisterRam(pVM, 0, cbRam, "Base RAM"); 403 430 if (RT_SUCCESS(rc)) 404 431 { … … 423 450 */ 424 451 pVM->mm.s.fDoneMMR3InitPaging = true; 425 AssertMsg(pVM->mm.s.cBasePages == cBasePages , ("%RX64 != %RX64\n", pVM->mm.s.cBasePages, cBasePages));452 AssertMsg(pVM->mm.s.cBasePages == cBasePages || RT_FAILURE(rc), ("%RX64 != %RX64\n", pVM->mm.s.cBasePages, cBasePages)); 426 453 #endif 427 454
Note:
See TracChangeset
for help on using the changeset viewer.