Changeset 6817 in vbox
- Timestamp:
- Feb 5, 2008 9:51:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/MM.cpp
r6802 r6817 301 301 N_("Insufficient free memory to start the VM (cbRam=%#RX64 enmPolicy=%d enmPriority=%d)"), 302 302 cbRam, enmPolicy, enmPriority); 303 return VMSetError(pVM, rc, RT_SRC_POS, "GMMR3InitialReservation(,%#RX64,0,0,%d,%d) .",303 return VMSetError(pVM, rc, RT_SRC_POS, "GMMR3InitialReservation(,%#RX64,0,0,%d,%d)", 304 304 cbRam >> PAGE_SHIFT, enmPolicy, enmPriority); 305 305 } … … 321 321 if (RT_SUCCESS(rc) && fPreAlloc) 322 322 { 323 /** @todo implement RamPreAlloc if it makes sense.*/323 /** @todo implement RamPreAlloc if it is *really* needed - in PGM preferably. (lazy bird) */ 324 324 return VM_SET_ERROR(pVM, VERR_NOT_IMPLEMENTED, "TODO: RamPreAlloc"); 325 325 } … … 548 548 MMR3DECL(int) MMR3IncreaseBaseReservation(PVM pVM, uint64_t cAddBasePages) 549 549 { 550 LogFlow(("MMR3IncreaseBaseReservation: +%RU64 (%RU64 -> %RU64\n", cAddBasePages, 551 pVM->mm.s.cBasePages, pVM->mm.s.cBasePages + cAddBasePages)); 550 uint64_t cOld = pVM->mm.s.cBasePages; 552 551 pVM->mm.s.cBasePages += cAddBasePages; 553 return mmR3UpdateReservation(pVM); 552 LogFlow(("MMR3IncreaseBaseReservation: +%RU64 (%RU64 -> %RU64\n", cAddBasePages, cOld, pVM->mm.s.cBasePages)); 553 int rc = mmR3UpdateReservation(pVM); 554 if (RT_FAILURE(rc)) 555 { 556 VMSetError(pVM, rc, RT_SRC_POS, N_("Failed to reserved physical memory for the RAM (%#RX64 -> %#RX64)"), cOld, pVM->mm.s.cBasePages); 557 pVM->mm.s.cBasePages = cOld; 558 } 559 return rc; 554 560 } 555 561 … … 564 570 * @param cAddFixedPages The number of pages to add. 565 571 */ 566 MMR3DECL(int) MMR3AddFixedReservation(PVM pVM, uint32_t cAddFixedPages) 567 { 568 LogFlow(("MMR3AddFixedReservation: +%u (%u -> %u)\n", cAddFixedPages, 569 pVM->mm.s.cFixedPages, pVM->mm.s.cFixedPages + cAddFixedPages)); 572 MMR3DECL(int) MMR3IncreaseFixedReservation(PVM pVM, uint32_t cAddFixedPages) 573 { 574 const uint32_t cOld = pVM->mm.s.cFixedPages; 570 575 pVM->mm.s.cFixedPages += cAddFixedPages; 571 return mmR3UpdateReservation(pVM); 576 LogFlow(("MMR3AddFixedReservation: +%u (%u -> %u)\n", cAddFixedPages, cOld, pVM->mm.s.cFixedPages)); 577 int rc = mmR3UpdateReservation(pVM); 578 if (RT_FAILURE(rc)) 579 { 580 VMSetError(pVM, rc, RT_SRC_POS, N_("Failed to reserve physical memory (%#x -> %#x)"), cOld, pVM->mm.s.cFixedPages); 581 pVM->mm.s.cFixedPages = cOld; 582 } 583 return rc; 572 584 } 573 585 … … 584 596 MMR3DECL(int) MMR3UpdateShadowReservation(PVM pVM, uint32_t cShadowPages) 585 597 { 586 LogFlow(("MMR3UpdateShadowReservation: %u -> %u\n", pVM->mm.s.cShadowPages, cShadowPages));598 const uint32_t cOld = pVM->mm.s.cShadowPages; 587 599 pVM->mm.s.cShadowPages = cShadowPages; 588 return mmR3UpdateReservation(pVM); 600 LogFlow(("MMR3UpdateShadowReservation: %u -> %u\n", cOld, pVM->mm.s.cShadowPages)); 601 int rc = mmR3UpdateReservation(pVM); 602 if (RT_FAILURE(rc)) 603 { 604 VMSetError(pVM, rc, RT_SRC_POS, N_("Failed to reserve physical memory for shadow page tables (%#x -> %#x)"), cOld, pVM->mm.s.cShadowPages); 605 pVM->mm.s.cShadowPages = cOld; 606 } 607 return rc; 589 608 } 590 609
Note:
See TracChangeset
for help on using the changeset viewer.