Changeset 43045 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Aug 28, 2012 2:21:43 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r42976 r43045 3288 3288 Assert(pGMM->cAllocatedPages > 0); 3289 3289 Assert(!pPage->Shared.cRefs); 3290 #if defined(VBOX_WITH_PAGE_SHARING) && defined(VBOX_STRICT) && HC_ARCH_BITS == 643291 if (pPage->Shared.u14Checksum)3292 {3293 uint32_t uChecksum = gmmR0StrictPageChecksum(pGMM, pGVM, idPage);3294 uChecksum &= UINT32_C(0x00003fff);3295 AssertMsg(!uChecksum || uChecksum == pPage->Shared.u14Checksum,3296 ("%#x vs %#x - idPage=%#x\n", uChecksum, pPage->Shared.u14Checksum, idPage));3297 }3298 #endif3299 3290 3300 3291 pChunk->cShared--; … … 3404 3395 { 3405 3396 Assert(pGVM->gmm.s.Stats.cSharedPages); 3397 Assert(pPage->Shared.cRefs); 3398 #if defined(VBOX_WITH_PAGE_SHARING) && defined(VBOX_STRICT) && HC_ARCH_BITS == 64 3399 if (pPage->Shared.u14Checksum) 3400 { 3401 uint32_t uChecksum = gmmR0StrictPageChecksum(pGMM, pGVM, idPage); 3402 uChecksum &= UINT32_C(0x00003fff); 3403 AssertMsg(!uChecksum || uChecksum == pPage->Shared.u14Checksum, 3404 ("%#x vs %#x - idPage=%#x\n", uChecksum, pPage->Shared.u14Checksum, idPage)); 3405 } 3406 #endif 3406 3407 pGVM->gmm.s.Stats.cSharedPages--; 3407 Assert(pPage->Shared.cRefs);3408 3408 if (!--pPage->Shared.cRefs) 3409 3409 gmmR0FreeSharedPage(pGMM, pGVM, idPage, pPage); … … 4706 4706 * @param pPage The page structure. 4707 4707 */ 4708 DECLINLINE(void) gmmR0ConvertToSharedPage(PGMM pGMM, PGVM pGVM, RTHCPHYS HCPhys, uint32_t idPage, PGMMPAGE pPage) 4708 DECLINLINE(void) gmmR0ConvertToSharedPage(PGMM pGMM, PGVM pGVM, RTHCPHYS HCPhys, uint32_t idPage, PGMMPAGE pPage, 4709 PGMMSHAREDPAGEDESC pPageDesc) 4709 4710 { 4710 4711 PGMMCHUNK pChunk = gmmR0GetChunk(pGMM, idPage >> GMM_CHUNKID_SHIFT); … … 4725 4726 pPage->Shared.cRefs = 1; 4726 4727 #ifdef VBOX_STRICT 4727 pPage->Shared.u14Checksum = gmmR0StrictPageChecksum(pGMM, pGVM, idPage); 4728 pPageDesc->u32StrictChecksum = gmmR0StrictPageChecksum(pGMM, pGVM, idPage); 4729 pPage->Shared.u14Checksum = pPageDesc->u32StrictChecksum; 4728 4730 #else 4729 4731 pPage->Shared.u14Checksum = 0; … … 4745 4747 AssertMsg(pPageDesc->GCPhys == (pPage->Private.pfn << 12), ("desc %RGp gmm %RGp\n", pPageDesc->HCPhys, (pPage->Private.pfn << 12))); 4746 4748 4747 gmmR0ConvertToSharedPage(pGMM, pGVM, pPageDesc->HCPhys, pPageDesc->idPage, pPage );4749 gmmR0ConvertToSharedPage(pGMM, pGVM, pPageDesc->HCPhys, pPageDesc->idPage, pPage, pPageDesc); 4748 4750 4749 4751 /* Keep track of these references. */ … … 4779 4781 PGMM pGMM; 4780 4782 GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE); 4783 pPageDesc->u32StrictChecksum = 0; 4781 4784 4782 4785 AssertMsgReturn(idxRegion < pModule->cRegions, … … 4873 4876 } 4874 4877 uint8_t *pbSharedPage = pbChunk + ((pGlobalRegion->paidPages[idxPage] & GMM_PAGEID_IDX_MASK) << PAGE_SHIFT); 4878 4875 4879 #ifdef VBOX_STRICT 4876 if (pPage->Shared.u14Checksum) 4877 { 4878 uint32_t uChecksum = RTCrc32(pbSharedPage, PAGE_SIZE) & UINT32_C(0x00003fff); 4879 AssertMsg(!uChecksum || uChecksum == pPage->Shared.u14Checksum, 4880 ("%#x vs %#x - idPage=%# - %s %s\n", uChecksum, pPage->Shared.u14Checksum, 4881 pGlobalRegion->paidPages[idxPage], pModule->szName, pModule->szVersion)); 4882 } 4880 pPageDesc->u32StrictChecksum = RTCrc32(pbSharedPage, PAGE_SIZE); 4881 uint32_t uChecksum = pPageDesc->u32StrictChecksum & UINT32_C(0x00003fff); 4882 AssertMsg(!uChecksum || uChecksum == pPage->Shared.u14Checksum || !pPage->Shared.u14Checksum, 4883 ("%#x vs %#x - idPage=%# - %s %s\n", uChecksum, pPage->Shared.u14Checksum, 4884 pGlobalRegion->paidPages[idxPage], pModule->szName, pModule->szVersion)); 4883 4885 #endif 4884 4886 … … 4948 4950 RTAvlGCPtrDestroy(&pGVM->gmm.s.pSharedModuleTree, gmmR0CleanupSharedModule, &Args); 4949 4951 4950 Assert (pGVM->gmm.s.Stats.cShareableModules == 0);4952 AssertMsg(pGVM->gmm.s.Stats.cShareableModules == 0, ("%d\n", pGVM->gmm.s.Stats.cShareableModules)); 4951 4953 pGVM->gmm.s.Stats.cShareableModules = 0; 4952 4954 -
trunk/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp
r43042 r43045 130 130 pVM->pgm.s.cPrivatePages--; 131 131 PGM_PAGE_SET_STATE(pVM, pPage, PGM_PAGE_STATE_SHARED); 132 133 # ifdef VBOX_STRICT /* check sum hack */ 134 pPage->s.u2Unused0 = PageDesc.u32StrictChecksum & 3; 135 pPage->s.u2Unused1 = (PageDesc.u32StrictChecksum >> 8) & 3; 136 # endif 132 137 } 133 138 }
Note:
See TracChangeset
for help on using the changeset viewer.