Changeset 6155 in vbox for trunk/src/VBox
- Timestamp:
- Dec 19, 2007 3:43:45 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMPhys.cpp
r5999 r6155 411 411 Log(("pgmr3PhysGrowRange: allocate chunk of size 0x%X at %VGp\n", PGM_DYNAMIC_CHUNK_SIZE, GCPhys)); 412 412 413 unsigned cPages = PGM_DYNAMIC_CHUNK_SIZE >> PAGE_SHIFT; 414 rc = SUPPageAlloc(cPages, &pvRam); 415 if (VBOX_SUCCESS(rc)) 416 { 413 unsigned cPages = PGM_DYNAMIC_CHUNK_SIZE >> PAGE_SHIFT; 414 415 for (;;) 416 { 417 rc = SUPPageAlloc(cPages, &pvRam); 418 if (VBOX_SUCCESS(rc)) 419 { 420 421 rc = MMR3PhysRegisterEx(pVM, pvRam, GCPhys, PGM_DYNAMIC_CHUNK_SIZE, 0, MM_PHYS_TYPE_DYNALLOC_CHUNK, "Main Memory"); 422 if (VBOX_SUCCESS(rc)) 423 return rc; 424 425 SUPPageFree(pvRam, cPages); 426 } 427 417 428 VMSTATE enmVMState = VMR3GetState(pVM); 418 419 rc = MMR3PhysRegisterEx(pVM, pvRam, GCPhys, PGM_DYNAMIC_CHUNK_SIZE, 0, MM_PHYS_TYPE_DYNALLOC_CHUNK, "Main Memory"); 420 if ( VBOX_SUCCESS(rc) 421 || enmVMState != VMSTATE_RUNNING) 422 { 423 if (VBOX_FAILURE(rc)) 424 { 425 AssertMsgFailed(("Out of memory while trying to allocate a guest RAM chunk at %VGp!\n", GCPhys)); 426 LogRel(("PGM: Out of memory while trying to allocate a guest RAM chunk at %VGp (VMstate=%s)!\n", GCPhys, VMR3GetStateName(enmVMState))); 427 } 429 if (enmVMState != VMSTATE_RUNNING) 430 { 431 AssertMsgFailed(("Out of memory while trying to allocate a guest RAM chunk at %VGp!\n", GCPhys)); 432 LogRel(("PGM: Out of memory while trying to allocate a guest RAM chunk at %VGp (VMstate=%s)!\n", GCPhys, VMR3GetStateName(enmVMState))); 428 433 return rc; 429 434 } 430 431 SUPPageFree(pvRam, cPages);432 435 433 436 LogRel(("pgmr3PhysGrowRange: out of memory. pause until the user resumes execution.\n")); … … 444 447 /* Retry */ 445 448 LogRel(("pgmr3PhysGrowRange: VM execution resumed -> retry.\n")); 446 return pgmr3PhysGrowRange(pVM, GCPhys); 447 } 448 LogRel(("pgmr3PhysGrowRange %VGp SUPPageAlloc %x pages failed with %Vrc\n", GCPhys, cPages, rc)); 449 return rc; 449 } 450 450 } 451 451
Note:
See TracChangeset
for help on using the changeset viewer.