1237
* Prefetch the 4 PDPT pointers (PAE and nested paging only)
1239
* @returns VINF_SUCCESS or fatal error.
1240
* @param pVM The VM to operate on.
1241
* @param pVCpu The VMCPU to operate on.
1242
* @param pCtx Guest context
1244
static int vmxR0PrefetchPAEPdptrs(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
1246
if (CPUMIsGuestInPAEModeEx(pCtx))
1248
for (unsigned i=0;i<4;i++)
1251
int rc = PGMGstQueryPaePDPtr(pVCpu, i, &Pdpe);
1252
AssertRCReturn(rc, rc);
1254
rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR0_FULL + i*2, Pdpe.u);
1258
return VINF_SUCCESS;
1237
* Loads the 4 PDPEs into the guest state when nested paging is used and the
1238
* guest operates in PAE mode.
1240
* @returns VINF_SUCCESS or fatal error.
1241
* @param pVCpu The VMCPU to operate on.
1242
* @param pCtx Guest context
1244
static int hmR0VmxLoadPaePdpes(PVMCPU pVCpu, PCPUMCTX pCtx)
1246
if (CPUMIsGuestInPAEModeEx(pCtx))
1249
int rc = PGMGstGetPaePdpes(pVCpu, &aPdpes[0]);
1250
AssertRCReturn(rc, rc);
1252
rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR0_FULL, aPdpes[0].u); AssertRCReturn(rc, rc);
1253
rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR1_FULL, aPdpes[1].u); AssertRCReturn(rc, rc);
1254
rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR2_FULL, aPdpes[2].u); AssertRCReturn(rc, rc);
1255
rc = VMXWriteVMCS64(VMX_VMCS_GUEST_PDPTR3_FULL, aPdpes[3].u); AssertRCReturn(rc, rc);
1257
return VINF_SUCCESS;
1261
* Saves the 4 PDPEs into the guest state when nested paging is used and the
1262
* guest operates in PAE mode.
1264
* @returns VINF_SUCCESS or fatal error.
1265
* @param pVCpu The VMCPU to operate on.
1266
* @param pCtx Guest context
1268
* @remarks Tell PGM about CR3 changes before calling this helper.
1270
static int hmR0VmxSavePaePdpes(PVMCPU pVCpu, PCPUMCTX pCtx)
1272
if (CPUMIsGuestInPAEModeEx(pCtx))
1276
rc = VMXReadVMCS64(VMX_VMCS_GUEST_PDPTR0_FULL, &aPdpes[0].u); AssertRCReturn(rc, rc);
1277
rc = VMXReadVMCS64(VMX_VMCS_GUEST_PDPTR1_FULL, &aPdpes[1].u); AssertRCReturn(rc, rc);
1278
rc = VMXReadVMCS64(VMX_VMCS_GUEST_PDPTR2_FULL, &aPdpes[2].u); AssertRCReturn(rc, rc);
1279
rc = VMXReadVMCS64(VMX_VMCS_GUEST_PDPTR3_FULL, &aPdpes[3].u); AssertRCReturn(rc, rc);
1281
rc = PGMGstUpdatePaePdpes(pVCpu, &aPdpes[0]);
1282
AssertRCReturn(rc, rc);
1284
return VINF_SUCCESS;
1262
1289
* Update the exception bitmap according to the current CPU state
2026
2052
CPUMSetGuestCR3(pVCpu, val);
2027
2053
PGMUpdateCR3(pVCpu, val);
2029
/* Prefetch the four PDPT entries in PAE mode. */
2030
rc = vmxR0PrefetchPAEPdptrs(pVM, pVCpu, pCtx);
2055
rc = hmR0VmxSavePaePdpes(pVCpu, pCtx);
2031
2056
AssertRCReturn(rc, rc);
2159
2184
/* Force a TLB flush on VM entry. */
2160
2185
pVCpu->hwaccm.s.fForceTLBFlush = true;
2163
Assert(!pCpu->fFlushTLB);
2187
/* Disabled because this has triggered every time I have suspended my
2188
* laptop with a VM running for the past three months or more. */
2190
// Assert(!pCpu->fFlushTLB);
2165
2192
/* Check for tlb shootdown flushes. */
2166
2193
if (VMCPU_FF_TESTANDCLEAR(pVCpu, VMCPU_FF_TLB_FLUSH))
3856
3883
Log2(("IOMInterpretOUTSEx %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, uPort, cbSize));
3857
3884
STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringWrite);
3858
rc = IOMInterpretOUTSEx(pVM, CPUMCTX2CORE(pCtx), uPort, pDis->prefix, cbSize);
3885
rc = IOMInterpretOUTSEx(pVM, CPUMCTX2CORE(pCtx), uPort, pDis->prefix, pDis->addrmode, cbSize);
3862
3889
Log2(("IOMInterpretINSEx %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, uPort, cbSize));
3863
3890
STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringRead);
3864
rc = IOMInterpretINSEx(pVM, CPUMCTX2CORE(pCtx), uPort, pDis->prefix, cbSize);
3891
rc = IOMInterpretINSEx(pVM, CPUMCTX2CORE(pCtx), uPort, pDis->prefix, pDis->addrmode, cbSize);