Changeset 36970 in vbox
- Timestamp:
- May 5, 2011 10:05:34 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r36944 r36970 362 362 { 363 363 /** The mapping object. */ 364 RTR0MEMOBJ MapObj;364 RTR0MEMOBJ MapObj; 365 365 /** The VM owning the mapping. */ 366 PGVM pGVM;366 PGVM pGVM; 367 367 } GMMCHUNKMAP; 368 368 /** Pointer to a GMM allocation chunk mapping. */ … … 426 426 { 427 427 /** The chunk id. */ 428 uint32_t idChunk;428 uint32_t idChunk; 429 429 /** Pointer to the chunk. */ 430 PGMMCHUNK pChunk;430 PGMMCHUNK pChunk; 431 431 } GMMCHUNKTLBE; 432 432 /** Pointer to an allocation chunk TLB entry. */ … … 464 464 { 465 465 /** The number of free pages in the set. */ 466 uint64_t cFreePages;466 uint64_t cFreePages; 467 467 /** Chunks ordered by increasing number of free pages. */ 468 PGMMCHUNK apLists[GMM_CHUNK_FREE_SET_LISTS];468 PGMMCHUNK apLists[GMM_CHUNK_FREE_SET_LISTS]; 469 469 } GMMCHUNKFREESET; 470 470 … … 1069 1069 { 1070 1070 if (pChunk->paMappings[i].pGVM != pGVM) 1071 SUPR0Printf("gmmR0CleanupVMDestroyChunk: %p/%#x: mapping #%x: pGVM=%p ex epcted %p\n", pChunk,1071 SUPR0Printf("gmmR0CleanupVMDestroyChunk: %p/%#x: mapping #%x: pGVM=%p expected %p\n", pChunk, 1072 1072 pChunk->Core.Key, i, pChunk->paMappings[i].pGVM, pGVM); 1073 1073 int rc = RTR0MemObjFree(pChunk->paMappings[i].MapObj, false /* fFreeMappings (NA) */); … … 2529 2529 { 2530 2530 /** @todo R0 -> VM request */ 2531 /* The chunk can be owned by more than one VM if fBoundMemoryMode is false! */2531 /* The chunk can be mapped by more than one VM if fBoundMemoryMode is false! */ 2532 2532 Log(("gmmR0FreeChunk: chunk still has %d mappings; don't free!\n", pChunk->cMappings)); 2533 2533 } … … 3278 3278 if (RT_SUCCESS(rc)) 3279 3279 { 3280 /* reallocate the array? */ 3281 if ((pChunk->cMappings & 1 /*7*/) == 0) 3282 { 3283 void *pvMappings = RTMemRealloc(pChunk->paMappings, (pChunk->cMappings + 2 /*8*/) * sizeof(pChunk->paMappings[0])); 3280 /* reallocate the array? assumes few users per chunk (usually one). */ 3281 if ( pChunk->cMappings <= 3 3282 || (pChunk->cMappings & 3) == 0) 3283 { 3284 unsigned cNewSize = pChunk->cMappings <= 3 3285 ? pChunk->cMappings + 1 3286 : pChunk->cMappings + 4; 3287 Assert(cNewSize < 4 || RT_ALIGN_32(cNewSize, 4) == cNewSize); 3288 void *pvMappings = RTMemRealloc(pChunk->paMappings, cNewSize * sizeof(pChunk->paMappings[0])); 3284 3289 if (RT_UNLIKELY(!pvMappings)) 3285 3290 { … … 3293 3298 /* insert new entry */ 3294 3299 pChunk->paMappings[pChunk->cMappings].MapObj = MapObj; 3295 pChunk->paMappings[pChunk->cMappings].pGVM = pGVM;3300 pChunk->paMappings[pChunk->cMappings].pGVM = pGVM; 3296 3301 pChunk->cMappings++; 3297 3302 … … 3301 3306 return rc; 3302 3307 } 3308 3303 3309 3304 3310 /** … … 3327 3333 return false; 3328 3334 } 3335 3329 3336 3330 3337 /** … … 3849 3856 } 3850 3857 3851 3852 3858 #ifdef VBOX_WITH_PAGE_SHARING 3859 3853 3860 /** 3854 3861 * Checks specified shared module range for changes … … 4057 4064 return 0; 4058 4065 } 4059 #endif 4066 4067 #endif /* VBOX_WITH_PAGE_SHARING */ 4060 4068 4061 4069 /** … … 4103 4111 4104 4112 #ifdef VBOX_WITH_PAGE_SHARING 4113 4105 4114 typedef struct 4106 4115 { … … 4129 4138 return 0; 4130 4139 } 4131 #endif 4132 4140 4141 #endif /* VBOX_WITH_PAGE_SHARING */ 4133 4142 #ifdef DEBUG_sandervl 4143 4134 4144 /** 4135 4145 * Setup for a GMMR0CheckSharedModules call (to allow log flush jumps back to ring 3) … … 4176 4186 return VINF_SUCCESS; 4177 4187 } 4178 #endif 4188 4189 #endif /* DEBUG_sandervl */ 4179 4190 4180 4191 /** … … 4235 4246 4236 4247 #if defined(VBOX_STRICT) && HC_ARCH_BITS == 64 4248 4237 4249 typedef struct 4238 4250 { … … 4291 4303 } 4292 4304 4305 4293 4306 /** 4294 4307 * Find a duplicate of the specified page in other active VMs
Note:
See TracChangeset
for help on using the changeset viewer.