Changeset 48565 in vbox
- Timestamp:
- Sep 19, 2013 10:16:00 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 89117
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/hm.h
r48562 r48565 71 71 #define VMCPU_HMCF_IS_PENDING(pVCpu, fFlags) RT_BOOL((pVCpu)->hm.s.fContextUseFlags & (fFlags)) 72 72 73 /** @def VMCPU_HMCF_RESET_TO 74 * Resets the HM-context flags to the specified value. 75 * 76 * @param pVCpu Pointer to the VMCPU. 77 * @param fFlags The reset value. 78 */ 79 #define VMCPU_HMCF_RESET_TO(pVCpu, fFlags) ((pVCpu)->hm.s.fContextUseFlags = (fFlags)) 80 73 81 /** 74 82 * Checks whether HM (VT-x/AMD-V) is being used by this VM. … … 82 90 */ 83 91 #if defined(VBOX_STRICT) && defined(IN_RING3) 84 # define HMIsEnabled(a_pVM) HMIsEnabledNotMacro(a_pVM)92 # define HMIsEnabled(a_pVM) HMIsEnabledNotMacro(a_pVM) 85 93 #else 86 # define HMIsEnabled(a_pVM) ((a_pVM)->fHMEnabled)94 # define HMIsEnabled(a_pVM) ((a_pVM)->fHMEnabled) 87 95 #endif 88 96 … … 98 106 */ 99 107 #if HC_ARCH_BITS == 64 100 # define HMIsRawModeCtxNeeded(a_pVM) (!HMIsEnabled(a_pVM))108 # define HMIsRawModeCtxNeeded(a_pVM) (!HMIsEnabled(a_pVM)) 101 109 #else 102 # define HMIsRawModeCtxNeeded(a_pVM) (!HMIsEnabled(a_pVM) || (a_pVM)->fHMNeedRawModeCtx)110 # define HMIsRawModeCtxNeeded(a_pVM) (!HMIsEnabled(a_pVM) || (a_pVM)->fHMNeedRawModeCtx) 103 111 #endif 104 112 … … 110 118 * @internal 111 119 */ 112 #define HMCanEmulateIoBlock(a_pVCpu) (!CPUMIsGuestInPagedProtectedMode(a_pVCpu))120 #define HMCanEmulateIoBlock(a_pVCpu) (!CPUMIsGuestInPagedProtectedMode(a_pVCpu)) 113 121 114 122 /** … … 119 127 * @internal 120 128 */ 121 #define HMCanEmulateIoBlockEx(a_pCtx) (!CPUMIsGuestInPagedProtectedModeEx(a_pCtx))129 #define HMCanEmulateIoBlockEx(a_pCtx) (!CPUMIsGuestInPagedProtectedModeEx(a_pCtx)) 122 130 123 131 /** … … 128 136 */ 129 137 #ifdef IN_RING0 130 # define HMIsInHwVirtCtx(a_pVCpu) (VMCPU_GET_STATE(a_pVCpu) == VMCPUSTATE_STARTED_HM)138 # define HMIsInHwVirtCtx(a_pVCpu) (VMCPU_GET_STATE(a_pVCpu) == VMCPUSTATE_STARTED_HM) 131 139 #else 132 # define HMIsInHwVirtCtx(a_pVCpu) (false)140 # define HMIsInHwVirtCtx(a_pVCpu) (false) 133 141 #endif 134 142 -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r48555 r48565 44 44 #ifdef VBOX_WITH_STATISTICS 45 45 # define HMSVM_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { \ 46 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitAll); \ 46 47 if ((u64ExitCode) == SVM_EXIT_NPF) \ 47 48 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitReasonNpf); \ -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r48552 r48565 7800 7800 /* Handle the VM-exit. */ 7801 7801 AssertMsg(VmxTransient.uExitReason <= VMX_EXIT_MAX, ("%#x\n", VmxTransient.uExitReason)); 7802 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitAll); 7802 7803 STAM_COUNTER_INC(&pVCpu->hm.s.paStatExitReasonR0[VmxTransient.uExitReason & MASK_EXITREASON_STAT]); 7803 7804 STAM_PROFILE_ADV_STOP_START(&pVCpu->hm.s.StatExit1, &pVCpu->hm.s.StatExit2, x); … … 7874 7875 /* Handle the VM-exit. */ 7875 7876 AssertMsg(VmxTransient.uExitReason <= VMX_EXIT_MAX, ("%#x\n", VmxTransient.uExitReason)); 7877 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitAll); 7876 7878 STAM_COUNTER_INC(&pVCpu->hm.s.paStatExitReasonR0[VmxTransient.uExitReason & MASK_EXITREASON_STAT]); 7877 7879 STAM_PROFILE_ADV_STOP_START(&pVCpu->hm.s.StatExit1, &pVCpu->hm.s.StatExit2, x); -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r48556 r48565 647 647 648 648 #ifdef VBOX_WITH_STATISTICS 649 HM_REG_COUNTER(&pVCpu->hm.s.StatExitAll, "/HM/CPU%d/Exit/All", "Exits (total)."); 649 650 HM_REG_COUNTER(&pVCpu->hm.s.StatExitShadowNM, "/HM/CPU%d/Exit/Trap/Shw/#NM", "Shadow #NM (device not available, no math co-processor) exception."); 650 651 HM_REG_COUNTER(&pVCpu->hm.s.StatExitGuestNM, "/HM/CPU%d/Exit/Trap/Gst/#NM", "Guest #NM (device not available, no math co-processor) exception."); … … 1628 1629 VMMR3_INT_DECL(void) HMR3ResetCpu(PVMCPU pVCpu) 1629 1630 { 1630 /* Sync. entire state on VM reset R0-reentry. It's safe to update1631 /* Sync. entire state on VM reset R0-reentry. It's safe to reset 1631 1632 the HM flags here, all other EMTs are in ring-3. See VMR3Reset(). */ 1632 pVCpu->hm.s.fContextUseFlags = (HM_CHANGED_HOST_CONTEXT | HM_CHANGED_ALL_GUEST);1633 VMCPU_HMCF_RESET_TO(pVCpu, HM_CHANGED_HOST_CONTEXT | HM_CHANGED_ALL_GUEST); 1633 1634 1634 1635 pVCpu->hm.s.vmx.u32CR0Mask = 0; … … 2648 2649 VMMR3_INT_DECL(void) HMR3NotifyScheduled(PVMCPU pVCpu) 2649 2650 { 2650 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_ALL_GUEST;2651 VMCPU_HMCF_SET(pVCpu, HM_CHANGED_ALL_GUEST); 2651 2652 } 2652 2653 … … 2659 2660 VMMR3_INT_DECL(void) HMR3NotifyEmulated(PVMCPU pVCpu) 2660 2661 { 2661 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_ALL_GUEST;2662 VMCPU_HMCF_SET(pVCpu, HM_CHANGED_ALL_GUEST); 2662 2663 } 2663 2664 -
trunk/src/VBox/VMM/include/HMInternal.h
r48284 r48565 771 771 STAMCOUNTER StatInjectPendingReflect; 772 772 773 STAMCOUNTER StatExitAll; 773 774 STAMCOUNTER StatExitShadowNM; 774 775 STAMCOUNTER StatExitGuestNM;
Note:
See TracChangeset
for help on using the changeset viewer.