Changeset 22788 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Sep 4, 2009 3:37:07 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r22783 r22788 3994 3994 DECLINLINE(void) pgmPoolTrackDerefPTPae32Bit(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PTPAE pShwPT, PCX86PT pGstPT) 3995 3995 { 3996 for (unsigned i = 0; i < RT_ELEMENTS(pShwPT->a); i++)3996 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++) 3997 3997 if (pShwPT->a[i].n.u1Present) 3998 3998 { … … 4000 4000 i, pShwPT->a[i].u & X86_PTE_PAE_PG_MASK, pGstPT->a[i].u & X86_PTE_PG_MASK)); 4001 4001 pgmPoolTracDerefGCPhysHint(pPool, pPage, pShwPT->a[i].u & X86_PTE_PAE_PG_MASK, pGstPT->a[i].u & X86_PTE_PG_MASK); 4002 if (!--pPage->cPresent) 4003 break; 4002 4004 } 4003 4005 } … … 4014 4016 DECLINLINE(void) pgmPoolTrackDerefPTPaePae(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PTPAE pShwPT, PCX86PTPAE pGstPT) 4015 4017 { 4016 for (unsigned i = 0; i < RT_ELEMENTS(pShwPT->a); i++)4018 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++) 4017 4019 if (pShwPT->a[i].n.u1Present) 4018 4020 { … … 4020 4022 i, pShwPT->a[i].u & X86_PTE_PAE_PG_MASK, pGstPT->a[i].u & X86_PTE_PAE_PG_MASK)); 4021 4023 pgmPoolTracDerefGCPhysHint(pPool, pPage, pShwPT->a[i].u & X86_PTE_PAE_PG_MASK, pGstPT->a[i].u & X86_PTE_PAE_PG_MASK); 4024 if (!--pPage->cPresent) 4025 break; 4022 4026 } 4023 4027 } … … 4033 4037 DECLINLINE(void) pgmPoolTrackDerefPT32Bit4MB(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PT pShwPT) 4034 4038 { 4035 RTGCPHYS GCPhys = pPage->GCPhys ;4036 for (unsigned i = 0; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)4039 RTGCPHYS GCPhys = pPage->GCPhys + PAGE_SIZE * pPage->iFirstPresent; 4040 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE) 4037 4041 if (pShwPT->a[i].n.u1Present) 4038 4042 { … … 4040 4044 i, pShwPT->a[i].u & X86_PTE_PG_MASK, GCPhys)); 4041 4045 pgmPoolTracDerefGCPhys(pPool, pPage, pShwPT->a[i].u & X86_PTE_PG_MASK, GCPhys); 4046 if (!--pPage->cPresent) 4047 break; 4042 4048 } 4043 4049 } … … 4053 4059 DECLINLINE(void) pgmPoolTrackDerefPTPaeBig(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PX86PTPAE pShwPT) 4054 4060 { 4055 RTGCPHYS GCPhys = pPage->GCPhys ;4056 for (unsigned i = 0; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)4061 RTGCPHYS GCPhys = pPage->GCPhys + PAGE_SIZE * pPage->iFirstPresent; 4062 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE) 4057 4063 if (pShwPT->a[i].n.u1Present) 4058 4064 { … … 4060 4066 i, pShwPT->a[i].u & X86_PTE_PAE_PG_MASK, GCPhys)); 4061 4067 pgmPoolTracDerefGCPhys(pPool, pPage, pShwPT->a[i].u & X86_PTE_PAE_PG_MASK, GCPhys); 4068 if (!--pPage->cPresent) 4069 break; 4070 } 4071 } 4072 4073 4074 /** 4075 * Clear references to shadowed pages in an EPT page table. 4076 * 4077 * @param pPool The pool. 4078 * @param pPage The page. 4079 * @param pShwPML4 The shadow page directory pointer table (mapping of the page). 4080 */ 4081 DECLINLINE(void) pgmPoolTrackDerefPTEPT(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PEPTPT pShwPT) 4082 { 4083 RTGCPHYS GCPhys = pPage->GCPhys + PAGE_SIZE * pPage->iFirstPresent; 4084 for (unsigned i = pPage->iFirstPresent; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE) 4085 if (pShwPT->a[i].n.u1Present) 4086 { 4087 Log4(("pgmPoolTrackDerefPTEPT: i=%d pte=%RX64 GCPhys=%RX64\n", 4088 i, pShwPT->a[i].u & EPT_PTE_PG_MASK, pPage->GCPhys)); 4089 pgmPoolTracDerefGCPhys(pPool, pPage, pShwPT->a[i].u & EPT_PTE_PG_MASK, GCPhys); 4090 if (!--pPage->cPresent) 4091 break; 4062 4092 } 4063 4093 } … … 4186 4216 } 4187 4217 } 4188 }4189 4190 4191 /**4192 * Clear references to shadowed pages in an EPT page table.4193 *4194 * @param pPool The pool.4195 * @param pPage The page.4196 * @param pShwPML4 The shadow page directory pointer table (mapping of the page).4197 */4198 DECLINLINE(void) pgmPoolTrackDerefPTEPT(PPGMPOOL pPool, PPGMPOOLPAGE pPage, PEPTPT pShwPT)4199 {4200 RTGCPHYS GCPhys = pPage->GCPhys;4201 for (unsigned i = 0; i < RT_ELEMENTS(pShwPT->a); i++, GCPhys += PAGE_SIZE)4202 if (pShwPT->a[i].n.u1Present)4203 {4204 Log4(("pgmPoolTrackDerefPTEPT: i=%d pte=%RX64 GCPhys=%RX64\n",4205 i, pShwPT->a[i].u & EPT_PTE_PG_MASK, pPage->GCPhys));4206 pgmPoolTracDerefGCPhys(pPool, pPage, pShwPT->a[i].u & EPT_PTE_PG_MASK, GCPhys);4207 }4208 4218 } 4209 4219
Note:
See TracChangeset
for help on using the changeset viewer.