Changeset 9064 in vbox for trunk/src/VBox
- Timestamp:
- May 23, 2008 9:20:55 AM (17 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r9032 r9064 1157 1157 } 1158 1158 1159 /** 1160 * Performs and schedules necessary updates following a CR3 load or reload, 1161 * without actually the TLB as with PGMFlushTLB. 1162 * 1163 * This will normally involve mapping the guest PD or nPDPT 1164 * 1165 * @returns VBox status code. 1166 * @retval VINF_PGM_SYNC_CR3 if monitoring requires a CR3 sync. This can 1167 * safely be ignored and overridden since the FF will be set too then. 1168 * @param pVM VM handle. 1169 * @param cr3 The new cr3. 1170 */ 1171 PGMDECL(int) PGMUpdateCR3(PVM pVM, uint64_t cr3) 1172 { 1173 LogFlow(("PGMUpdateCR3: cr3=%VX64 OldCr3=%VX64\n", cr3, pVM->pgm.s.GCPhysCR3)); 1174 1175 /* We assume we're only called in nested paging mode. */ 1176 Assert(pVM->pgm.s.fMappingsFixed); 1177 Assert(!(pVM->pgm.s.fSyncFlags & PGM_SYNC_MONITOR_CR3)); 1178 Assert(pVM->pgm.s.enmShadowMode == PGMMODE_NESTED); 1179 1180 /* 1181 * Remap the CR3 content and adjust the monitoring if CR3 was actually changed. 1182 */ 1183 int rc = VINF_SUCCESS; 1184 RTGCPHYS GCPhysCR3; 1185 if ( pVM->pgm.s.enmGuestMode == PGMMODE_PAE 1186 || pVM->pgm.s.enmGuestMode == PGMMODE_PAE_NX 1187 || pVM->pgm.s.enmGuestMode == PGMMODE_AMD64 1188 || pVM->pgm.s.enmGuestMode == PGMMODE_AMD64_NX) 1189 GCPhysCR3 = (RTGCPHYS)(cr3 & X86_CR3_PAE_PAGE_MASK); 1190 else 1191 GCPhysCR3 = (RTGCPHYS)(cr3 & X86_CR3_PAGE_MASK); 1192 if (pVM->pgm.s.GCPhysCR3 != GCPhysCR3) 1193 { 1194 pVM->pgm.s.GCPhysCR3 = GCPhysCR3; 1195 rc = PGM_GST_PFN(MapCR3, pVM)(pVM, GCPhysCR3); 1196 } 1197 AssertRC(rc); 1198 return rc; 1199 } 1159 1200 1160 1201 /** -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r9038 r9064 258 258 pVMCB->ctrl.u16InterceptRdCRx = RT_BIT(0) | RT_BIT(3) | RT_BIT(4); 259 259 else 260 pVMCB->ctrl.u16InterceptRdCRx = RT_BIT(0) ;260 pVMCB->ctrl.u16InterceptRdCRx = RT_BIT(0) | RT_BIT(4); 261 261 262 262 /* … … 266 266 pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT(3) | RT_BIT(4) | RT_BIT(8); 267 267 else 268 pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT( 8);268 pVMCB->ctrl.u16InterceptWrCRx = RT_BIT(0) | RT_BIT(4) | RT_BIT(8); 269 269 270 270 /* Intercept all DRx reads and writes. */ … … 1041 1041 { 1042 1042 CPUMSetGuestCR3(pVM, pVMCB->guest.u64CR3); 1043 CPUMSetGuestCR4(pVM, pVMCB->guest.u64CR4);1043 PGMUpdateCR3(pVM, pVMCB->guest.u64CR3); 1044 1044 } 1045 1045 … … 1423 1423 break; 1424 1424 case 4: 1425 Assert(!pVM->hwaccm.s.fNestedPaging);1426 1425 pVM->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_GUEST_CR4; 1427 1426 break;
Note:
See TracChangeset
for help on using the changeset viewer.