Changeset 45655 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Apr 20, 2013 2:27:02 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r45653 r45655 2555 2555 * @param uIntrState The interruptibility-state to set. 2556 2556 */ 2557 DECLINLINE(int)hmR0VmxLoadGuestIntrState(PVMCPU pVCpu, uint32_t uIntrState)2557 static int hmR0VmxLoadGuestIntrState(PVMCPU pVCpu, uint32_t uIntrState) 2558 2558 { 2559 2559 AssertMsg(!(uIntrState & 0xfffffff0), ("%#x\n", uIntrState)); /* Bits 31:4 MBZ. */ … … 2576 2576 * @remarks No-long-jump zone!!! 2577 2577 */ 2578 DECLINLINE(int)hmR0VmxLoadGuestRip(PVMCPU pVCpu, PCPUMCTX pMixedCtx)2578 static int hmR0VmxLoadGuestRip(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 2579 2579 { 2580 2580 int rc = VINF_SUCCESS; … … 2601 2601 * @remarks No-long-jump zone!!! 2602 2602 */ 2603 DECLINLINE(int)hmR0VmxLoadGuestRsp(PVMCPU pVCpu, PCPUMCTX pMixedCtx)2603 static int hmR0VmxLoadGuestRsp(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 2604 2604 { 2605 2605 int rc = VINF_SUCCESS; … … 2625 2625 * @remarks No-long-jump zone!!! 2626 2626 */ 2627 DECLINLINE(int)hmR0VmxLoadGuestRflags(PVMCPU pVCpu, PCPUMCTX pMixedCtx)2627 static int hmR0VmxLoadGuestRflags(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 2628 2628 { 2629 2629 int rc = VINF_SUCCESS; … … 2671 2671 * @remarks No-long-jump zone!!! 2672 2672 */ 2673 DECLINLINE(int)hmR0VmxLoadGuestRipRspRflags(PVMCPU pVCpu, PCPUMCTX pMixedCtx)2673 static int hmR0VmxLoadGuestRipRspRflags(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 2674 2674 { 2675 2675 int rc = hmR0VmxLoadGuestRip(pVCpu, pMixedCtx); … … 2693 2693 * @remarks No-long-jump zone!!! 2694 2694 */ 2695 DECLINLINE(int)hmR0VmxLoadGuestControlRegs(PVMCPU pVCpu, PCPUMCTX pCtx)2695 static int hmR0VmxLoadGuestControlRegs(PVMCPU pVCpu, PCPUMCTX pCtx) 2696 2696 { 2697 2697 int rc = VINF_SUCCESS; … … 3042 3042 * @remarks No-long-jump zone!!! 3043 3043 */ 3044 DECLINLINE(int)hmR0VmxLoadGuestDebugRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx)3044 static int hmR0VmxLoadGuestDebugRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 3045 3045 { 3046 3046 if (!(pVCpu->hm.s.fContextUseFlags & HM_CHANGED_GUEST_DEBUG)) … … 3308 3308 * @remarks No-long-jump zone!!! 3309 3309 */ 3310 DECLINLINE(int)hmR0VmxWriteSegmentReg(PVMCPU pVCpu, uint32_t idxSel, uint32_t idxLimit, uint32_t idxBase,3310 static int hmR0VmxWriteSegmentReg(PVMCPU pVCpu, uint32_t idxSel, uint32_t idxLimit, uint32_t idxBase, 3311 3311 uint32_t idxAccess, PCPUMSELREG pSelReg, PCPUMCTX pCtx) 3312 3312 { … … 3360 3360 * @remarks No-long-jump zone!!! 3361 3361 */ 3362 DECLINLINE(int)hmR0VmxLoadGuestSegmentRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx)3362 static int hmR0VmxLoadGuestSegmentRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 3363 3363 { 3364 3364 int rc = VERR_INTERNAL_ERROR_5; … … 3571 3571 * @remarks No-long-jump zone!!! 3572 3572 */ 3573 DECLINLINE(int)hmR0VmxLoadGuestMsrs(PVMCPU pVCpu, PCPUMCTX pMixedCtx)3573 static int hmR0VmxLoadGuestMsrs(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 3574 3574 { 3575 3575 AssertPtr(pVCpu); … … 3692 3692 * @remarks No-long-jump zone!!! 3693 3693 */ 3694 DECLINLINE(int)hmR0VmxLoadGuestActivityState(PVMCPU pVCpu, PCPUMCTX pCtx)3694 static int hmR0VmxLoadGuestActivityState(PVMCPU pVCpu, PCPUMCTX pCtx) 3695 3695 { 3696 3696 /** @todo See if we can make use of other states, e.g. … … 3718 3718 * @remarks No-long-jump zone!!! 3719 3719 */ 3720 DECLINLINE(int)hmR0VmxSetupVMRunHandler(PVMCPU pVCpu, PCPUMCTX pMixedCtx)3720 static int hmR0VmxSetupVMRunHandler(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 3721 3721 { 3722 3722 if (CPUMIsGuestInLongModeEx(pMixedCtx)) … … 4785 4785 * @remarks No-long-jump zone!!! 4786 4786 */ 4787 DECLINLINE(int)hmR0VmxSaveGuestCR0(PVMCPU pVCpu, PCPUMCTX pMixedCtx)4787 static int hmR0VmxSaveGuestCR0(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4788 4788 { 4789 4789 int rc = VINF_SUCCESS; … … 4814 4814 * @remarks No-long-jump zone!!! 4815 4815 */ 4816 DECLINLINE(int)hmR0VmxSaveGuestCR4(PVMCPU pVCpu, PCPUMCTX pMixedCtx)4816 static int hmR0VmxSaveGuestCR4(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4817 4817 { 4818 4818 int rc = VINF_SUCCESS; … … 4843 4843 * @remarks No-long-jump zone!!! 4844 4844 */ 4845 DECLINLINE(int) hmR0VmxSaveGuestRip(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4846 { 4847 if (pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RIP) 4848 return VINF_SUCCESS; 4849 4850 RTGCUINTREG uVal = 0; 4851 int rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RIP, &uVal); 4852 AssertRCReturn(rc, rc); 4853 pMixedCtx->rip = uVal; 4854 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_RIP; 4845 static int hmR0VmxSaveGuestRip(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4846 { 4847 int rc = VINF_SUCCESS; 4848 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RIP)) 4849 { 4850 RTGCUINTREG uVal = 0; 4851 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RIP, &uVal); 4852 AssertRCReturn(rc, rc); 4853 pMixedCtx->rip = uVal; 4854 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_RIP; 4855 } 4855 4856 return rc; 4856 4857 } … … 4868 4869 * @remarks No-long-jump zone!!! 4869 4870 */ 4870 DECLINLINE(int) hmR0VmxSaveGuestRsp(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4871 { 4872 if (pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RSP) 4873 return VINF_SUCCESS; 4874 4875 RTGCUINTREG uVal = 0; 4876 int rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RSP, &uVal); 4877 AssertRCReturn(rc, rc); 4878 pMixedCtx->rsp = uVal; 4879 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_RSP; 4871 static int hmR0VmxSaveGuestRsp(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4872 { 4873 int rc = VINF_SUCCESS; 4874 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RSP)) 4875 { 4876 RTGCUINTREG uVal = 0; 4877 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RSP, &uVal); 4878 AssertRCReturn(rc, rc); 4879 pMixedCtx->rsp = uVal; 4880 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_RSP; 4881 } 4880 4882 return rc; 4881 4883 } … … 4893 4895 * @remarks No-long-jump zone!!! 4894 4896 */ 4895 DECLINLINE(int) hmR0VmxSaveGuestRflags(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4896 { 4897 if (pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RFLAGS) 4898 return VINF_SUCCESS; 4899 4900 RTGCUINTREG uVal = 0; 4901 int rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RFLAGS, &uVal); 4902 AssertRCReturn(rc, rc); 4903 pMixedCtx->rflags.u64 = uVal; 4904 4905 /* Undo our real-on-v86-mode changes to eflags if necessary. */ 4906 if (pVCpu->hm.s.vmx.RealMode.fRealOnV86Active) 4907 { 4908 PVM pVM = pVCpu->CTX_SUFF(pVM); 4909 Assert(pVM->hm.s.vmx.pRealModeTSS); 4910 Log(("Saving real-mode RFLAGS VT-x view=%#RX64\n", pMixedCtx->rflags.u64)); 4911 pMixedCtx->eflags.Bits.u1VM = 0; 4912 pMixedCtx->eflags.Bits.u2IOPL = pVCpu->hm.s.vmx.RealMode.eflags.Bits.u2IOPL; 4913 } 4914 4915 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_RFLAGS; 4897 static int hmR0VmxSaveGuestRflags(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4898 { 4899 int rc = VINF_SUCCESS; 4900 if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RFLAGS)) 4901 { 4902 RTGCUINTREG uVal = 0; 4903 rc = VMXReadVmcsGstN(VMX_VMCS_GUEST_RFLAGS, &uVal); 4904 AssertRCReturn(rc, rc); 4905 pMixedCtx->rflags.u64 = uVal; 4906 4907 /* Undo our real-on-v86-mode changes to eflags if necessary. */ 4908 if (pVCpu->hm.s.vmx.RealMode.fRealOnV86Active) 4909 { 4910 PVM pVM = pVCpu->CTX_SUFF(pVM); 4911 Assert(pVM->hm.s.vmx.pRealModeTSS); 4912 Log(("Saving real-mode RFLAGS VT-x view=%#RX64\n", pMixedCtx->rflags.u64)); 4913 pMixedCtx->eflags.Bits.u1VM = 0; 4914 pMixedCtx->eflags.Bits.u2IOPL = pVCpu->hm.s.vmx.RealMode.eflags.Bits.u2IOPL; 4915 } 4916 4917 pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_RFLAGS; 4918 } 4916 4919 return rc; 4917 4920 } … … 4922 4925 * guest-CPU context. 4923 4926 */ 4924 static inthmR0VmxSaveGuestRipRspRflags(PVMCPU pVCpu, PCPUMCTX pMixedCtx)4927 DECLINLINE(int) hmR0VmxSaveGuestRipRspRflags(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4925 4928 { 4926 4929 int rc = hmR0VmxSaveGuestRip(pVCpu, pMixedCtx); … … 4942 4945 * @remarks No-long-jump zone!!! 4943 4946 */ 4944 DECLINLINE(void)hmR0VmxSaveGuestIntrState(PVMCPU pVCpu, PCPUMCTX pMixedCtx)4947 static void hmR0VmxSaveGuestIntrState(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4945 4948 { 4946 4949 uint32_t uIntrState = 0; … … 4974 4977 * @remarks No-long-jump zone!!! 4975 4978 */ 4976 DECLINLINE(int)hmR0VmxSaveGuestActivityState(PVMCPU pVCpu, PCPUMCTX pMixedCtx)4979 static int hmR0VmxSaveGuestActivityState(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4977 4980 { 4978 4981 /* Nothing to do for now until we make use of different guest-CPU activity state. Just update the flag. */ … … 4994 4997 * @remarks No-long-jump zone!!! 4995 4998 */ 4996 DECLINLINE(int)hmR0VmxSaveGuestSysenterMsrs(PVMCPU pVCpu, PCPUMCTX pMixedCtx)4999 static int hmR0VmxSaveGuestSysenterMsrs(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 4997 5000 { 4998 5001 int rc = VINF_SUCCESS; … … 5034 5037 * @remarks No-long-jump zone!!! 5035 5038 */ 5036 DECLINLINE(int)hmR0VmxSaveGuestFSBaseMsr(PVMCPU pVCpu, PCPUMCTX pMixedCtx)5039 static int hmR0VmxSaveGuestFSBaseMsr(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 5037 5040 { 5038 5041 RTGCUINTREG uVal = 0; … … 5060 5063 * @remarks No-long-jump zone!!! 5061 5064 */ 5062 DECLINLINE(int)hmR0VmxSaveGuestGSBaseMsr(PVMCPU pVCpu, PCPUMCTX pMixedCtx)5065 static int hmR0VmxSaveGuestGSBaseMsr(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 5063 5066 { 5064 5067 RTGCUINTREG uVal = 0; … … 5130 5133 * @remarks No-long-jump zone!!! 5131 5134 */ 5132 DECLINLINE(int)hmR0VmxSaveGuestControlRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx)5135 static int hmR0VmxSaveGuestControlRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 5133 5136 { 5134 5137 RTGCUINTREG uVal = 0; … … 5337 5340 * @remarks No-long-jump zone!!! 5338 5341 */ 5339 DECLINLINE(int)hmR0VmxSaveGuestDebugRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx)5342 static int hmR0VmxSaveGuestDebugRegs(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 5340 5343 { 5341 5344 int rc = VINF_SUCCESS; … … 5363 5366 * @remarks No-long-jump zone!!! 5364 5367 */ 5365 DECLINLINE(int)hmR0VmxSaveGuestApicState(PVMCPU pVCpu, PCPUMCTX pMixedCtx)5368 static int hmR0VmxSaveGuestApicState(PVMCPU pVCpu, PCPUMCTX pMixedCtx) 5366 5369 { 5367 5370 /* Updating TPR is already done in hmR0VmxPostRunGuest(). Just update the flag. */ … … 5716 5719 } 5717 5720 5721 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit2, x); 5722 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitIO, y1); 5723 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitMovCRx, y2); 5724 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 5718 5725 STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchLongJmpToR3); 5719 5726 } -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r45653 r45655 5053 5053 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit1, x); 5054 5054 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatEntry, x); 5055 STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchExitToR3); 5055 5056 Log2(("X")); 5056 5057 return VBOXSTRICTRC_TODO(rc); … … 5134 5135 AssertRC(rc); 5135 5136 5137 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit2, x); 5138 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitIO, y1); 5139 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitMovCRx, y2); 5140 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); 5136 5141 return VINF_SUCCESS; 5137 5142 }
Note:
See TracChangeset
for help on using the changeset viewer.