Changeset 72560 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Jun 15, 2018 11:00:02 AM (6 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r72534 r72560 1040 1040 pVmcbCtrl->u64MSRPMPhysAddr = pVCpu->hm.s.svm.HCPhysMsrBitmap; 1041 1041 1042 /* Initialize the #VMEXIT history array with end-of-array markers (UINT16_MAX). */1043 Assert(!pVCpu->hm.s.idxExitHistoryFree);1044 HMCPU_EXIT_HISTORY_RESET(pVCpu);1045 1046 1042 /* Initially all VMCB clean bits MBZ indicating that everything should be loaded from the VMCB in memory. */ 1047 1043 Assert(pVmcbCtrl->u32VmcbCleanBits == 0); … … 1061 1057 memcpy(pbMsrBitmapCur, pbMsrBitmap, SVM_MSRPM_PAGES << X86_PAGE_4K_SHIFT); 1062 1058 pVmcbCtrlCur->u64MSRPMPhysAddr = pVCpuCur->hm.s.svm.HCPhysMsrBitmap; 1063 1064 /* Initialize the #VMEXIT history array with end-of-array markers (UINT16_MAX). */1065 Assert(!pVCpuCur->hm.s.idxExitHistoryFree);1066 HMCPU_EXIT_HISTORY_RESET(pVCpuCur);1067 1059 1068 1060 /* Initially all VMCB clean bits MBZ indicating that everything should be loaded from the VMCB in memory. */ … … 4584 4576 4585 4577 pSvmTransient->u64ExitCode = pVmcbCtrl->u64ExitCode; /* Save the #VMEXIT reason. */ 4586 HMCPU_EXIT_HISTORY_ADD(pVCpu, pVmcbCtrl->u64ExitCode); /* Update the #VMEXIT history array. */4587 4578 pVmcbCtrl->u32VmcbCleanBits = HMSVM_VMCB_CLEAN_ALL; /* Mark the VMCB-state cache as unmodified by VMM. */ 4588 4579 pSvmTransient->fVectoringDoublePF = false; /* Vectoring double page-fault needs to be determined later. */ … … 4611 4602 } 4612 4603 } 4604 4605 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_SVM, pSvmTransient->u64ExitCode & EMEXIT_F_TYPE_MASK), 4606 pMixedCtx->cs.u64Base + pMixedCtx->rip, uHostTsc); 4613 4607 } 4614 4608 -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r72533 r72560 2844 2844 Log4(("VMXR0SetupVM: pVCpu=%p idCpu=%RU32\n", pVCpu, pVCpu->idCpu)); 2845 2845 2846 /* Initialize the VM-exit history array with end-of-array markers (UINT16_MAX). */2847 Assert(!pVCpu->hm.s.idxExitHistoryFree);2848 HMCPU_EXIT_HISTORY_RESET(pVCpu);2849 2850 2846 /* Set revision dword at the beginning of the VMCS structure. */ 2851 2847 *(uint32_t *)pVCpu->hm.s.vmx.pvVmcs = MSR_IA32_VMX_BASIC_INFO_VMCS_ID(pVM->hm.s.vmx.Msrs.u64BasicInfo); … … 3653 3649 Log4(("Load[%RU32]: VMX_VMCS_GUEST_RIP=%#RX64 fContextUseFlags=%#RX32\n", pVCpu->idCpu, pMixedCtx->rip, 3654 3650 HMCPU_CF_VALUE(pVCpu))); 3651 3652 /* Update the exit history entry with the correct CS.BASE + RIP or just RIP. */ 3653 if (HMCPU_CF_IS_SET(pVCpu, HM_CHANGED_GUEST_SEGMENT_REGS)) 3654 EMR0HistoryUpdatePC(pVCpu, pMixedCtx->cs.u64Base + pMixedCtx->rip, true); 3655 else 3656 EMR0HistoryUpdatePC(pVCpu, pMixedCtx->rip, false); 3655 3657 } 3656 3658 return rc; … … 4594 4596 Log4(("Load[%RU32]: CS=%#RX16 Base=%#RX64 Limit=%#RX32 Attr=%#RX32\n", pVCpu->idCpu, pMixedCtx->cs.Sel, 4595 4597 pMixedCtx->cs.u64Base, pMixedCtx->cs.u32Limit, pMixedCtx->cs.Attr.u)); 4598 4599 /* Update the exit history entry with the correct CS.BASE + RIP. */ 4600 if (HMCPU_CF_IS_PENDING(pVCpu, HM_CHANGED_GUEST_RIP)) 4601 EMR0HistoryUpdatePC(pVCpu, pMixedCtx->cs.u64Base + pMixedCtx->rip, true); 4596 4602 } 4597 4603 … … 9208 9214 { 9209 9215 NOREF(pVM); 9216 uint64_t uHostTsc = ASMReadTSC(); 9210 9217 9211 9218 Assert(!VMMRZCallRing3IsEnabled(pVCpu)); … … 9219 9226 9220 9227 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT)) 9221 TMCpuTickSetLastSeen(pVCpu, ASMReadTSC()+ pVCpu->hm.s.vmx.u64TSCOffset);9228 TMCpuTickSetLastSeen(pVCpu, uHostTsc + pVCpu->hm.s.vmx.u64TSCOffset); 9222 9229 9223 9230 STAM_PROFILE_ADV_STOP_START(&pVCpu->hm.s.StatInGC, &pVCpu->hm.s.StatExit1, x); … … 9261 9268 * 9262 9269 * See Intel spec. 26.7 "VM-Entry failures during or after loading guest state". 9270 * 9271 * Note! We don't have CS or RIP at this point. Will probably address that later 9272 * by amending the history entry added here. 9263 9273 */ 9264 HMCPU_EXIT_HISTORY_ADD(pVCpu, pVmxTransient->uExitReason); 9274 EMHistoryAddExit(pVCpu, EMEXIT_MAKE_FLAGS_AND_TYPE(EMEXIT_F_KIND_SVM, pVmxTransient->uExitReason & EMEXIT_F_TYPE_MASK), 9275 UINT64_MAX, uHostTsc); 9265 9276 9266 9277 if (!pVmxTransient->fVMEntryFailed)
Note:
See TracChangeset
for help on using the changeset viewer.