- Timestamp:
- May 7, 2010 3:34:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r29217 r29222 214 214 struct GMMPAGESHARED 215 215 { 216 /** The guest page frame number. (Max addressable: 2 ^ 44 - 16) */216 /** The host page frame number. (Max addressable: 2 ^ 44 - 16) */ 217 217 uint32_t pfn; 218 218 /** The reference count (64K VMs). */ 219 219 uint32_t cRefs : 16; 220 220 /** Reserved. Checksum or something? Two hGVMs for forking? */ 221 uint32_t u 30Reserved : 14;221 uint32_t u14Reserved : 14; 222 222 /** The page state. */ 223 223 uint32_t u2State : 2; … … 2625 2625 * @param pGMM Pointer to the GMM instance. 2626 2626 * @param pGVM Pointer to the GVM instance. 2627 * @param HCPhys Host physical address 2627 2628 * @param idPage The Page ID 2628 2629 * @param pPage The page structure. 2629 2630 */ 2630 DECLINLINE(void) gmmR0ConvertToSharedPage(PGMM pGMM, PGVM pGVM, uint32_t idPage, PGMMPAGE pPage)2631 DECLINLINE(void) gmmR0ConvertToSharedPage(PGMM pGMM, PGVM pGVM, RTHCPHYS HCPhys, uint32_t idPage, PGMMPAGE pPage) 2631 2632 { 2632 2633 PGMMCHUNK pChunk = gmmR0GetChunk(pGMM, idPage >> GMM_CHUNKID_SHIFT); … … 2644 2645 2645 2646 /* Modify the page structure. */ 2646 pPage->Shared.pfn = pPage->Private.pfn; /* same location */2647 pPage->Shared.pfn = (uint32_t)(HCPhys >> PAGE_SHIFT); 2647 2648 pPage->Shared.cRefs = 1; 2648 2649 pPage->Common.u2State = GMM_PAGE_STATE_SHARED; … … 3700 3701 * 3701 3702 * Performs the following tasks: 3702 * - if a shared page is new, then it changes the GMM page type to shared and returns it in the pa HCPhysPageIDarray3703 * - if a shared page already exists, then it checks if the VM page is identical and if so frees the VM page and returns the shared page in the pa HCPhysPageIDarray3703 * - if a shared page is new, then it changes the GMM page type to shared and returns it in the paPageDesc array 3704 * - if a shared page already exists, then it checks if the VM page is identical and if so frees the VM page and returns the shared page in the paPageDesc array 3704 3705 * 3705 3706 * @returns VBox status code. … … 3708 3709 * @param pReq Module description 3709 3710 * @param idxRegion Region index 3710 * @param cPages Number of entries in the pa HCPhysAndPageIDarray3711 * @param cPages Number of entries in the paPageDesc array 3711 3712 * @param paPageDesc Page descriptor array (in/out) 3712 3713 */ … … 3769 3770 { 3770 3771 /* We've seen this shared page for the first time? */ 3771 if (pGlobalRegion->paHCPhysPageID [i]== NIL_GMM_PAGEID)3772 if (pGlobalRegion->paHCPhysPageID == NIL_GMM_PAGEID) 3772 3773 { 3773 3774 /* Easy case: just change the internal page type. */ … … 3779 3780 goto end; 3780 3781 } 3781 Log(("New shared page guest %RGp host %RHp\n", paPageDesc[i].GCPhys, (pPage->Private.pfn << 12)));3782 Log(("New shared page guest %RGp host %RHp\n", paPageDesc[i].GCPhys, paPageDesc[i].HCPhys)); 3782 3783 3783 3784 Assert(paPageDesc[i].HCPhys == (pPage->Private.pfn << 12)); 3784 3785 3785 gmmR0ConvertToSharedPage(pGMM, pGVM, paPageDesc[i]. uHCPhysPageId, pPage);3786 gmmR0ConvertToSharedPage(pGMM, pGVM, paPageDesc[i].HCPhys, paPageDesc[i].uHCPhysPageId, pPage); 3786 3787 3787 3788 /* Keep track of these references. */ … … 3806 3807 Assert(pPage->Common.u2State == GMM_PAGE_STATE_SHARED); 3807 3808 3808 Log(("Replace existing page guest %RGp host %RHp -> %RHp\n", paPageDesc[i].GCPhys, paPageDesc[i].HCPhys, (pPage->Private.pfn << 12)));3809 Log(("Replace existing page guest %RGp host %RHp -> %RHp\n", paPageDesc[i].GCPhys, paPageDesc[i].HCPhys, pPage->Shared.pfn << PAGE_SHIFT)); 3809 3810 3810 3811 /* Calculate the virtual address of the local page. */ … … 3860 3861 3861 3862 /* Pass along the new physical address & page id. */ 3862 paPageDesc[i].HCPhys = (pPage->Private.pfn << 12);3863 paPageDesc[i].HCPhys = pPage->Shared.pfn << PAGE_SHIFT; 3863 3864 paPageDesc[i].uHCPhysPageId = pGlobalRegion->paHCPhysPageID[i]; 3864 3865 }
Note:
See TracChangeset
for help on using the changeset viewer.