Changeset 43047 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Aug 28, 2012 2:47:29 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r43045 r43047 2781 2781 } /* for each page to update */ 2782 2782 2783 if (RT_SUCCESS(rc) )2783 if (RT_SUCCESS(rc) && cPagesToAlloc > 0) 2784 2784 { 2785 2785 #if defined(VBOX_STRICT) && 0 /** @todo re-test this later. Appeared to be a PGM init bug. */ -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r42404 r43047 66 66 * must clear the new pages. 67 67 */ 68 VMMR0 DECL(int) PGMR0PhysAllocateHandyPages(PVM pVM, PVMCPU pVCpu)68 VMMR0_INT_DECL(int) PGMR0PhysAllocateHandyPages(PVM pVM, PVMCPU pVCpu) 69 69 { 70 70 PGM_LOCK_ASSERT_OWNER_EX(pVM, pVCpu); … … 169 169 170 170 /** 171 * Flushes any changes pending in the handy page array. 172 * 173 * It is very important that this gets done when page sharing is enabled. 174 * 175 * @returns The following VBox status codes. 176 * @retval VINF_SUCCESS on success. FF cleared. 177 * 178 * @param pVM Pointer to the VM. 179 * @param pVCpu Pointer to the VMCPU. 180 * 181 * @remarks Must be called from within the PGM critical section. 182 */ 183 VMMR0_INT_DECL(int) PGMR0PhysFlushHandyPages(PVM pVM, PVMCPU pVCpu) 184 { 185 PGM_LOCK_ASSERT_OWNER_EX(pVM, pVCpu); 186 187 /* 188 * Try allocate a full set of handy pages. 189 */ 190 uint32_t iFirst = pVM->pgm.s.cHandyPages; 191 AssertReturn(iFirst <= RT_ELEMENTS(pVM->pgm.s.aHandyPages), VERR_PGM_HANDY_PAGE_IPE); 192 uint32_t cPages = RT_ELEMENTS(pVM->pgm.s.aHandyPages) - iFirst; 193 if (!cPages) 194 return VINF_SUCCESS; 195 int rc = GMMR0AllocateHandyPages(pVM, pVCpu->idCpu, cPages, 0, &pVM->pgm.s.aHandyPages[iFirst]); 196 197 LogFlow(("PGMR0PhysFlushHandyPages: cPages=%d rc=%Rrc\n", cPages, rc)); 198 return rc; 199 } 200 201 202 /** 171 203 * Worker function for PGMR3PhysAllocateLargeHandyPage 172 204 * … … 181 213 * must clear the new pages. 182 214 */ 183 VMMR0 DECL(int) PGMR0PhysAllocateLargeHandyPage(PVM pVM, PVMCPU pVCpu)215 VMMR0_INT_DECL(int) PGMR0PhysAllocateLargeHandyPage(PVM pVM, PVMCPU pVCpu) 184 216 { 185 217 PGM_LOCK_ASSERT_OWNER_EX(pVM, pVCpu); -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r41976 r43047 363 363 364 364 /** 365 * Terminates the R0 driverfor a particular VM instance.365 * Terminates the R0 bits for a particular VM instance. 366 366 * 367 367 * This is normally called by ring-3 as part of the VM termination process, but … … 381 381 #endif 382 382 383 383 384 /* 384 385 * Tell GVMM what we're up to and check that we only do this once. … … 386 387 if (GVMMR0DoingTermVM(pVM, pGVM)) 387 388 { 389 /** @todo I wish to call PGMR0PhysFlushHandyPages(pVM, &pVM->aCpus[idCpu]) 390 * here to make sure we don't leak any shared pages if we crash... */ 388 391 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE 389 392 PGMR0DynMapTermVM(pVM); … … 1000 1003 return PGMR0PhysAllocateHandyPages(pVM, &pVM->aCpus[idCpu]); 1001 1004 1005 case VMMR0_DO_PGM_FLUSH_HANDY_PAGES: 1006 if (idCpu == NIL_VMCPUID) 1007 return VERR_INVALID_CPU_ID; 1008 return PGMR0PhysFlushHandyPages(pVM, &pVM->aCpus[idCpu]); 1009 1002 1010 case VMMR0_DO_PGM_ALLOCATE_LARGE_HANDY_PAGE: 1003 1011 if (idCpu == NIL_VMCPUID)
Note:
See TracChangeset
for help on using the changeset viewer.