Changeset 28639 in vbox
- Timestamp:
- Apr 23, 2010 12:46:38 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInline.h
r26150 r28639 1511 1511 { 1512 1512 Assert(pPoolPage->idx == PGM_PAGE_GET_TD_IDX(pPhysPage)); 1513 /* Invalidate the tracking data. */ 1513 1514 PGM_PAGE_SET_TRACKING(pPhysPage, 0); 1514 1515 } -
trunk/src/VBox/VMM/PGMInternal.h
r27584 r28639 635 635 /** The page state. 636 636 * Only 3 bits are really needed for this. */ 637 uint 8_t uStateY;637 uint16_t uStateY : 3; 638 638 /** The page type (PGMPAGETYPE). 639 639 * Only 3 bits are really needed for this. */ 640 uint8_t uTypeY; 640 uint16_t uTypeY : 3; 641 /** PTE index for usage tracking (page pool). */ 642 uint16_t uPteIdx : 10; 641 643 /** Usage tracking (page pool). */ 642 644 uint16_t u16TrackingY; … … 664 666 (pPage)->uStateY = 0; \ 665 667 (pPage)->uTypeY = 0; \ 668 (pPage)->uPteIdx = 0; \ 666 669 (pPage)->u16MiscY.u = 0; \ 667 670 (pPage)->u16TrackingY = 0; \ … … 681 684 (pPage)->uStateY = (_uState); \ 682 685 (pPage)->uTypeY = (_uType); \ 686 (pPage)->uPteIdx = 0; \ 683 687 (pPage)->u16MiscY.u = 0; \ 684 688 (pPage)->u16TrackingY = 0; \ … … 799 803 */ 800 804 #define PGM_PAGE_SET_TYPE(pPage, _enmType) do { (pPage)->uTypeY = (_enmType); } while (0) 805 806 /** 807 * Gets the page table index 808 * @returns The page table index. 809 * @param pPage Pointer to the physical guest page tracking structure. 810 */ 811 #define PGM_PAGE_GET_PTE_INDEX(pPage) (pPage)->uPteIdx 812 813 /** 814 * Sets the page table index 815 * @param pPage Pointer to the physical guest page tracking structure. 816 * @param iPte New page table index. 817 */ 818 #define PGM_PAGE_SET_PTE_INDEX(pPage, _iPte) do { (pPage)->uPteIdx = (_iPte); } while (0) 801 819 802 820 /** … … 1698 1716 /** The NIL index for the phys ext chain. */ 1699 1717 #define NIL_PGMPOOL_PHYSEXT_INDEX ((uint16_t)0xffff) 1718 /** The NIL pte index for a phys ext chain slot. */ 1719 #define NIL_PGMPOOL_PHYSEXT_IDX_PTE ((uint16_t)0xffff) 1700 1720 1701 1721 /** 1702 1722 * Node in the chain of physical cross reference extents. 1703 1723 * @todo Calling this an 'extent' is not quite right, find a better name. 1724 * @todo find out the optimal size of the aidx array 1704 1725 */ 1705 1726 #pragma pack(1) … … 1708 1729 /** The index to the next item in the chain. NIL_PGMPOOL_PHYSEXT_INDEX is no next. */ 1709 1730 uint16_t iNext; 1731 /** Alignment. */ 1732 uint16_t u16Align; 1710 1733 /** The user page index. */ 1711 1734 uint16_t aidx[3]; 1735 /** The page table index or NIL_PGMPOOL_PHYSEXT_IDX_PTE if unknown. */ 1736 uint16_t apte[3]; 1712 1737 } PGMPOOLPHYSEXT, *PPGMPOOLPHYSEXT; 1713 1738 typedef const PGMPOOLPHYSEXT *PCPGMPOOLPHYSEXT; … … 3408 3433 } 3409 3434 3410 uint16_t pgmPoolTrackPhysExtAddref(PVM pVM, uint16_t u16, uint16_t iShwPT);3435 uint16_t pgmPoolTrackPhysExtAddref(PVM pVM, PPGMPAGE pPhysPage, uint16_t u16, uint16_t iShwPT, uint16_t iPte); 3411 3436 void pgmPoolTrackPhysExtDerefGCPhys(PPGMPOOL pPool, PPGMPOOLPAGE pPoolPage, PPGMPAGE pPhysPage); 3412 3437 void pgmPoolMonitorChainChanging(PVMCPU pVCpu, PPGMPOOL pPool, PPGMPOOLPAGE pPage, RTGCPHYS GCPhysFault, CTXTYPE(RTGCPTR, RTHCPTR, RTGCPTR) pvAddress, unsigned cbWrite); -
trunk/src/VBox/VMM/PGMPool.cpp
r28260 r28639 238 238 paPhysExts[i].iNext = i + 1; 239 239 paPhysExts[i].aidx[0] = NIL_PGMPOOL_IDX; 240 paPhysExts[i].apte[0] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 240 241 paPhysExts[i].aidx[1] = NIL_PGMPOOL_IDX; 242 paPhysExts[i].apte[1] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 241 243 paPhysExts[i].aidx[2] = NIL_PGMPOOL_IDX; 244 paPhysExts[i].apte[2] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 242 245 } 243 246 paPhysExts[cMaxPhysExts - 1].iNext = NIL_PGMPOOL_PHYSEXT_INDEX; … … 751 754 paPhysExts[i].iNext = i + 1; 752 755 paPhysExts[i].aidx[0] = NIL_PGMPOOL_IDX; 756 paPhysExts[i].apte[0] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 753 757 paPhysExts[i].aidx[1] = NIL_PGMPOOL_IDX; 758 paPhysExts[i].apte[1] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 754 759 paPhysExts[i].aidx[2] = NIL_PGMPOOL_IDX; 760 paPhysExts[i].apte[2] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 755 761 } 756 762 paPhysExts[cMaxPhysExts - 1].iNext = NIL_PGMPOOL_PHYSEXT_INDEX; -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r28458 r28639 1369 1369 STAM_COUNTER_INC(&pVM->pgm.s.StatTrackVirgin); 1370 1370 u16 = PGMPOOL_TD_MAKE(1, pShwPage->idx); 1371 /* Save the page table index. */ 1372 PGM_PAGE_SET_PTE_INDEX(pPage, iPTDst); 1371 1373 } 1372 1374 else 1373 u16 = pgmPoolTrackPhysExtAddref(pVM, u16, pShwPage->idx);1375 u16 = pgmPoolTrackPhysExtAddref(pVM, pPage, u16, pShwPage->idx, iPTDst); 1374 1376 1375 1377 /* write back */ -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r28261 r28639 2953 2953 * @param fFlushPTEs Flush PTEs or allow them to be updated (e.g. in case of an RW bit change) 2954 2954 * @param iShw The shadow page table. 2955 * @param iPte Page table entry or NIL_PGMPOOL_PHYSEXT_IDX_PTE if unknown 2955 2956 * @param cRefs The number of references made in that PT. 2956 2957 */ 2957 static bool pgmPoolTrackFlushGCPhysPTInt(PVM pVM, PCPGMPAGE pPhysPage, bool fFlushPTEs, uint16_t iShw, uint16_t cRefs)2958 { 2959 LogFlow(("pgmPoolTrackFlushGCPhysPT: pPhysPage=%RHp iShw=%d cRefs=%d\n", PGM_PAGE_GET_HCPHYS(pPhysPage), iShw, cRefs));2958 static bool pgmPoolTrackFlushGCPhysPTInt(PVM pVM, PCPGMPAGE pPhysPage, bool fFlushPTEs, uint16_t iShw, uint16_t iPte, uint16_t cRefs) 2959 { 2960 LogFlow(("pgmPoolTrackFlushGCPhysPT: pPhysPage=%RHp iShw=%d iPte=%d cRefs=%d\n", PGM_PAGE_GET_HCPHYS(pPhysPage), iShw, iPte, cRefs)); 2960 2961 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 2961 2962 bool bRet = false; … … 2965 2966 */ 2966 2967 Assert(cRefs == 1); 2968 Assert(iPte != NIL_PGMPOOL_PHYSEXT_IDX_PTE); 2967 2969 AssertFatalMsg(iShw < pPool->cCurPages && iShw != NIL_PGMPOOL_IDX, ("iShw=%d\n", iShw)); 2968 2970 PPGMPOOLPAGE pPage = &pPool->aPages[iShw]; … … 3019 3021 } 3020 3022 3021 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pPT->a); i++) 3022 if ((pPT->a[i].u & (X86_PTE_PG_MASK | X86_PTE_P)) == u32) 3023 { 3024 X86PTE Pte; 3025 3026 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pte=%RX32 cRefs=%#x\n", i, pPT->a[i], cRefs)); 3027 Pte.u = (pPT->a[i].u & u32AndMask) | u32OrMask; 3028 if (Pte.u & PGM_PTFLAGS_TRACK_DIRTY) 3029 Pte.n.u1Write = 0; /* need to disallow writes when dirty bit tracking is still active. */ 3030 3031 ASMAtomicWriteSize(&pPT->a[i].u, Pte.u); 3032 cRefs--; 3033 if (!cRefs) 3034 return bRet; 3035 } 3023 if ((pPT->a[iPte].u & (X86_PTE_PG_MASK | X86_PTE_P)) == u32) 3024 { 3025 X86PTE Pte; 3026 3027 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pte=%RX32 cRefs=%#x\n", iPte, pPT->a[iPte], cRefs)); 3028 Pte.u = (pPT->a[iPte].u & u32AndMask) | u32OrMask; 3029 if (Pte.u & PGM_PTFLAGS_TRACK_DIRTY) 3030 Pte.n.u1Write = 0; /* need to disallow writes when dirty bit tracking is still active. */ 3031 3032 ASMAtomicWriteSize(&pPT->a[iPte].u, Pte.u); 3033 return bRet; 3034 } 3036 3035 #ifdef LOG_ENABLED 3037 3036 Log(("cRefs=%d iFirstPresent=%d cPresent=%d\n", cRefs, pPage->iFirstPresent, pPage->cPresent)); … … 3094 3093 } 3095 3094 3096 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pPT->a); i++) 3097 if ((pPT->a[i].u & (X86_PTE_PAE_PG_MASK | X86_PTE_P)) == u64) 3098 { 3099 X86PTEPAE Pte; 3100 3101 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pte=%RX64 cRefs=%#x\n", i, pPT->a[i], cRefs)); 3102 Pte.u = (pPT->a[i].u & u64AndMask) | u64OrMask; 3103 if (Pte.u & PGM_PTFLAGS_TRACK_DIRTY) 3104 Pte.n.u1Write = 0; /* need to disallow writes when dirty bit tracking is still active. */ 3105 3106 ASMAtomicWriteSize(&pPT->a[i].u, Pte.u); 3107 cRefs--; 3108 if (!cRefs) 3109 return bRet; 3110 } 3095 if ((pPT->a[iPte].u & (X86_PTE_PAE_PG_MASK | X86_PTE_P)) == u64) 3096 { 3097 X86PTEPAE Pte; 3098 3099 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pte=%RX64 cRefs=%#x\n", iPte, pPT->a[iPte], cRefs)); 3100 Pte.u = (pPT->a[iPte].u & u64AndMask) | u64OrMask; 3101 if (Pte.u & PGM_PTFLAGS_TRACK_DIRTY) 3102 Pte.n.u1Write = 0; /* need to disallow writes when dirty bit tracking is still active. */ 3103 3104 ASMAtomicWriteSize(&pPT->a[iPte].u, Pte.u); 3105 return bRet; 3106 } 3111 3107 #ifdef LOG_ENABLED 3112 3108 Log(("cRefs=%d iFirstPresent=%d cPresent=%d\n", cRefs, pPage->iFirstPresent, pPage->cPresent)); … … 3125 3121 const uint64_t u64 = PGM_PAGE_GET_HCPHYS(pPhysPage) | X86_PTE_P; 3126 3122 PEPTPT pPT = (PEPTPT)PGMPOOL_PAGE_2_PTR(pVM, pPage); 3127 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pPT->a); i++) 3128 if ((pPT->a[i].u & (EPT_PTE_PG_MASK | X86_PTE_P)) == u64) 3129 { 3130 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pte=%RX64 cRefs=%#x\n", i, pPT->a[i], cRefs)); 3131 STAM_COUNTER_INC(&pPool->StatTrackFlushEntry); 3132 pPT->a[i].u = 0; 3133 cRefs--; 3134 3135 /* Update the counter as we're removing references. */ 3136 Assert(pPage->cPresent); 3137 Assert(pPool->cPresent); 3138 pPage->cPresent--; 3139 pPool->cPresent--; 3140 3141 if (!cRefs) 3142 return bRet; 3143 } 3123 3124 if ((pPT->a[iPte].u & (EPT_PTE_PG_MASK | X86_PTE_P)) == u64) 3125 { 3126 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pte=%RX64 cRefs=%#x\n", iPte, pPT->a[iPte], cRefs)); 3127 STAM_COUNTER_INC(&pPool->StatTrackFlushEntry); 3128 pPT->a[iPte].u = 0; 3129 cRefs--; 3130 3131 /* Update the counter as we're removing references. */ 3132 Assert(pPage->cPresent); 3133 Assert(pPool->cPresent); 3134 pPage->cPresent--; 3135 pPool->cPresent--; 3136 return bRet; 3137 } 3144 3138 #ifdef LOG_ENABLED 3145 3139 Log(("cRefs=%d iFirstPresent=%d cPresent=%d\n", cRefs, pPage->iFirstPresent, pPage->cPresent)); … … 3163 3157 const uint64_t u64 = PGM_PAGE_GET_HCPHYS(pPhysPage) | X86_PDE4M_P | X86_PDE4M_PS; 3164 3158 PEPTPD pPD = (PEPTPD)PGMPOOL_PAGE_2_PTR(pVM, pPage); 3165 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pPD->a); i++) 3166 if ((pPD->a[i].u & (EPT_PDE2M_PG_MASK | X86_PDE4M_P | X86_PDE4M_PS)) == u64) 3167 { 3168 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pde=%RX64 cRefs=%#x\n", i, pPD->a[i], cRefs)); 3169 STAM_COUNTER_INC(&pPool->StatTrackFlushEntry); 3170 pPD->a[i].u = 0; 3171 cRefs--; 3172 3173 /* Update the counter as we're removing references. */ 3174 Assert(pPage->cPresent); 3175 Assert(pPool->cPresent); 3176 pPage->cPresent--; 3177 pPool->cPresent--; 3178 3179 if (!cRefs) 3180 return bRet; 3181 } 3159 3160 if ((pPD->a[iPte].u & (EPT_PDE2M_PG_MASK | X86_PDE4M_P | X86_PDE4M_PS)) == u64) 3161 { 3162 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pde=%RX64 cRefs=%#x\n", iPte, pPD->a[iPte], cRefs)); 3163 STAM_COUNTER_INC(&pPool->StatTrackFlushEntry); 3164 pPD->a[iPte].u = 0; 3165 cRefs--; 3166 3167 /* Update the counter as we're removing references. */ 3168 Assert(pPage->cPresent); 3169 Assert(pPool->cPresent); 3170 pPage->cPresent--; 3171 pPool->cPresent--; 3172 3173 return bRet; 3174 } 3182 3175 # ifdef LOG_ENABLED 3183 3176 Log(("cRefs=%d iFirstPresent=%d cPresent=%d\n", cRefs, pPage->iFirstPresent, pPage->cPresent)); … … 3200 3193 const uint64_t u64 = PGM_PAGE_GET_HCPHYS(pPhysPage) | X86_PDE4M_P | X86_PDE4M_PS; 3201 3194 PX86PD pPD = (PX86PD)PGMPOOL_PAGE_2_PTR(pVM, pPage); 3202 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pPD->a); i++) 3203 if ((pPD->a[i].u & (X86_PDE2M_PAE_PG_MASK | X86_PDE4M_P | X86_PDE4M_PS)) == u64) 3204 { 3205 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pde=%RX64 cRefs=%#x\n", i, pPD->a[i], cRefs)); 3206 STAM_COUNTER_INC(&pPool->StatTrackFlushEntry); 3207 pPD->a[i].u = 0; 3208 cRefs--; 3209 3210 /* Update the counter as we're removing references. */ 3211 Assert(pPage->cPresent); 3212 Assert(pPool->cPresent); 3213 pPage->cPresent--; 3214 pPool->cPresent--; 3215 3216 if (!cRefs) 3217 return bRet; 3218 } 3195 3196 if ((pPD->a[iPte].u & (X86_PDE2M_PAE_PG_MASK | X86_PDE4M_P | X86_PDE4M_PS)) == u64) 3197 { 3198 Log4(("pgmPoolTrackFlushGCPhysPTs: i=%d pde=%RX64 cRefs=%#x\n", iPte, pPD->a[iPte], cRefs)); 3199 STAM_COUNTER_INC(&pPool->StatTrackFlushEntry); 3200 pPD->a[iPte].u = 0; 3201 cRefs--; 3202 3203 /* Update the counter as we're removing references. */ 3204 Assert(pPage->cPresent); 3205 Assert(pPool->cPresent); 3206 pPage->cPresent--; 3207 pPool->cPresent--; 3208 return bRet; 3209 } 3219 3210 # ifdef LOG_ENABLED 3220 3211 Log(("cRefs=%d iFirstPresent=%d cPresent=%d\n", cRefs, pPage->iFirstPresent, pPage->cPresent)); … … 3256 3247 Log2(("pgmPoolTrackFlushGCPhysPT: pPhysPage=%RHp iShw=%d cRefs=%d\n", PGM_PAGE_GET_HCPHYS(pPhysPage), iShw, cRefs)); 3257 3248 STAM_PROFILE_START(&pPool->StatTrackFlushGCPhysPT, f); 3258 bool fKeptPTEs = pgmPoolTrackFlushGCPhysPTInt(pVM, pPhysPage, fFlushPTEs, iShw, cRefs);3249 bool fKeptPTEs = pgmPoolTrackFlushGCPhysPTInt(pVM, pPhysPage, fFlushPTEs, iShw, PGM_PAGE_GET_PTE_INDEX(pPhysPage), cRefs); 3259 3250 if (!fKeptPTEs) 3260 3251 PGM_PAGE_SET_TRACKING(pPhysPage, 0); … … 3290 3281 if (pPhysExt->aidx[i] != NIL_PGMPOOL_IDX) 3291 3282 { 3292 bool fKeptPTEs = pgmPoolTrackFlushGCPhysPTInt(pVM, pPhysPage, fFlushPTEs, pPhysExt->aidx[i], 1);3283 bool fKeptPTEs = pgmPoolTrackFlushGCPhysPTInt(pVM, pPhysPage, fFlushPTEs, pPhysExt->aidx[i], pPhysExt->apte[i], 1); 3293 3284 if (!fKeptPTEs) 3285 { 3294 3286 pPhysExt->aidx[i] = NIL_PGMPOOL_IDX; 3287 pPhysExt->apte[i] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 3288 } 3295 3289 else 3296 3290 fKeepList = true; … … 3306 3300 pPhysExt->iNext = pPool->iPhysExtFreeHead; 3307 3301 pPool->iPhysExtFreeHead = iPhysExtStart; 3302 /* Invalidate the tracking data. */ 3308 3303 PGM_PAGE_SET_TRACKING(pPhysPage, 0); 3309 3304 } … … 3762 3757 PPGMPOOLPHYSEXT pPhysExt = &pPool->CTX_SUFF(paPhysExts)[iPhysExt]; 3763 3758 for (unsigned i = 0; i < RT_ELEMENTS(pPhysExt->aidx); i++) 3759 { 3764 3760 pPhysExt->aidx[i] = NIL_PGMPOOL_IDX; 3761 pPhysExt->apte[i] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 3762 } 3765 3763 pPhysExt->iNext = pPool->iPhysExtFreeHead; 3766 3764 pPool->iPhysExtFreeHead = iPhysExt; … … 3786 3784 pPhysExt = &pPool->CTX_SUFF(paPhysExts)[iPhysExt]; 3787 3785 for (unsigned i = 0; i < RT_ELEMENTS(pPhysExt->aidx); i++) 3786 { 3788 3787 pPhysExt->aidx[i] = NIL_PGMPOOL_IDX; 3788 pPhysExt->apte[i] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 3789 } 3789 3790 3790 3791 /* next */ … … 3805 3806 * @param iPhysExt The physical extent index of the list head. 3806 3807 * @param iShwPT The shadow page table index. 3807 * 3808 */ 3809 static uint16_t pgmPoolTrackPhysExtInsert(PVM pVM, uint16_t iPhysExt, uint16_t iShwPT) 3808 * @param iPte Page table entry 3809 * 3810 */ 3811 static uint16_t pgmPoolTrackPhysExtInsert(PVM pVM, uint16_t iPhysExt, uint16_t iShwPT, uint16_t iPte) 3810 3812 { 3811 3813 Assert(PGMIsLockOwner(pVM)); … … 3817 3819 { 3818 3820 paPhysExts[iPhysExt].aidx[2] = iShwPT; 3821 paPhysExts[iPhysExt].apte[2] = iPte; 3819 3822 STAM_COUNTER_INC(&pVM->pgm.s.StatTrackAliasedMany); 3820 LogFlow(("pgmPoolTrackPhysExtInsert: %d:{,,%d }\n", iPhysExt, iShwPT));3823 LogFlow(("pgmPoolTrackPhysExtInsert: %d:{,,%d pte %d}\n", iPhysExt, iShwPT, iPte)); 3821 3824 return PGMPOOL_TD_MAKE(PGMPOOL_TD_CREFS_PHYSEXT, iPhysExt); 3822 3825 } … … 3832 3835 { 3833 3836 paPhysExts[iPhysExt].aidx[i] = iShwPT; 3837 paPhysExts[iPhysExt].apte[i] = iPte; 3834 3838 STAM_COUNTER_INC(&pVM->pgm.s.StatTrackAliasedMany); 3835 LogFlow(("pgmPoolTrackPhysExtInsert: %d:{%d } i=%d cMax=%d\n", iPhysExt, iShwPT, i, cMax));3839 LogFlow(("pgmPoolTrackPhysExtInsert: %d:{%d pte %d} i=%d cMax=%d\n", iPhysExt, iShwPT, iPte, i, cMax)); 3836 3840 return PGMPOOL_TD_MAKE(PGMPOOL_TD_CREFS_PHYSEXT, iPhysExtStart); 3837 3841 } … … 3856 3860 pNew->iNext = iPhysExtStart; 3857 3861 pNew->aidx[0] = iShwPT; 3858 LogFlow(("pgmPoolTrackPhysExtInsert: added new extent %d:{%d}->%d\n", iPhysExt, iShwPT, iPhysExtStart)); 3862 pNew->apte[1] = iPte; 3863 LogFlow(("pgmPoolTrackPhysExtInsert: added new extent %d:{%d pte %d}->%d\n", iPhysExt, iShwPT, iPte, iPhysExtStart)); 3859 3864 return PGMPOOL_TD_MAKE(PGMPOOL_TD_CREFS_PHYSEXT, iPhysExt); 3860 3865 } … … 3867 3872 * 3868 3873 * @param pVM The VM handle. 3874 * @param pPhysPage Pointer to the aPages entry in the ram range. 3869 3875 * @param u16 The ram range flags (top 16-bits). 3870 3876 * @param iShwPT The shadow page table index. 3871 */ 3872 uint16_t pgmPoolTrackPhysExtAddref(PVM pVM, uint16_t u16, uint16_t iShwPT) 3877 * @param iPte Page table entry 3878 */ 3879 uint16_t pgmPoolTrackPhysExtAddref(PVM pVM, PPGMPAGE pPhysPage, uint16_t u16, uint16_t iShwPT, uint16_t iPte) 3873 3880 { 3874 3881 pgmLock(pVM); … … 3886 3893 STAM_COUNTER_INC(&pVM->pgm.s.StatTrackAliased); 3887 3894 pPhysExt->aidx[0] = PGMPOOL_TD_GET_IDX(u16); 3895 pPhysExt->apte[0] = PGM_PAGE_GET_PTE_INDEX(pPhysPage); 3888 3896 pPhysExt->aidx[1] = iShwPT; 3897 pPhysExt->apte[1] = iPte; 3889 3898 u16 = PGMPOOL_TD_MAKE(PGMPOOL_TD_CREFS_PHYSEXT, iPhysExt); 3890 3899 } … … 3897 3906 * Insert into the extent list. 3898 3907 */ 3899 u16 = pgmPoolTrackPhysExtInsert(pVM, PGMPOOL_TD_GET_IDX(u16), iShwPT );3908 u16 = pgmPoolTrackPhysExtInsert(pVM, PGMPOOL_TD_GET_IDX(u16), iShwPT, iPte); 3900 3909 } 3901 3910 else … … 3905 3914 } 3906 3915 3907 3908 3916 /** 3909 3917 * Clear references to guest physical memory. … … 3938 3946 { 3939 3947 paPhysExts[iPhysExt].aidx[i] = NIL_PGMPOOL_IDX; 3948 paPhysExts[iPhysExt].apte[i] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 3940 3949 3941 3950 for (i = 0; i < RT_ELEMENTS(paPhysExts[iPhysExt].aidx); i++) … … 3989 3998 } 3990 3999 3991 3992 4000 /** 3993 4001 * Clear references to guest physical memory. … … 5137 5145 paPhysExts[i].iNext = i + 1; 5138 5146 paPhysExts[i].aidx[0] = NIL_PGMPOOL_IDX; 5147 paPhysExts[i].apte[0] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 5139 5148 paPhysExts[i].aidx[1] = NIL_PGMPOOL_IDX; 5149 paPhysExts[i].apte[1] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 5140 5150 paPhysExts[i].aidx[2] = NIL_PGMPOOL_IDX; 5151 paPhysExts[i].apte[2] = NIL_PGMPOOL_PHYSEXT_IDX_PTE; 5141 5152 } 5142 5153 paPhysExts[cMaxPhysExts - 1].iNext = NIL_PGMPOOL_PHYSEXT_INDEX;
Note:
See TracChangeset
for help on using the changeset viewer.