Changeset 38707 in vbox for trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
- Timestamp:
- Sep 9, 2011 2:10:18 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r38684 r38707 1236 1236 1237 1237 /** 1238 * Prefetch the 4 PDPT pointers (PAE and nested paging only) 1238 * Loads the 4 PDPEs into the guest state when nested paging is used and the 1239 * guest operates in PAE mode. 1239 1240 * 1240 1241 * @returns VINF_SUCCESS or fatal error. 1241 * @param pVM The VM to operate on.1242 1242 * @param pVCpu The VMCPU to operate on. 1243 1243 * @param pCtx Guest context 1244 1244 */ 1245 static int hmR0Vmx PrefetchPAEPdptrs(PVM pVM,PVMCPU pVCpu, PCPUMCTX pCtx)1245 static int hmR0VmxLoadPaePdpes(PVMCPU pVCpu, PCPUMCTX pCtx) 1246 1246 { 1247 1247 if (CPUMIsGuestInPAEModeEx(pCtx)) 1248 1248 { 1249 for (unsigned i=0;i<4;i++) 1250 { 1251 X86PDPE Pdpe; 1252 int rc = PGMGstQueryPaePDPtr(pVCpu, i, &Pdpe); 1253 AssertRCReturn(rc, rc); 1254 1255 rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR0_FULL + i*2, Pdpe.u); 1256 AssertRC(rc); 1257 } 1249 X86PDPE aPdpes[4]; 1250 int rc = PGMGstGetPaePdpes(pVCpu, &aPdpes[0]); 1251 AssertRCReturn(rc, rc); 1252 1253 rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR0_FULL, aPdpes[0].u); AssertRCReturn(rc, rc); 1254 rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR1_FULL, aPdpes[1].u); AssertRCReturn(rc, rc); 1255 rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR2_FULL, aPdpes[2].u); AssertRCReturn(rc, rc); 1256 rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR3_FULL, aPdpes[3].u); AssertRCReturn(rc, rc); 1258 1257 } 1259 1258 return VINF_SUCCESS; 1260 1259 } 1260 1261 /** 1262 * Saves the 4 PDPEs into the guest state when nested paging is used and the 1263 * guest operates in PAE mode. 1264 * 1265 * @returns VINF_SUCCESS or fatal error. 1266 * @param pVCpu The VMCPU to operate on. 1267 * @param pCtx Guest context 1268 * 1269 * @remarks Tell PGM about CR3 changes before calling this helper. 1270 */ 1271 static int hmR0VmxSavePaePdpes(PVMCPU pVCpu, PCPUMCTX pCtx) 1272 { 1273 if (CPUMIsGuestInPAEModeEx(pCtx)) 1274 { 1275 int rc; 1276 X86PDPE aPdpes[4]; 1277 rc = VMXReadVMCS64(VMX_VMCS_GUEST_PDPTR0_FULL, &aPdpes[0].u); AssertRCReturn(rc, rc); 1278 rc = VMXReadVMCS64(VMX_VMCS_GUEST_PDPTR1_FULL, &aPdpes[1].u); AssertRCReturn(rc, rc); 1279 rc = VMXReadVMCS64(VMX_VMCS_GUEST_PDPTR2_FULL, &aPdpes[2].u); AssertRCReturn(rc, rc); 1280 rc = VMXReadVMCS64(VMX_VMCS_GUEST_PDPTR3_FULL, &aPdpes[3].u); AssertRCReturn(rc, rc); 1281 1282 rc = PGMGstUpdatePaePdpes(pVCpu, &aPdpes[0]); 1283 AssertRCReturn(rc, rc); 1284 } 1285 return VINF_SUCCESS; 1286 } 1287 1261 1288 1262 1289 /** … … 1753 1780 /* Save the real guest CR3 in VMX_VMCS_GUEST_CR3 */ 1754 1781 val = pCtx->cr3; 1755 /* Prefetch the four PDPT entries in PAE mode. */ 1756 rc = hmR0VmxPrefetchPAEPdptrs(pVM, pVCpu, pCtx); 1782 rc = hmR0VmxLoadPaePdpes(pVCpu, pCtx); 1757 1783 AssertRCReturn(rc, rc); 1758 1784 } … … 2028 2054 PGMUpdateCR3(pVCpu, val); 2029 2055 } 2030 /* Prefetch the four PDPT entries in PAE mode. */ 2031 rc = hmR0VmxPrefetchPAEPdptrs(pVM, pVCpu, pCtx); 2056 rc = hmR0VmxSavePaePdpes(pVCpu, pCtx); 2032 2057 AssertRCReturn(rc, rc); 2033 2058 }
Note:
See TracChangeset
for help on using the changeset viewer.