Changeset 43509 in vbox
- Timestamp:
- Oct 2, 2012 2:15:17 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r43496 r43509 1004 1004 pvVMCB->ctrl.u32InterceptCtrl1 &= ~SVM_CTRL1_INTERCEPT_RDTSC; 1005 1005 pvVMCB->ctrl.u32InterceptCtrl2 &= ~SVM_CTRL2_INTERCEPT_RDTSCP; 1006 STAM_COUNTER_INC(&pVCpu->hm.s.StatT SCOffset);1006 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscOffset); 1007 1007 } 1008 1008 else … … 1014 1014 pvVMCB->ctrl.u32InterceptCtrl1 |= SVM_CTRL1_INTERCEPT_RDTSC; 1015 1015 pvVMCB->ctrl.u32InterceptCtrl2 |= SVM_CTRL2_INTERCEPT_RDTSCP; 1016 STAM_COUNTER_INC(&pVCpu->hm.s.StatT SCInterceptOverFlow);1016 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscInterceptOverFlow); 1017 1017 } 1018 1018 } … … 1021 1021 pvVMCB->ctrl.u32InterceptCtrl1 |= SVM_CTRL1_INTERCEPT_RDTSC; 1022 1022 pvVMCB->ctrl.u32InterceptCtrl2 |= SVM_CTRL2_INTERCEPT_RDTSCP; 1023 STAM_COUNTER_INC(&pVCpu->hm.s.StatT SCIntercept);1023 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscIntercept); 1024 1024 } 1025 1025 … … 1179 1179 #ifdef VBOX_WITH_STATISTICS 1180 1180 if (pvVMCB->ctrl.TLBCtrl.n.u8TLBFlush == SVM_TLB_FLUSH_NOTHING) 1181 STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushT LBWorldSwitch);1181 STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushTlbWorldSwitch); 1182 1182 else if ( pvVMCB->ctrl.TLBCtrl.n.u8TLBFlush == SVM_TLB_FLUSH_SINGLE_CONTEXT 1183 1183 || pvVMCB->ctrl.TLBCtrl.n.u8TLBFlush == SVM_TLB_FLUSH_SINGLE_CONTEXT_RETAIN_GLOBALS) … … 1186 1186 } 1187 1187 else 1188 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushT LBWorldSwitch);1188 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbWorldSwitch); 1189 1189 #endif 1190 1190 } … … 1797 1797 #ifdef VBOX_WITH_STATISTICS 1798 1798 if (exitCode == SVM_EXIT_NPF) 1799 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitReasonN PF);1799 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitReasonNpf); 1800 1800 else 1801 1801 STAM_COUNTER_INC(&pVCpu->hm.s.paStatExitReasonR0[exitCode & MASK_EXITREASON_STAT]); … … 2523 2523 static uint32_t const aIOSize[4] = { 1, 2, 0, 4 }; 2524 2524 2525 STAM_COUNTER_INC(&pVCpu->hm.s.StatDRxI OCheck);2525 STAM_COUNTER_INC(&pVCpu->hm.s.StatDRxIoCheck); 2526 2526 for (unsigned i = 0; i < 4; i++) 2527 2527 { -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r43498 r43509 2246 2246 rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.proc_ctls); 2247 2247 AssertRC(rc); 2248 STAM_COUNTER_INC(&pVCpu->hm.s.StatT SCOffset);2248 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscOffset); 2249 2249 } 2250 2250 else … … 2258 2258 rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.proc_ctls); 2259 2259 AssertRC(rc); 2260 STAM_COUNTER_INC(&pVCpu->hm.s.StatT SCInterceptOverFlow);2260 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscInterceptOverFlow); 2261 2261 } 2262 2262 } … … 2266 2266 rc = VMXWriteVMCS(VMX_VMCS_CTRL_PROC_EXEC_CONTROLS, pVCpu->hm.s.vmx.proc_ctls); 2267 2267 AssertRC(rc); 2268 STAM_COUNTER_INC(&pVCpu->hm.s.StatT SCIntercept);2268 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscIntercept); 2269 2269 } 2270 2270 … … 2553 2553 } 2554 2554 else 2555 { 2556 #ifdef VBOX_WITH_STATISTICS 2557 STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushTLBWorldSwitch); 2558 #endif 2559 } 2560 } 2555 STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushTlbWorldSwitch); 2556 } 2557 2561 2558 pVCpu->hm.s.TlbShootdown.cPages = 0; 2562 2559 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN); … … 2631 2628 2632 2629 #ifdef VBOX_WITH_STATISTICS 2630 /** @todo r=ramshankar: this is not accurate anymore with the VPID+EPT 2631 * handling. Should be fixed later. */ 2633 2632 if (pVCpu->hm.s.fForceTLBFlush) 2634 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushT LBWorldSwitch);2633 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbWorldSwitch); 2635 2634 else 2636 STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushT LBWorldSwitch);2635 STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushTlbWorldSwitch); 2637 2636 #endif 2638 2637 } … … 2731 2730 2732 2731 # ifdef VBOX_WITH_STATISTICS 2732 /** @todo r=ramshankar: this is not accurate anymore with EPT+VPID handling. 2733 * Should be fixed later. */ 2733 2734 if (pVCpu->hm.s.fForceTLBFlush) 2734 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushT LBWorldSwitch);2735 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbWorldSwitch); 2735 2736 else 2736 STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushT LBWorldSwitch);2737 STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushTlbWorldSwitch); 2737 2738 # endif 2738 2739 } … … 4034 4035 /* We've successfully synced our shadow pages, so let's just continue execution. */ 4035 4036 Log2(("Shadow page fault at %RGv cr2=%RGp error code %x\n", (RTGCPTR)pCtx->rip, exitQualification , errCode)); 4036 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitReasonN PF);4037 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitReasonNpf); 4037 4038 4038 4039 TRPMResetTrap(pVCpu); … … 4512 4513 if (pCtx->dr[7] & X86_DR7_ENABLED_MASK) 4513 4514 { 4514 STAM_COUNTER_INC(&pVCpu->hm.s.StatDRxI OCheck);4515 STAM_COUNTER_INC(&pVCpu->hm.s.StatDRxIoCheck); 4515 4516 for (unsigned i = 0; i < 4; i++) 4516 4517 { -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r43496 r43509 120 120 static const char * const g_apszAmdVExitReasons[MAX_EXITREASON_STAT] = 121 121 { 122 EXIT_REASON(SVM_EXIT_READ_CR0 123 EXIT_REASON(SVM_EXIT_READ_CR1 124 EXIT_REASON(SVM_EXIT_READ_CR2 125 EXIT_REASON(SVM_EXIT_READ_CR3 126 EXIT_REASON(SVM_EXIT_READ_CR4 127 EXIT_REASON(SVM_EXIT_READ_CR5 128 EXIT_REASON(SVM_EXIT_READ_CR6 129 EXIT_REASON(SVM_EXIT_READ_CR7 130 EXIT_REASON(SVM_EXIT_READ_CR8 131 EXIT_REASON(SVM_EXIT_READ_CR9 132 EXIT_REASON(SVM_EXIT_READ_CR10 133 EXIT_REASON(SVM_EXIT_READ_CR11 134 EXIT_REASON(SVM_EXIT_READ_CR12 135 EXIT_REASON(SVM_EXIT_READ_CR13 136 EXIT_REASON(SVM_EXIT_READ_CR14 137 EXIT_REASON(SVM_EXIT_READ_CR15 138 EXIT_REASON(SVM_EXIT_WRITE_CR0 139 EXIT_REASON(SVM_EXIT_WRITE_CR1 140 EXIT_REASON(SVM_EXIT_WRITE_CR2 141 EXIT_REASON(SVM_EXIT_WRITE_CR3 142 EXIT_REASON(SVM_EXIT_WRITE_CR4 143 EXIT_REASON(SVM_EXIT_WRITE_CR5 144 EXIT_REASON(SVM_EXIT_WRITE_CR6 145 EXIT_REASON(SVM_EXIT_WRITE_CR7 146 EXIT_REASON(SVM_EXIT_WRITE_CR8 147 EXIT_REASON(SVM_EXIT_WRITE_CR9 148 EXIT_REASON(SVM_EXIT_WRITE_CR10 149 EXIT_REASON(SVM_EXIT_WRITE_CR11 150 EXIT_REASON(SVM_EXIT_WRITE_CR12 151 EXIT_REASON(SVM_EXIT_WRITE_CR13 152 EXIT_REASON(SVM_EXIT_WRITE_CR14 153 EXIT_REASON(SVM_EXIT_WRITE_CR15 154 EXIT_REASON(SVM_EXIT_READ_DR0 155 EXIT_REASON(SVM_EXIT_READ_DR1 156 EXIT_REASON(SVM_EXIT_READ_DR2 157 EXIT_REASON(SVM_EXIT_READ_DR3 158 EXIT_REASON(SVM_EXIT_READ_DR4 159 EXIT_REASON(SVM_EXIT_READ_DR5 160 EXIT_REASON(SVM_EXIT_READ_DR6 161 EXIT_REASON(SVM_EXIT_READ_DR7 162 EXIT_REASON(SVM_EXIT_READ_DR8 163 EXIT_REASON(SVM_EXIT_READ_DR9 164 EXIT_REASON(SVM_EXIT_READ_DR10 165 EXIT_REASON(SVM_EXIT_READ_DR11 166 EXIT_REASON(SVM_EXIT_READ_DR12 167 EXIT_REASON(SVM_EXIT_READ_DR13 168 EXIT_REASON(SVM_EXIT_READ_DR14 169 EXIT_REASON(SVM_EXIT_READ_DR15 170 EXIT_REASON(SVM_EXIT_WRITE_DR0 171 EXIT_REASON(SVM_EXIT_WRITE_DR1 172 EXIT_REASON(SVM_EXIT_WRITE_DR2 173 EXIT_REASON(SVM_EXIT_WRITE_DR3 174 EXIT_REASON(SVM_EXIT_WRITE_DR4 175 EXIT_REASON(SVM_EXIT_WRITE_DR5 176 EXIT_REASON(SVM_EXIT_WRITE_DR6 177 EXIT_REASON(SVM_EXIT_WRITE_DR7 178 EXIT_REASON(SVM_EXIT_WRITE_DR8 179 EXIT_REASON(SVM_EXIT_WRITE_DR9 180 EXIT_REASON(SVM_EXIT_WRITE_DR10 181 EXIT_REASON(SVM_EXIT_WRITE_DR11 182 EXIT_REASON(SVM_EXIT_WRITE_DR12 183 EXIT_REASON(SVM_EXIT_WRITE_DR13 184 EXIT_REASON(SVM_EXIT_WRITE_DR14 185 EXIT_REASON(SVM_EXIT_WRITE_DR15 186 EXIT_REASON(SVM_EXIT_EXCEPTION_0 187 EXIT_REASON(SVM_EXIT_EXCEPTION_1 188 EXIT_REASON(SVM_EXIT_EXCEPTION_2 189 EXIT_REASON(SVM_EXIT_EXCEPTION_3 190 EXIT_REASON(SVM_EXIT_EXCEPTION_4 191 EXIT_REASON(SVM_EXIT_EXCEPTION_5 192 EXIT_REASON(SVM_EXIT_EXCEPTION_6 193 EXIT_REASON(SVM_EXIT_EXCEPTION_7 194 EXIT_REASON(SVM_EXIT_EXCEPTION_8 195 EXIT_REASON(SVM_EXIT_EXCEPTION_9 196 EXIT_REASON(SVM_EXIT_EXCEPTION_A 197 EXIT_REASON(SVM_EXIT_EXCEPTION_B 198 EXIT_REASON(SVM_EXIT_EXCEPTION_C 199 EXIT_REASON(SVM_EXIT_EXCEPTION_D 200 EXIT_REASON(SVM_EXIT_EXCEPTION_E 201 EXIT_REASON(SVM_EXIT_EXCEPTION_F 202 EXIT_REASON(SVM_EXIT_EXCEPTION_10 203 EXIT_REASON(SVM_EXIT_EXCEPTION_11 204 EXIT_REASON(SVM_EXIT_EXCEPTION_12 205 EXIT_REASON(SVM_EXIT_EXCEPTION_13 206 EXIT_REASON(SVM_EXIT_EXCEPTION_14 207 EXIT_REASON(SVM_EXIT_EXCEPTION_15 208 EXIT_REASON(SVM_EXIT_EXCEPTION_16 209 EXIT_REASON(SVM_EXIT_EXCEPTION_17 210 EXIT_REASON(SVM_EXIT_EXCEPTION_18 211 EXIT_REASON(SVM_EXIT_EXCEPTION_19 212 EXIT_REASON(SVM_EXIT_EXCEPTION_1A 213 EXIT_REASON(SVM_EXIT_EXCEPTION_1B 214 EXIT_REASON(SVM_EXIT_EXCEPTION_1C 215 EXIT_REASON(SVM_EXIT_EXCEPTION_1D 216 EXIT_REASON(SVM_EXIT_EXCEPTION_1E 217 EXIT_REASON(SVM_EXIT_EXCEPTION_1F 218 EXIT_REASON(SVM_EXIT_INTR 219 EXIT_REASON(SVM_EXIT_NMI 220 EXIT_REASON(SVM_EXIT_SMI 221 EXIT_REASON(SVM_EXIT_INIT 222 EXIT_REASON(SVM_EXIT_VINTR 223 EXIT_REASON(SVM_EXIT_CR0_SEL_WRITE 224 EXIT_REASON(SVM_EXIT_IDTR_READ 225 EXIT_REASON(SVM_EXIT_GDTR_READ 226 EXIT_REASON(SVM_EXIT_LDTR_READ 227 EXIT_REASON(SVM_EXIT_TR_READ 228 EXIT_REASON(SVM_EXIT_TR_READ 229 EXIT_REASON(SVM_EXIT_TR_READ 230 EXIT_REASON(SVM_EXIT_TR_READ 231 EXIT_REASON(SVM_EXIT_TR_READ 232 EXIT_REASON(SVM_EXIT_RDTSC 233 EXIT_REASON(SVM_EXIT_RDPMC 234 EXIT_REASON(SVM_EXIT_PUSHF 235 EXIT_REASON(SVM_EXIT_POPF 236 EXIT_REASON(SVM_EXIT_CPUID 237 EXIT_REASON(SVM_EXIT_RSM 238 EXIT_REASON(SVM_EXIT_IRET 239 EXIT_REASON(SVM_EXIT_SWINT 240 EXIT_REASON(SVM_EXIT_INVD 241 EXIT_REASON(SVM_EXIT_PAUSE 242 EXIT_REASON(SVM_EXIT_HLT 243 EXIT_REASON(SVM_EXIT_INVLPG 244 EXIT_REASON(SVM_EXIT_INVLPGA 245 EXIT_REASON(SVM_EXIT_IOIO 246 EXIT_REASON(SVM_EXIT_MSR 247 EXIT_REASON(SVM_EXIT_TASK_SWITCH 248 EXIT_REASON(SVM_EXIT_FERR_FREEZE 249 EXIT_REASON(SVM_EXIT_SHUTDOWN 250 EXIT_REASON(SVM_EXIT_VMRUN 251 EXIT_REASON(SVM_EXIT_VMMCALL 252 EXIT_REASON(SVM_EXIT_VMLOAD 253 EXIT_REASON(SVM_EXIT_VMSAVE 254 EXIT_REASON(SVM_EXIT_STGI 255 EXIT_REASON(SVM_EXIT_CLGI 256 EXIT_REASON(SVM_EXIT_SKINIT 257 EXIT_REASON(SVM_EXIT_RDTSCP 258 EXIT_REASON(SVM_EXIT_ICEBP 259 EXIT_REASON(SVM_EXIT_WBINVD 260 EXIT_REASON(SVM_EXIT_MONITOR 261 EXIT_REASON(SVM_EXIT_MWAIT_UNCOND 262 EXIT_REASON(SVM_EXIT_MWAIT_ARMED 263 EXIT_REASON(SVM_EXIT_NPF 122 EXIT_REASON(SVM_EXIT_READ_CR0 , 0, "Read CR0."), 123 EXIT_REASON(SVM_EXIT_READ_CR1 , 1, "Read CR1."), 124 EXIT_REASON(SVM_EXIT_READ_CR2 , 2, "Read CR2."), 125 EXIT_REASON(SVM_EXIT_READ_CR3 , 3, "Read CR3."), 126 EXIT_REASON(SVM_EXIT_READ_CR4 , 4, "Read CR4."), 127 EXIT_REASON(SVM_EXIT_READ_CR5 , 5, "Read CR5."), 128 EXIT_REASON(SVM_EXIT_READ_CR6 , 6, "Read CR6."), 129 EXIT_REASON(SVM_EXIT_READ_CR7 , 7, "Read CR7."), 130 EXIT_REASON(SVM_EXIT_READ_CR8 , 8, "Read CR8."), 131 EXIT_REASON(SVM_EXIT_READ_CR9 , 9, "Read CR9."), 132 EXIT_REASON(SVM_EXIT_READ_CR10 , 10, "Read CR10."), 133 EXIT_REASON(SVM_EXIT_READ_CR11 , 11, "Read CR11."), 134 EXIT_REASON(SVM_EXIT_READ_CR12 , 12, "Read CR12."), 135 EXIT_REASON(SVM_EXIT_READ_CR13 , 13, "Read CR13."), 136 EXIT_REASON(SVM_EXIT_READ_CR14 , 14, "Read CR14."), 137 EXIT_REASON(SVM_EXIT_READ_CR15 , 15, "Read CR15."), 138 EXIT_REASON(SVM_EXIT_WRITE_CR0 , 16, "Write CR0."), 139 EXIT_REASON(SVM_EXIT_WRITE_CR1 , 17, "Write CR1."), 140 EXIT_REASON(SVM_EXIT_WRITE_CR2 , 18, "Write CR2."), 141 EXIT_REASON(SVM_EXIT_WRITE_CR3 , 19, "Write CR3."), 142 EXIT_REASON(SVM_EXIT_WRITE_CR4 , 20, "Write CR4."), 143 EXIT_REASON(SVM_EXIT_WRITE_CR5 , 21, "Write CR5."), 144 EXIT_REASON(SVM_EXIT_WRITE_CR6 , 22, "Write CR6."), 145 EXIT_REASON(SVM_EXIT_WRITE_CR7 , 23, "Write CR7."), 146 EXIT_REASON(SVM_EXIT_WRITE_CR8 , 24, "Write CR8."), 147 EXIT_REASON(SVM_EXIT_WRITE_CR9 , 25, "Write CR9."), 148 EXIT_REASON(SVM_EXIT_WRITE_CR10 , 26, "Write CR10."), 149 EXIT_REASON(SVM_EXIT_WRITE_CR11 , 27, "Write CR11."), 150 EXIT_REASON(SVM_EXIT_WRITE_CR12 , 28, "Write CR12."), 151 EXIT_REASON(SVM_EXIT_WRITE_CR13 , 29, "Write CR13."), 152 EXIT_REASON(SVM_EXIT_WRITE_CR14 , 30, "Write CR14."), 153 EXIT_REASON(SVM_EXIT_WRITE_CR15 , 31, "Write CR15."), 154 EXIT_REASON(SVM_EXIT_READ_DR0 , 32, "Read DR0."), 155 EXIT_REASON(SVM_EXIT_READ_DR1 , 33, "Read DR1."), 156 EXIT_REASON(SVM_EXIT_READ_DR2 , 34, "Read DR2."), 157 EXIT_REASON(SVM_EXIT_READ_DR3 , 35, "Read DR3."), 158 EXIT_REASON(SVM_EXIT_READ_DR4 , 36, "Read DR4."), 159 EXIT_REASON(SVM_EXIT_READ_DR5 , 37, "Read DR5."), 160 EXIT_REASON(SVM_EXIT_READ_DR6 , 38, "Read DR6."), 161 EXIT_REASON(SVM_EXIT_READ_DR7 , 39, "Read DR7."), 162 EXIT_REASON(SVM_EXIT_READ_DR8 , 40, "Read DR8."), 163 EXIT_REASON(SVM_EXIT_READ_DR9 , 41, "Read DR9."), 164 EXIT_REASON(SVM_EXIT_READ_DR10 , 42, "Read DR10."), 165 EXIT_REASON(SVM_EXIT_READ_DR11 , 43, "Read DR11"), 166 EXIT_REASON(SVM_EXIT_READ_DR12 , 44, "Read DR12."), 167 EXIT_REASON(SVM_EXIT_READ_DR13 , 45, "Read DR13."), 168 EXIT_REASON(SVM_EXIT_READ_DR14 , 46, "Read DR14."), 169 EXIT_REASON(SVM_EXIT_READ_DR15 , 47, "Read DR15."), 170 EXIT_REASON(SVM_EXIT_WRITE_DR0 , 48, "Write DR0."), 171 EXIT_REASON(SVM_EXIT_WRITE_DR1 , 49, "Write DR1."), 172 EXIT_REASON(SVM_EXIT_WRITE_DR2 , 50, "Write DR2."), 173 EXIT_REASON(SVM_EXIT_WRITE_DR3 , 51, "Write DR3."), 174 EXIT_REASON(SVM_EXIT_WRITE_DR4 , 52, "Write DR4."), 175 EXIT_REASON(SVM_EXIT_WRITE_DR5 , 53, "Write DR5."), 176 EXIT_REASON(SVM_EXIT_WRITE_DR6 , 54, "Write DR6."), 177 EXIT_REASON(SVM_EXIT_WRITE_DR7 , 55, "Write DR7."), 178 EXIT_REASON(SVM_EXIT_WRITE_DR8 , 56, "Write DR8."), 179 EXIT_REASON(SVM_EXIT_WRITE_DR9 , 57, "Write DR9."), 180 EXIT_REASON(SVM_EXIT_WRITE_DR10 , 58, "Write DR10."), 181 EXIT_REASON(SVM_EXIT_WRITE_DR11 , 59, "Write DR11."), 182 EXIT_REASON(SVM_EXIT_WRITE_DR12 , 60, "Write DR12."), 183 EXIT_REASON(SVM_EXIT_WRITE_DR13 , 61, "Write DR13."), 184 EXIT_REASON(SVM_EXIT_WRITE_DR14 , 62, "Write DR14."), 185 EXIT_REASON(SVM_EXIT_WRITE_DR15 , 63, "Write DR15."), 186 EXIT_REASON(SVM_EXIT_EXCEPTION_0 , 64, "Exception Vector 0 (0x0)."), 187 EXIT_REASON(SVM_EXIT_EXCEPTION_1 , 65, "Exception Vector 1 (0x1)."), 188 EXIT_REASON(SVM_EXIT_EXCEPTION_2 , 66, "Exception Vector 2 (0x2)."), 189 EXIT_REASON(SVM_EXIT_EXCEPTION_3 , 67, "Exception Vector 3 (0x3)."), 190 EXIT_REASON(SVM_EXIT_EXCEPTION_4 , 68, "Exception Vector 4 (0x4)."), 191 EXIT_REASON(SVM_EXIT_EXCEPTION_5 , 69, "Exception Vector 5 (0x5)."), 192 EXIT_REASON(SVM_EXIT_EXCEPTION_6 , 70, "Exception Vector 6 (0x6)."), 193 EXIT_REASON(SVM_EXIT_EXCEPTION_7 , 71, "Exception Vector 7 (0x7)."), 194 EXIT_REASON(SVM_EXIT_EXCEPTION_8 , 72, "Exception Vector 8 (0x8)."), 195 EXIT_REASON(SVM_EXIT_EXCEPTION_9 , 73, "Exception Vector 9 (0x9)."), 196 EXIT_REASON(SVM_EXIT_EXCEPTION_A , 74, "Exception Vector 10 (0xA)."), 197 EXIT_REASON(SVM_EXIT_EXCEPTION_B , 75, "Exception Vector 11 (0xB)."), 198 EXIT_REASON(SVM_EXIT_EXCEPTION_C , 76, "Exception Vector 12 (0xC)."), 199 EXIT_REASON(SVM_EXIT_EXCEPTION_D , 77, "Exception Vector 13 (0xD)."), 200 EXIT_REASON(SVM_EXIT_EXCEPTION_E , 78, "Exception Vector 14 (0xE)."), 201 EXIT_REASON(SVM_EXIT_EXCEPTION_F , 79, "Exception Vector 15 (0xF)."), 202 EXIT_REASON(SVM_EXIT_EXCEPTION_10 , 80, "Exception Vector 16 (0x10)."), 203 EXIT_REASON(SVM_EXIT_EXCEPTION_11 , 81, "Exception Vector 17 (0x11)."), 204 EXIT_REASON(SVM_EXIT_EXCEPTION_12 , 82, "Exception Vector 18 (0x12)."), 205 EXIT_REASON(SVM_EXIT_EXCEPTION_13 , 83, "Exception Vector 19 (0x13)."), 206 EXIT_REASON(SVM_EXIT_EXCEPTION_14 , 84, "Exception Vector 20 (0x14)."), 207 EXIT_REASON(SVM_EXIT_EXCEPTION_15 , 85, "Exception Vector 22 (0x15)."), 208 EXIT_REASON(SVM_EXIT_EXCEPTION_16 , 86, "Exception Vector 22 (0x16)."), 209 EXIT_REASON(SVM_EXIT_EXCEPTION_17 , 87, "Exception Vector 23 (0x17)."), 210 EXIT_REASON(SVM_EXIT_EXCEPTION_18 , 88, "Exception Vector 24 (0x18)."), 211 EXIT_REASON(SVM_EXIT_EXCEPTION_19 , 89, "Exception Vector 25 (0x19)."), 212 EXIT_REASON(SVM_EXIT_EXCEPTION_1A , 90, "Exception Vector 26 (0x1A)."), 213 EXIT_REASON(SVM_EXIT_EXCEPTION_1B , 91, "Exception Vector 27 (0x1B)."), 214 EXIT_REASON(SVM_EXIT_EXCEPTION_1C , 92, "Exception Vector 28 (0x1C)."), 215 EXIT_REASON(SVM_EXIT_EXCEPTION_1D , 93, "Exception Vector 29 (0x1D)."), 216 EXIT_REASON(SVM_EXIT_EXCEPTION_1E , 94, "Exception Vector 30 (0x1E)."), 217 EXIT_REASON(SVM_EXIT_EXCEPTION_1F , 95, "Exception Vector 31 (0x1F)."), 218 EXIT_REASON(SVM_EXIT_INTR , 96, "Physical maskable interrupt."), 219 EXIT_REASON(SVM_EXIT_NMI , 97, "Physical non-maskable interrupt."), 220 EXIT_REASON(SVM_EXIT_SMI , 98, "System management interrupt."), 221 EXIT_REASON(SVM_EXIT_INIT , 99, "Physical INIT signal."), 222 EXIT_REASON(SVM_EXIT_VINTR ,100, "Virtual interrupt."), 223 EXIT_REASON(SVM_EXIT_CR0_SEL_WRITE ,101, "Write to CR0 that changed any bits other than CR0.TS or CR0.MP."), 224 EXIT_REASON(SVM_EXIT_IDTR_READ ,102, "Read IDTR"), 225 EXIT_REASON(SVM_EXIT_GDTR_READ ,103, "Read GDTR"), 226 EXIT_REASON(SVM_EXIT_LDTR_READ ,104, "Read LDTR."), 227 EXIT_REASON(SVM_EXIT_TR_READ ,105, "Read TR."), 228 EXIT_REASON(SVM_EXIT_TR_READ ,106, "Write IDTR."), 229 EXIT_REASON(SVM_EXIT_TR_READ ,107, "Write GDTR."), 230 EXIT_REASON(SVM_EXIT_TR_READ ,108, "Write LDTR."), 231 EXIT_REASON(SVM_EXIT_TR_READ ,109, "Write TR."), 232 EXIT_REASON(SVM_EXIT_RDTSC ,110, "RDTSC instruction."), 233 EXIT_REASON(SVM_EXIT_RDPMC ,111, "RDPMC instruction."), 234 EXIT_REASON(SVM_EXIT_PUSHF ,112, "PUSHF instruction."), 235 EXIT_REASON(SVM_EXIT_POPF ,113, "POPF instruction."), 236 EXIT_REASON(SVM_EXIT_CPUID ,114, "CPUID instruction."), 237 EXIT_REASON(SVM_EXIT_RSM ,115, "RSM instruction."), 238 EXIT_REASON(SVM_EXIT_IRET ,116, "IRET instruction."), 239 EXIT_REASON(SVM_EXIT_SWINT ,117, "Software interrupt (INTn instructions)."), 240 EXIT_REASON(SVM_EXIT_INVD ,118, "INVD instruction."), 241 EXIT_REASON(SVM_EXIT_PAUSE ,119, "PAUSE instruction."), 242 EXIT_REASON(SVM_EXIT_HLT ,120, "HLT instruction."), 243 EXIT_REASON(SVM_EXIT_INVLPG ,121, "INVLPG instruction."), 244 EXIT_REASON(SVM_EXIT_INVLPGA ,122, "INVLPGA instruction."), 245 EXIT_REASON(SVM_EXIT_IOIO ,123, "IN/OUT accessing protected port (EXITINFO1 field provides more information)."), 246 EXIT_REASON(SVM_EXIT_MSR ,124, "RDMSR or WRMSR access to protected MSR."), 247 EXIT_REASON(SVM_EXIT_TASK_SWITCH ,125, "Task switch."), 248 EXIT_REASON(SVM_EXIT_FERR_FREEZE ,126, "FP legacy handling enabled, and processor is frozen in an x87/mmx instruction waiting for an interrupt"), 249 EXIT_REASON(SVM_EXIT_SHUTDOWN ,127, "Shutdown."), 250 EXIT_REASON(SVM_EXIT_VMRUN ,128, "VMRUN instruction."), 251 EXIT_REASON(SVM_EXIT_VMMCALL ,129, "VMCALL instruction."), 252 EXIT_REASON(SVM_EXIT_VMLOAD ,130, "VMLOAD instruction."), 253 EXIT_REASON(SVM_EXIT_VMSAVE ,131, "VMSAVE instruction."), 254 EXIT_REASON(SVM_EXIT_STGI ,132, "STGI instruction."), 255 EXIT_REASON(SVM_EXIT_CLGI ,133, "CLGI instruction."), 256 EXIT_REASON(SVM_EXIT_SKINIT ,134, "SKINIT instruction."), 257 EXIT_REASON(SVM_EXIT_RDTSCP ,135, "RDTSCP instruction."), 258 EXIT_REASON(SVM_EXIT_ICEBP ,136, "ICEBP instruction."), 259 EXIT_REASON(SVM_EXIT_WBINVD ,137, "WBINVD instruction."), 260 EXIT_REASON(SVM_EXIT_MONITOR ,138, "MONITOR instruction."), 261 EXIT_REASON(SVM_EXIT_MWAIT_UNCOND ,139, "MWAIT instruction unconditional."), 262 EXIT_REASON(SVM_EXIT_MWAIT_ARMED ,140, "MWAIT instruction when armed."), 263 EXIT_REASON(SVM_EXIT_NPF ,1024, "Nested paging: host-level page fault occurred (EXITINFO1 contains fault errorcode; EXITINFO2 contains the guest physical address causing the fault)."), 264 264 EXIT_REASON_NIL() 265 265 }; … … 310 310 AssertReleaseMsg(RT_OFFSETOF(SVM_VMCB, guest.u64LASTEXCPTO) == 0x690, ("guest.u64LASTEXCPTO offset = %x\n", RT_OFFSETOF(SVM_VMCB, guest.u64LASTEXCPTO))); 311 311 AssertReleaseMsg(sizeof(SVM_VMCB) == 0x1000, ("SVM_VMCB size = %x\n", sizeof(SVM_VMCB))); 312 313 312 314 313 /* … … 439 438 440 439 #ifdef VBOX_WITH_STATISTICS 441 STAM_REG(pVM, &pVM->hm.s.StatT PRPatchSuccess, STAMTYPE_COUNTER, "/HM/TPR/Patch/Success", STAMUNIT_OCCURENCES,"Number of times an instruction was successfully patched.");442 STAM_REG(pVM, &pVM->hm.s.StatT PRPatchFailure, STAMTYPE_COUNTER, "/HM/TPR/Patch/Failed", STAMUNIT_OCCURENCES,"Number of unsuccessful patch attempts.");443 STAM_REG(pVM, &pVM->hm.s.StatT PRReplaceSuccess, STAMTYPE_COUNTER, "/HM/TPR/Replace/Success",STAMUNIT_OCCURENCES,"Number of times an instruction was successfully patched.");444 STAM_REG(pVM, &pVM->hm.s.StatT PRReplaceFailure, STAMTYPE_COUNTER, "/HM/TPR/Replace/Failed", STAMUNIT_OCCURENCES,"Number of unsuccessful patch attempts.");440 STAM_REG(pVM, &pVM->hm.s.StatTprPatchSuccess, STAMTYPE_COUNTER, "/HM/TPR/Patch/Success", STAMUNIT_OCCURENCES, "Number of times an instruction was successfully patched."); 441 STAM_REG(pVM, &pVM->hm.s.StatTprPatchFailure, STAMTYPE_COUNTER, "/HM/TPR/Patch/Failed", STAMUNIT_OCCURENCES, "Number of unsuccessful patch attempts."); 442 STAM_REG(pVM, &pVM->hm.s.StatTprReplaceSuccess, STAMTYPE_COUNTER, "/HM/TPR/Replace/Success",STAMUNIT_OCCURENCES, "Number of times an instruction was successfully patched."); 443 STAM_REG(pVM, &pVM->hm.s.StatTprReplaceFailure, STAMTYPE_COUNTER, "/HM/TPR/Replace/Failed", STAMUNIT_OCCURENCES, "Number of unsuccessful patch attempts."); 445 444 446 445 /* … … 452 451 int rc; 453 452 454 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatPoke, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of RTMpPokeCpu", 453 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatPoke, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 454 "Profiling of RTMpPokeCpu", 455 455 "/PROF/HM/CPU%d/Poke", i); 456 456 AssertRC(rc); 457 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatSpinPoke, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of poke wait", 457 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatSpinPoke, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 458 "Profiling of poke wait", 458 459 "/PROF/HM/CPU%d/PokeWait", i); 459 460 AssertRC(rc); 460 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatSpinPokeFailed, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of poke wait when RTMpPokeCpu fails", 461 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatSpinPokeFailed, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 462 "Profiling of poke wait when RTMpPokeCpu fails", 461 463 "/PROF/HM/CPU%d/PokeWaitFailed", i); 462 464 AssertRC(rc); 463 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatEntry, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of VMXR0RunGuestCode entry", 465 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatEntry, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 466 "Profiling of VMXR0RunGuestCode entry", 464 467 "/PROF/HM/CPU%d/SwitchToGC", i); 465 468 AssertRC(rc); 466 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit1, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of VMXR0RunGuestCode exit part 1", 469 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit1, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 470 "Profiling of VMXR0RunGuestCode exit part 1", 467 471 "/PROF/HM/CPU%d/SwitchFromGC_1", i); 468 472 AssertRC(rc); 469 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of VMXR0RunGuestCode exit part 2", 473 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 474 "Profiling of VMXR0RunGuestCode exit part 2", 470 475 "/PROF/HM/CPU%d/SwitchFromGC_2", i); 471 476 AssertRC(rc); 472 477 # if 1 /* temporary for tracking down darwin holdup. */ 473 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2Sub1, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Temporary - I/O", 478 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2Sub1, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 479 "Temporary - I/O", 474 480 "/PROF/HM/CPU%d/SwitchFromGC_2/Sub1", i); 475 481 AssertRC(rc); 476 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2Sub2, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Temporary - CRx RWs", 482 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2Sub2, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 483 "Temporary - CRx RWs", 477 484 "/PROF/HM/CPU%d/SwitchFromGC_2/Sub2", i); 478 485 AssertRC(rc); 479 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2Sub3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Temporary - Exceptions", 486 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExit2Sub3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 487 "Temporary - Exceptions", 480 488 "/PROF/HM/CPU%d/SwitchFromGC_2/Sub3", i); 481 489 AssertRC(rc); 482 490 # endif 483 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatInGC, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of vmlaunch", 491 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatInGC, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, 492 "Profiling of vmlaunch", 484 493 "/PROF/HM/CPU%d/InGC", i); 485 494 AssertRC(rc); 486 495 487 496 # if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) 488 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatWorldSwitch3264, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of the 32/64 switcher", 497 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatWorldSwitch3264, STAMTYPE_PROFILE, STAMVISIBILITY_USED, 498 STAMUNIT_TICKS_PER_CALL, "Profiling of the 32/64 switcher", 489 499 "/PROF/HM/CPU%d/Switcher3264", i); 490 500 AssertRC(rc); … … 550 560 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushPageManual, "/HM/CPU%d/Flush/Page/Virt"); 551 561 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushPhysPageManual, "/HM/CPU%d/Flush/Page/Phys"); 552 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushT LB, "/HM/CPU%d/Flush/TLB");553 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushT LBManual, "/HM/CPU%d/Flush/TLB/Manual");554 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushT LBCRxChange, "/HM/CPU%d/Flush/TLB/CRx");562 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushTlb, "/HM/CPU%d/Flush/TLB"); 563 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushTlbManual, "/HM/CPU%d/Flush/TLB/Manual"); 564 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushTlbCRxChange, "/HM/CPU%d/Flush/TLB/CRx"); 555 565 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushPageInvlpg, "/HM/CPU%d/Flush/Page/Invlpg"); 556 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushT LBWorldSwitch, "/HM/CPU%d/Flush/TLB/Switch");557 HM_REG_COUNTER(&pVCpu->hm.s.StatNoFlushT LBWorldSwitch, "/HM/CPU%d/Flush/TLB/Skipped");566 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushTlbWorldSwitch, "/HM/CPU%d/Flush/TLB/Switch"); 567 HM_REG_COUNTER(&pVCpu->hm.s.StatNoFlushTlbWorldSwitch, "/HM/CPU%d/Flush/TLB/Skipped"); 558 568 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushAsid, "/HM/CPU%d/Flush/TLB/ASID"); 559 569 HM_REG_COUNTER(&pVCpu->hm.s.StatFlushNestedPaging, "/HM/CPU%d/Flush/TLB/NestedPaging"); … … 562 572 HM_REG_COUNTER(&pVCpu->hm.s.StatTlbShootdownFlush, "/HM/CPU%d/Flush/Shootdown/TLB"); 563 573 564 HM_REG_COUNTER(&pVCpu->hm.s.StatT SCOffset, "/HM/CPU%d/TSC/Offset");565 HM_REG_COUNTER(&pVCpu->hm.s.StatT SCIntercept, "/HM/CPU%d/TSC/Intercept");566 HM_REG_COUNTER(&pVCpu->hm.s.StatT SCInterceptOverFlow, "/HM/CPU%d/TSC/InterceptOverflow");574 HM_REG_COUNTER(&pVCpu->hm.s.StatTscOffset, "/HM/CPU%d/TSC/Offset"); 575 HM_REG_COUNTER(&pVCpu->hm.s.StatTscIntercept, "/HM/CPU%d/TSC/Intercept"); 576 HM_REG_COUNTER(&pVCpu->hm.s.StatTscInterceptOverFlow, "/HM/CPU%d/TSC/InterceptOverflow"); 567 577 568 578 HM_REG_COUNTER(&pVCpu->hm.s.StatDRxArmed, "/HM/CPU%d/Debug/Armed"); 569 579 HM_REG_COUNTER(&pVCpu->hm.s.StatDRxContextSwitch, "/HM/CPU%d/Debug/ContextSwitch"); 570 HM_REG_COUNTER(&pVCpu->hm.s.StatDRxI OCheck, "/HM/CPU%d/Debug/IOCheck");580 HM_REG_COUNTER(&pVCpu->hm.s.StatDRxIoCheck, "/HM/CPU%d/Debug/IOCheck"); 571 581 572 582 HM_REG_COUNTER(&pVCpu->hm.s.StatLoadMinimal, "/HM/CPU%d/Load/Minimal"); … … 580 590 for (unsigned j = 0; j < RT_ELEMENTS(pVCpu->hm.s.StatExitCRxWrite); j++) 581 591 { 582 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitCRxWrite[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "Profiling of CRx writes", 583 "/HM/CPU%d/Exit/Instr/CR/Write/%x", i, j); 592 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitCRxWrite[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, 593 STAMUNIT_OCCURENCES, "Profiling of CRx writes", 594 "/HM/CPU%d/Exit/Instr/CR/Write/%x", i, j); 584 595 AssertRC(rc); 585 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitCRxRead[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "Profiling of CRx reads", 586 "/HM/CPU%d/Exit/Instr/CR/Read/%x", i, j); 596 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitCRxRead[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, 597 STAMUNIT_OCCURENCES, "Profiling of CRx reads", 598 "/HM/CPU%d/Exit/Instr/CR/Read/%x", i, j); 587 599 AssertRC(rc); 588 600 } … … 592 604 pVCpu->hm.s.paStatExitReason = NULL; 593 605 594 rc = MMHyperAlloc(pVM, MAX_EXITREASON_STAT*sizeof(*pVCpu->hm.s.paStatExitReason), 0, MM_TAG_HM, (void **)&pVCpu->hm.s.paStatExitReason); 606 rc = MMHyperAlloc(pVM, MAX_EXITREASON_STAT*sizeof(*pVCpu->hm.s.paStatExitReason), 0, MM_TAG_HM, 607 (void **)&pVCpu->hm.s.paStatExitReason); 595 608 AssertRC(rc); 596 609 if (RT_SUCCESS(rc)) … … 601 614 if (papszDesc[j]) 602 615 { 603 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,604 papszDesc[j], "/HM/CPU%d/Exit/Reason/%02x", i, j);616 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, 617 STAMUNIT_OCCURENCES, papszDesc[j], "/HM/CPU%d/Exit/Reason/%02x", i, j); 605 618 AssertRC(rc); 606 619 } 607 620 } 608 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitReasonNPF, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "Nested page fault", "/HM/CPU%d/Exit/Reason/#NPF", i); 621 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitReasonNpf, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 622 "Nested page fault", "/HM/CPU%d/Exit/Reason/#NPF", i); 609 623 AssertRC(rc); 610 624 } … … 625 639 # endif 626 640 for (unsigned j = 0; j < 255; j++) 627 STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatInjectedIrqs[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "Forwarded interrupts.", 641 { 642 STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatInjectedIrqs[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 643 "Forwarded interrupts.", 628 644 (j < 0x20) ? "/HM/CPU%d/Interrupt/Trap/%02X" : "/HM/CPU%d/Interrupt/IRQ/%02X", i, j); 645 } 629 646 630 647 } … … 1168 1185 { 1169 1186 pVM->hm.s.vmx.pNonPagingModeEPTPageTable->a[i].u = _4M * i; 1170 pVM->hm.s.vmx.pNonPagingModeEPTPageTable->a[i].u |= X86_PDE4M_P | X86_PDE4M_RW | X86_PDE4M_US | X86_PDE4M_A | X86_PDE4M_D | X86_PDE4M_PS | X86_PDE4M_G; 1187 pVM->hm.s.vmx.pNonPagingModeEPTPageTable->a[i].u |= X86_PDE4M_P | X86_PDE4M_RW | X86_PDE4M_US 1188 | X86_PDE4M_A | X86_PDE4M_D | X86_PDE4M_PS 1189 | X86_PDE4M_G; 1171 1190 } 1172 1191 … … 1563 1582 if (pVCpu->hm.s.vmx.enmLastSeenGuestMode == enmGuestMode) 1564 1583 { 1565 Log(("HMR3PagingModeChanged missed %s->%s transition (prev %s)\n", PGMGetModeName(pVCpu->hm.s.vmx.enmPrevGuestMode), PGMGetModeName(pVCpu->hm.s.vmx.enmCurrGuestMode), PGMGetModeName(pVCpu->hm.s.vmx.enmLastSeenGuestMode))); 1584 Log(("HMR3PagingModeChanged missed %s->%s transition (prev %s)\n", PGMGetModeName(pVCpu->hm.s.vmx.enmPrevGuestMode), 1585 PGMGetModeName(pVCpu->hm.s.vmx.enmCurrGuestMode), PGMGetModeName(pVCpu->hm.s.vmx.enmLastSeenGuestMode))); 1566 1586 pVCpu->hm.s.vmx.enmLastSeenGuestMode = pVCpu->hm.s.vmx.enmPrevGuestMode; 1567 1587 } … … 1828 1848 1829 1849 /* @todo Potential deadlock when other VCPUs are waiting on the IOM lock (we own it)!! */ 1830 int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONE_BY_ONE, hmR3RemovePatches, (void *)(uintptr_t)VMMGetCpuId(pVM)); 1850 int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONE_BY_ONE, hmR3RemovePatches, 1851 (void *)(uintptr_t)VMMGetCpuId(pVM)); 1831 1852 AssertRC(rc); 1832 1853 … … 1994 2015 1995 2016 pVM->hm.s.cPatches++; 1996 STAM_COUNTER_INC(&pVM->hm.s.StatT PRReplaceSuccess);2017 STAM_COUNTER_INC(&pVM->hm.s.StatTprReplaceSuccess); 1997 2018 return VINF_SUCCESS; 1998 2019 } … … 2007 2028 AssertRC(rc); 2008 2029 pVM->hm.s.cPatches++; 2009 STAM_COUNTER_INC(&pVM->hm.s.StatT PRReplaceFailure);2030 STAM_COUNTER_INC(&pVM->hm.s.StatTprReplaceFailure); 2010 2031 return VINF_SUCCESS; 2011 2032 } … … 2221 2242 pVM->hm.s.cPatches++; 2222 2243 pVM->hm.s.fTPRPatchingActive = true; 2223 STAM_COUNTER_INC(&pVM->hm.s.StatT PRPatchSuccess);2244 STAM_COUNTER_INC(&pVM->hm.s.StatTprPatchSuccess); 2224 2245 return VINF_SUCCESS; 2225 2246 } … … 2240 2261 AssertRC(rc); 2241 2262 pVM->hm.s.cPatches++; 2242 STAM_COUNTER_INC(&pVM->hm.s.StatT PRPatchFailure);2263 STAM_COUNTER_INC(&pVM->hm.s.StatTprPatchFailure); 2243 2264 return VINF_SUCCESS; 2244 2265 } … … 2323 2344 2324 2345 /* Note! The context supplied by REM is partial. If we add more checks here, be sure to verify that REM provides this info! */ 2325 Assert((pVM->hm.s.vmx.fUnrestrictedGuest && !pVM->hm.s.vmx.pRealModeTSS) || (!pVM->hm.s.vmx.fUnrestrictedGuest && pVM->hm.s.vmx.pRealModeTSS)); 2346 Assert( (pVM->hm.s.vmx.fUnrestrictedGuest && !pVM->hm.s.vmx.pRealModeTSS) 2347 || (!pVM->hm.s.vmx.fUnrestrictedGuest && pVM->hm.s.vmx.pRealModeTSS)); 2326 2348 2327 2349 bool fSupportsRealMode = pVM->hm.s.vmx.fUnrestrictedGuest || PDMVMMDevHeapIsEnabled(pVM); … … 2397 2419 pVM->aCpus[0].hm.s.fContextUseFlags |= HM_CHANGED_ALL_GUEST; 2398 2420 2399 if ( !pVM->hm.s.fNestedPaging /* requires a fake PD for real *and* protected mode without paging - stored in the VMM device heap */2400 || CPUMIsGuestInRealModeEx(pCtx)) 2421 if ( !pVM->hm.s.fNestedPaging /* requires a fake PD for real *and* protected mode without paging - stored in the VMM device heap */ 2422 || CPUMIsGuestInRealModeEx(pCtx)) /* requires a fake TSS for real mode - stored in the VMM device heap */ 2401 2423 return false; 2402 2424 -
trunk/src/VBox/VMM/include/HMInternal.h
r43495 r43509 426 426 bool u8Alignment1[7]; 427 427 428 STAMCOUNTER StatT PRPatchSuccess;429 STAMCOUNTER StatT PRPatchFailure;430 STAMCOUNTER StatT PRReplaceSuccess;431 STAMCOUNTER StatT PRReplaceFailure;428 STAMCOUNTER StatTprPatchSuccess; 429 STAMCOUNTER StatTprPatchFailure; 430 STAMCOUNTER StatTprReplaceSuccess; 431 STAMCOUNTER StatTprReplaceFailure; 432 432 } HM; 433 433 /** Pointer to HM VM instance data. */ … … 513 513 /** Old style FPU reporting trap mask override performed (optimization) */ 514 514 bool fFPUOldStyleOverride; 515 516 515 /** Set if we don't have to flush the TLB on VM entry. */ 517 516 bool fResumeVM; 518 519 517 /** Set if we need to flush the TLB during the world switch. */ 520 518 bool fForceTLBFlush; 521 522 519 /** Set when we're using VT-x or AMD-V at that moment. */ 523 520 bool fActive; 524 525 521 /** Set when the TLB has been checked until we return from the world switch. */ 526 522 volatile bool fCheckedTLBFlush; 527 uint8_t bAlignment[3];523 uint8_t u8Alignment[3]; 528 524 529 525 /** World switch exit counter. */ 530 526 volatile uint32_t cWorldSwitchExits; 531 532 527 /** HM_CHANGED_* flags. */ 533 528 uint32_t fContextUseFlags; 534 535 529 /** Id of the last cpu we were executing code on (NIL_RTCPUID for the first time) */ 536 530 RTCPUID idLastCpu; 537 538 531 /** TLB flush count */ 539 532 uint32_t cTlbFlushes; 540 541 533 /** Current ASID in use by the VM */ 542 534 uint32_t uCurrentAsid; 543 544 535 uint32_t u32Alignment; 545 536 … … 555 546 /** Virtual address of the VM control structure (VMCS). */ 556 547 R0PTRTYPE(void *) pvVMCS; 557 558 548 /** Ring 0 handlers for VT-x. */ 559 PFNHMVMXSTARTVM pfnStartVM;549 PFNHMVMXSTARTVM pfnStartVM; 560 550 561 551 #if HC_ARCH_BITS == 32 … … 565 555 /** Current VMX_VMCS_CTRL_PROC_EXEC_CONTROLS. */ 566 556 uint64_t proc_ctls; 567 568 557 /** Current VMX_VMCS_CTRL_PROC_EXEC2_CONTROLS. */ 569 558 uint64_t proc_ctls2; 570 571 559 /** Physical address of the virtual APIC page for TPR caching. */ 572 560 RTHCPHYS HCPhysVAPIC; … … 580 568 /** Current CR4 mask. */ 581 569 uint64_t cr4_mask; 582 583 570 /** Current EPTP. */ 584 571 RTHCPHYS GCPhysEPTP; … … 616 603 /* Last use TSC offset value. (cached) */ 617 604 uint64_t u64TSCOffset; 618 619 605 /** VMCS cache. */ 620 606 VMCSCACHE VMCSCache; … … 803 789 STAMCOUNTER StatFlushPageManual; 804 790 STAMCOUNTER StatFlushPhysPageManual; 805 STAMCOUNTER StatFlushT LB;806 STAMCOUNTER StatFlushT LBManual;791 STAMCOUNTER StatFlushTlb; 792 STAMCOUNTER StatFlushTlbManual; 807 793 STAMCOUNTER StatFlushPageInvlpg; 808 STAMCOUNTER StatFlushT LBWorldSwitch;809 STAMCOUNTER StatNoFlushT LBWorldSwitch;810 STAMCOUNTER StatFlushT LBCRxChange;794 STAMCOUNTER StatFlushTlbWorldSwitch; 795 STAMCOUNTER StatNoFlushTlbWorldSwitch; 796 STAMCOUNTER StatFlushTlbCRxChange; 811 797 STAMCOUNTER StatFlushAsid; 812 798 STAMCOUNTER StatFlushNestedPaging; … … 818 804 STAMCOUNTER StatSwitchToR3; 819 805 820 STAMCOUNTER StatT SCOffset;821 STAMCOUNTER StatT SCIntercept;822 STAMCOUNTER StatT SCInterceptOverFlow;823 824 STAMCOUNTER StatExitReasonN PF;806 STAMCOUNTER StatTscOffset; 807 STAMCOUNTER StatTscIntercept; 808 STAMCOUNTER StatTscInterceptOverFlow; 809 810 STAMCOUNTER StatExitReasonNpf; 825 811 STAMCOUNTER StatDRxArmed; 826 812 STAMCOUNTER StatDRxContextSwitch; 827 STAMCOUNTER StatDRxI OCheck;813 STAMCOUNTER StatDRxIoCheck; 828 814 829 815 STAMCOUNTER StatLoadMinimal;
Note:
See TracChangeset
for help on using the changeset viewer.