Changeset 92425 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Nov 15, 2021 1:21:17 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148281
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/MM.cpp
r92192 r92425 407 407 * Setup the base ram (PGM). 408 408 */ 409 pVM->mm.s.cbRamHole = cbRamHole; 409 pVM->mm.s.cbRamHole = cbRamHole; 410 pVM->mm.s.cbRamBelow4GB = cbRam > offRamHole ? offRamHole : cbRam; 411 pVM->mm.s.cbRamAbove4GB = cbRam > offRamHole ? cbRam - offRamHole : 0; 410 412 411 413 /* First the conventional memory: */ 412 414 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) 415 if (RT_SUCCESS(rc) && cbRam >= _1M) 416 { 417 /* The extended memory from 1MiB to 2MiB to align better with large pages in NEM mode: */ 418 rc = PGMR3PhysRegisterRam(pVM, _1M, RT_MIN(_1M, cbRam - _1M), "Extended RAM, 1-2MB"); 419 if (cbRam > _2M) 417 420 { 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; 421 /* The extended memory from 2MiB up to 4GiB: */ 422 rc = PGMR3PhysRegisterRam(pVM, _2M, pVM->mm.s.cbRamBelow4GB - _2M, "Extended RAM, >2MB"); 423 424 /* Then all the memory above 4GiB: */ 425 if (RT_SUCCESS(rc) && pVM->mm.s.cbRamAbove4GB > 0) 424 426 rc = PGMR3PhysRegisterRam(pVM, _4G, cbRam - offRamHole, "Above 4GB Base RAM"); 425 }426 }427 else428 {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 427 } 434 428 }
Note:
See TracChangeset
for help on using the changeset viewer.