Changeset 26018 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jan 25, 2010 4:06:26 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56903
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r25937 r26018 1017 1017 AssertMsg(rc == VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT || rc == VERR_PAGE_MAP_LEVEL4_NOT_PRESENT, ("Unexpected rc=%Rrc\n", rc)); 1018 1018 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePageSkipped)); 1019 if (!VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3))1020 PGM_INVL_VCPU_TLBS(pVCpu);1021 1019 return VINF_SUCCESS; 1022 1020 } … … 1029 1027 { 1030 1028 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePageSkipped)); 1031 if (!VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3))1032 PGM_INVL_VCPU_TLBS(pVCpu);1033 1029 return VINF_SUCCESS; 1034 1030 } … … 1101 1097 # endif /* IN_RING3 */ 1102 1098 1103 # if PGM_GST_TYPE == PGM_TYPE_AMD641104 /* Fetch the pgm pool shadow descriptor. */1105 PPGMPOOLPAGE pShwPdpt = pgmPoolGetPage(pPool, pPml4eDst->u & X86_PML4E_PG_MASK);1106 Assert(pShwPdpt);1107 1108 /* Fetch the pgm pool shadow descriptor. */1109 PPGMPOOLPAGE pShwPde = pgmPoolGetPage(pPool, pPdptDst->a[iPdpt].u & SHW_PDPE_PG_MASK);1110 Assert(pShwPde);1111 1112 Assert(pPml4eDst->n.u1Present && (pPml4eDst->u & SHW_PDPT_MASK));1113 RTGCPHYS GCPhysPdpt = pPml4eSrc->u & X86_PML4E_PG_MASK;1114 1115 if ( !pPml4eSrc->n.u1Present1116 || pShwPdpt->GCPhys != GCPhysPdpt)1117 {1118 LogFlow(("InvalidatePage: Out-of-sync PML4E (P/GCPhys) at %RGv GCPhys=%RGp vs %RGp Pml4eSrc=%RX64 Pml4eDst=%RX64\n",1119 GCPtrPage, pShwPdpt->GCPhys, GCPhysPdpt, (uint64_t)pPml4eSrc->u, (uint64_t)pPml4eDst->u));1120 pgmPoolFreeByPage(pPool, pShwPdpt, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4);1121 ASMAtomicWriteSize(pPml4eDst, 0);1122 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNPs));1123 PGM_INVL_VCPU_TLBS(pVCpu);1124 return VINF_SUCCESS;1125 }1126 if ( pPml4eSrc->n.u1User != pPml4eDst->n.u1User1127 || (!pPml4eSrc->n.u1Write && pPml4eDst->n.u1Write))1128 {1129 /*1130 * Mark not present so we can resync the PML4E when it's used.1131 */1132 LogFlow(("InvalidatePage: Out-of-sync PML4E at %RGv Pml4eSrc=%RX64 Pml4eDst=%RX64\n",1133 GCPtrPage, (uint64_t)pPml4eSrc->u, (uint64_t)pPml4eDst->u));1134 pgmPoolFreeByPage(pPool, pShwPdpt, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4);1135 ASMAtomicWriteSize(pPml4eDst, 0);1136 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDOutOfSync));1137 PGM_INVL_VCPU_TLBS(pVCpu);1138 }1139 else if (!pPml4eSrc->n.u1Accessed)1140 {1141 /*1142 * Mark not present so we can set the accessed bit.1143 */1144 LogFlow(("InvalidatePage: Out-of-sync PML4E (A) at %RGv Pml4eSrc=%RX64 Pml4eDst=%RX64\n",1145 GCPtrPage, (uint64_t)pPml4eSrc->u, (uint64_t)pPml4eDst->u));1146 pgmPoolFreeByPage(pPool, pShwPdpt, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4);1147 ASMAtomicWriteSize(pPml4eDst, 0);1148 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNAs));1149 PGM_INVL_VCPU_TLBS(pVCpu);1150 }1151 1152 /* Check if the PDPT entry has changed. */1153 Assert(pPdpeDst->n.u1Present && pPdpeDst->u & SHW_PDPT_MASK);1154 RTGCPHYS GCPhysPd = PdpeSrc.u & GST_PDPE_PG_MASK;1155 if ( !PdpeSrc.n.u1Present1156 || pShwPde->GCPhys != GCPhysPd)1157 {1158 LogFlow(("InvalidatePage: Out-of-sync PDPE (P/GCPhys) at %RGv GCPhys=%RGp vs %RGp PdpeSrc=%RX64 PdpeDst=%RX64\n",1159 GCPtrPage, pShwPde->GCPhys, GCPhysPd, (uint64_t)PdpeSrc.u, (uint64_t)pPdpeDst->u));1160 pgmPoolFreeByPage(pPool, pShwPde, pShwPdpt->idx, iPdpt);1161 ASMAtomicWriteSize(pPdpeDst, 0);1162 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNPs));1163 PGM_INVL_VCPU_TLBS(pVCpu);1164 return VINF_SUCCESS;1165 }1166 if ( PdpeSrc.lm.u1User != pPdpeDst->lm.u1User1167 || (!PdpeSrc.lm.u1Write && pPdpeDst->lm.u1Write))1168 {1169 /*1170 * Mark not present so we can resync the PDPTE when it's used.1171 */1172 LogFlow(("InvalidatePage: Out-of-sync PDPE at %RGv PdpeSrc=%RX64 PdpeDst=%RX64\n",1173 GCPtrPage, (uint64_t)PdpeSrc.u, (uint64_t)pPdpeDst->u));1174 pgmPoolFreeByPage(pPool, pShwPde, pShwPdpt->idx, iPdpt);1175 ASMAtomicWriteSize(pPdpeDst, 0);1176 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDOutOfSync));1177 PGM_INVL_VCPU_TLBS(pVCpu);1178 }1179 else if (!PdpeSrc.lm.u1Accessed)1180 {1181 /*1182 * Mark not present so we can set the accessed bit.1183 */1184 LogFlow(("InvalidatePage: Out-of-sync PDPE (A) at %RGv PdpeSrc=%RX64 PdpeDst=%RX64\n",1185 GCPtrPage, (uint64_t)PdpeSrc.u, (uint64_t)pPdpeDst->u));1186 pgmPoolFreeByPage(pPool, pShwPde, pShwPdpt->idx, iPdpt);1187 ASMAtomicWriteSize(pPdpeDst, 0);1188 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNAs));1189 PGM_INVL_VCPU_TLBS(pVCpu);1190 }1191 # endif /* PGM_GST_TYPE == PGM_TYPE_AMD64 */1192 1193 1099 /* 1194 1100 * Deal with the Guest PDE. … … 1197 1103 if (PdeSrc.n.u1Present) 1198 1104 { 1105 Assert( PdeSrc.n.u1User == PdeDst.n.u1User 1106 && (PdeSrc.n.u1Write || !PdeDst.n.u1Write)); 1199 1107 # ifndef PGM_WITHOUT_MAPPING 1200 1108 if (PdeDst.u & PGM_PDFLAGS_MAPPING) … … 1211 1119 else 1212 1120 # endif /* !PGM_WITHOUT_MAPPING */ 1213 if ( PdeSrc.n.u1User != PdeDst.n.u1User 1214 || (!PdeSrc.n.u1Write && PdeDst.n.u1Write)) 1215 { 1216 /* 1217 * Mark not present so we can resync the PDE when it's used. 1218 */ 1219 LogFlow(("InvalidatePage: Out-of-sync at %RGp PdeSrc=%RX64 PdeDst=%RX64\n", 1220 GCPtrPage, (uint64_t)PdeSrc.u, (uint64_t)PdeDst.u)); 1221 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1222 ASMAtomicWriteSize(pPdeDst, 0); 1223 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDOutOfSync)); 1224 PGM_INVL_VCPU_TLBS(pVCpu); 1225 } 1226 else if (!PdeSrc.n.u1Accessed) 1227 { 1228 /* 1229 * Mark not present so we can set the accessed bit. 1230 */ 1231 LogFlow(("InvalidatePage: Out-of-sync (A) at %RGp PdeSrc=%RX64 PdeDst=%RX64\n", 1232 GCPtrPage, (uint64_t)PdeSrc.u, (uint64_t)PdeDst.u)); 1233 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1234 ASMAtomicWriteSize(pPdeDst, 0); 1235 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_MID_Z(Stat,InvalidatePagePDNAs)); 1236 PGM_INVL_VCPU_TLBS(pVCpu); 1237 } 1238 else if (!fIsBigPage) 1121 if (!fIsBigPage) 1239 1122 { 1240 1123 /*
Note:
See TracChangeset
for help on using the changeset viewer.