Changeset 82555 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Dec 11, 2019 11:56:54 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135429
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/MM.cpp
r80333 r82555 460 460 VMMR3DECL(int) MMR3Term(PVM pVM) 461 461 { 462 #if 0 462 463 /* 463 464 * Destroy the page pool. (first as it used the hyper heap) 464 465 */ 465 466 mmR3PagePoolTerm(pVM); 467 #endif 466 468 467 469 /* Clean up the hypervisor heap. */ … … 740 742 VMMR3DECL(int) MMR3HCPhys2HCVirt(PVM pVM, RTHCPHYS HCPhys, void **ppv) 741 743 { 744 #if 0 742 745 /* 743 746 * Try page tables. … … 746 749 if (RT_SUCCESS(rc)) 747 750 return rc; 751 #endif 748 752 749 753 /* -
trunk/src/VBox/VMM/VMMR3/MMPagePool.cpp
r80333 r82555 379 379 } 380 380 381 #if 0 381 382 382 383 /** … … 483 484 } 484 485 486 #endif 485 487 486 488 /** -
trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp
r80673 r82555 1116 1116 if (!fIsMapping) 1117 1117 { 1118 int rc = MMPagePhys2PageTry(pState->pVM, HCPhys, &pvPage);1119 if ( RT_FAILURE(rc))1118 PPGMPOOLPAGE pPoolPage = pgmPoolQueryPageForDbg(pState->pVM->pgm.s.pPoolR3, HCPhys); 1119 if (pPoolPage) 1120 1120 { 1121 1121 pState->pHlp->pfnPrintf(pState->pHlp, "%0*llx error! %s at HCPhys=%RHp was not found in the page pool!\n", 1122 1122 pState->cchAddress, pState->u64Address, pszDesc, HCPhys); 1123 return rc;1123 return VERR_PGM_POOL_GET_PAGE_FAILED; 1124 1124 } 1125 pvPage = (uint8_t *)pPoolPage->pvPageR3 + (HCPhys & PAGE_OFFSET_MASK); 1125 1126 } 1126 1127 else -
trunk/src/VBox/VMM/VMMR3/PGMPool.cpp
r80334 r82555 170 170 AssertLogRelMsgReturn(cMaxPages <= PGMPOOL_IDX_LAST && cMaxPages >= RT_ALIGN(PGMPOOL_IDX_FIRST, 16), 171 171 ("cMaxPages=%u (%#x)\n", cMaxPages, cMaxPages), VERR_INVALID_PARAMETER); 172 cMaxPages = RT_ALIGN(cMaxPages, 16); 172 AssertCompile(RT_IS_POWER_OF_TWO(PGMPOOL_CFG_MAX_GROW)); 173 if (cMaxPages < PGMPOOL_IDX_LAST) 174 cMaxPages = RT_ALIGN(cMaxPages, PGMPOOL_CFG_MAX_GROW / 2); 173 175 if (cMaxPages > PGMPOOL_IDX_LAST) 174 176 cMaxPages = PGMPOOL_IDX_LAST; … … 314 316 Assert(!pPool->aPages[NIL_PGMPOOL_IDX].fReusedFlushPending); 315 317 316 #ifdef VBOX_WITH_STATISTICS317 318 /* 318 319 * Register statistics. 319 320 */ 321 STAM_REL_REG(pVM, &pPool->StatGrow, STAMTYPE_PROFILE, "/PGM/Pool/Grow", STAMUNIT_TICKS, "Profiling PGMR0PoolGrow"); 322 #ifdef VBOX_WITH_STATISTICS 320 323 STAM_REG(pVM, &pPool->cCurPages, STAMTYPE_U16, "/PGM/Pool/cCurPages", STAMUNIT_PAGES, "Current pool size."); 321 324 STAM_REG(pVM, &pPool->cMaxPages, STAMTYPE_U16, "/PGM/Pool/cMaxPages", STAMUNIT_PAGES, "Max pool size."); … … 473 476 * @returns VBox status code. 474 477 * @param pVM The cross context VM structure. 478 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 475 479 */ 476 VMMR3 DECL(int) PGMR3PoolGrow(PVM pVM)480 VMMR3_INT_DECL(int) PGMR3PoolGrow(PVM pVM, PVMCPU pVCpu) 477 481 { 478 PPGMPOOL pPool = pVM->pgm.s.pPoolR3; 479 AssertReturn(pPool->cCurPages < pPool->cMaxPages, VERR_PGM_POOL_MAXED_OUT_ALREADY); 480 481 /* With 32-bit guests and no EPT, the CR3 limits the root pages to low 482 (below 4 GB) memory. */ 483 /** @todo change the pool to handle ROOT page allocations specially when 484 * required. */ 485 bool fCanUseHighMemory = HMIsNestedPagingActive(pVM); 486 487 pgmLock(pVM); 488 489 /* 490 * How much to grow it by? 491 */ 492 uint32_t cPages = pPool->cMaxPages - pPool->cCurPages; 493 cPages = RT_MIN(PGMPOOL_CFG_MAX_GROW, cPages); 494 LogFlow(("PGMR3PoolGrow: Growing the pool by %d (%#x) pages. fCanUseHighMemory=%RTbool\n", cPages, cPages, fCanUseHighMemory)); 495 496 for (unsigned i = pPool->cCurPages; cPages-- > 0; i++) 497 { 498 PPGMPOOLPAGE pPage = &pPool->aPages[i]; 499 500 if (fCanUseHighMemory) 501 pPage->pvPageR3 = MMR3PageAlloc(pVM); 502 else 503 pPage->pvPageR3 = MMR3PageAllocLow(pVM); 504 if (!pPage->pvPageR3) 505 { 506 Log(("We're out of memory!! i=%d fCanUseHighMemory=%RTbool\n", i, fCanUseHighMemory)); 507 pgmUnlock(pVM); 508 return i ? VINF_SUCCESS : VERR_NO_PAGE_MEMORY; 509 } 510 pPage->Core.Key = MMPage2Phys(pVM, pPage->pvPageR3); 511 AssertFatal(pPage->Core.Key < _4G || fCanUseHighMemory); 512 pPage->GCPhys = NIL_RTGCPHYS; 513 pPage->enmKind = PGMPOOLKIND_FREE; 514 pPage->idx = pPage - &pPool->aPages[0]; 515 LogFlow(("PGMR3PoolGrow: insert page #%#x - %RHp\n", pPage->idx, pPage->Core.Key)); 516 pPage->iNext = pPool->iFreeHead; 517 pPage->iUserHead = NIL_PGMPOOL_USER_INDEX; 518 pPage->iModifiedNext = NIL_PGMPOOL_IDX; 519 pPage->iModifiedPrev = NIL_PGMPOOL_IDX; 520 pPage->iMonitoredNext = NIL_PGMPOOL_IDX; 521 pPage->iMonitoredPrev = NIL_PGMPOOL_IDX; 522 pPage->iAgeNext = NIL_PGMPOOL_IDX; 523 pPage->iAgePrev = NIL_PGMPOOL_IDX; 524 /* commit it */ 525 bool fRc = RTAvloHCPhysInsert(&pPool->HCPhysTree, &pPage->Core); Assert(fRc); NOREF(fRc); 526 pPool->iFreeHead = i; 527 pPool->cCurPages = i + 1; 528 } 529 530 pgmUnlock(pVM); 531 Assert(pPool->cCurPages <= pPool->cMaxPages); 532 return VINF_SUCCESS; 482 /* This used to do a lot of stuff, but it has moved to ring-0 (PGMR0PoolGrow). */ 483 AssertReturn(pVM->pgm.s.pPoolR3->cCurPages < pVM->pgm.s.pPoolR3->cMaxPages, VERR_PGM_POOL_MAXED_OUT_ALREADY); 484 return VMMR3CallR0Emt(pVM, pVCpu, VMMR0_DO_PGM_POOL_GROW, 0, NULL); 533 485 } 534 486 -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r81198 r82555 2393 2393 case VMMCALLRING3_PGM_POOL_GROW: 2394 2394 { 2395 pVCpu->vmm.s.rcCallRing3 = PGMR3PoolGrow(pVM );2395 pVCpu->vmm.s.rcCallRing3 = PGMR3PoolGrow(pVM, pVCpu); 2396 2396 break; 2397 2397 }
Note:
See TracChangeset
for help on using the changeset viewer.