Changeset 92192 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Nov 3, 2021 2:44:45 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148021
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/MM.cpp
r91018 r92192 377 377 * Make the initial memory reservation with GMM. 378 378 */ 379 uint64_t cBasePages = (cbRam >> PAGE_SHIFT) + pVM->mm.s.cBasePages; 379 uint32_t const cbUma = _1M - 640*_1K; 380 uint64_t cBasePages = ((cbRam - cbUma) >> PAGE_SHIFT) + pVM->mm.s.cBasePages; 380 381 rc = GMMR3InitialReservation(pVM, 381 382 RT_MAX(cBasePages + pVM->mm.s.cHandyPages, 1), … … 407 408 */ 408 409 pVM->mm.s.cbRamHole = cbRamHole; 409 if (cbRam > offRamHole) 410 { 411 pVM->mm.s.cbRamBelow4GB = offRamHole; 412 rc = PGMR3PhysRegisterRam(pVM, 0, offRamHole, "Base RAM"); 413 if (RT_SUCCESS(rc)) 410 411 /* First the conventional memory: */ 412 rc = PGMR3PhysRegisterRam(pVM, 0, RT_MIN(cbRam, 640*_1K), "Conventional RAM"); 413 if (RT_SUCCESS(rc)) 414 { 415 /* The extended memory from 1MiB up to 4GiB: */ 416 if (cbRam > offRamHole) 414 417 { 415 pVM->mm.s.cbRamAbove4GB = cbRam - offRamHole; 416 rc = PGMR3PhysRegisterRam(pVM, _4G, cbRam - offRamHole, "Above 4GB Base RAM"); 418 pVM->mm.s.cbRamBelow4GB = offRamHole; 419 rc = PGMR3PhysRegisterRam(pVM, _1M, offRamHole - _1M, "Extended RAM"); 420 if (RT_SUCCESS(rc)) 421 { 422 /* Then all the memory above 4GiB: */ 423 pVM->mm.s.cbRamAbove4GB = cbRam - offRamHole; 424 rc = PGMR3PhysRegisterRam(pVM, _4G, cbRam - offRamHole, "Above 4GB Base RAM"); 425 } 417 426 } 418 } 419 else 420 { 421 pVM->mm.s.cbRamBelow4GB = cbRam; 422 pVM->mm.s.cbRamAbove4GB = 0; 423 rc = PGMR3PhysRegisterRam(pVM, 0, cbRam, "Base RAM"); 427 else 428 { 429 pVM->mm.s.cbRamBelow4GB = cbRam; 430 pVM->mm.s.cbRamAbove4GB = 0; 431 if (cbRam > _1M) 432 rc = PGMR3PhysRegisterRam(pVM, _1M, cbRam - _1M, "Extended RAM"); 433 } 424 434 } 425 435 … … 608 618 uint64_t cOld = pVM->mm.s.cBasePages; 609 619 pVM->mm.s.cBasePages += cAddBasePages; 610 LogFlow(("MMR3IncreaseBaseReservation: +%RU64 (%RU64 -> %RU64 \n", cAddBasePages, cOld, pVM->mm.s.cBasePages));620 LogFlow(("MMR3IncreaseBaseReservation: +%RU64 (%RU64 -> %RU64)\n", cAddBasePages, cOld, pVM->mm.s.cBasePages)); 611 621 int rc = mmR3UpdateReservation(pVM); 612 622 if (RT_FAILURE(rc))
Note:
See TracChangeset
for help on using the changeset viewer.