Changeset 15217 in vbox
- Timestamp:
- Dec 9, 2008 11:58:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/HWACCM.cpp
r15197 r15217 47 47 #include <iprt/string.h> 48 48 #include <iprt/thread.h> 49 50 /******************************************************************************* 51 * Global Variables * 52 *******************************************************************************/ 53 #ifdef VBOX_WITH_STATISTICS 54 # define EXIT_REASON(def, val, str) #def " - " #val " - " str 55 # define EXIT_REASON_NIL() NULL 56 /** Exit reason descriptions for VT-x, used to describe statistics. */ 57 static const char * const g_apszVTxExitReasons[MAX_EXITREASON_STAT] = 58 { 59 EXIT_REASON(VMX_EXIT_EXCEPTION , 0, "Exception or non-maskable interrupt (NMI)."), 60 EXIT_REASON(VMX_EXIT_EXTERNAL_IRQ , 1, "External interrupt."), 61 EXIT_REASON(VMX_EXIT_TRIPLE_FAULT , 2, "Triple fault."), 62 EXIT_REASON(VMX_EXIT_INIT_SIGNAL , 3, "INIT signal."), 63 EXIT_REASON(VMX_EXIT_SIPI , 4, "Start-up IPI (SIPI)."), 64 EXIT_REASON(VMX_EXIT_IO_SMI_IRQ , 5, "I/O system-management interrupt (SMI)."), 65 EXIT_REASON(VMX_EXIT_SMI_IRQ , 6, "Other SMI."), 66 EXIT_REASON(VMX_EXIT_IRQ_WINDOW , 7, "Interrupt window."), 67 EXIT_REASON_NIL(), 68 EXIT_REASON(VMX_EXIT_TASK_SWITCH , 9, "Task switch."), 69 EXIT_REASON(VMX_EXIT_CPUID , 10, "Guest software attempted to execute CPUID."), 70 EXIT_REASON_NIL(), 71 EXIT_REASON(VMX_EXIT_HLT , 12, "Guest software attempted to execute HLT."), 72 EXIT_REASON(VMX_EXIT_INVD , 13, "Guest software attempted to execute INVD."), 73 EXIT_REASON(VMX_EXIT_INVPG , 14, "Guest software attempted to execute INVPG."), 74 EXIT_REASON(VMX_EXIT_RDPMC , 15, "Guest software attempted to execute RDPMC."), 75 EXIT_REASON(VMX_EXIT_RDTSC , 16, "Guest software attempted to execute RDTSC."), 76 EXIT_REASON(VMX_EXIT_RSM , 17, "Guest software attempted to execute RSM in SMM."), 77 EXIT_REASON(VMX_EXIT_VMCALL , 18, "Guest software executed VMCALL."), 78 EXIT_REASON(VMX_EXIT_VMCLEAR , 19, "Guest software executed VMCLEAR."), 79 EXIT_REASON(VMX_EXIT_VMLAUNCH , 20, "Guest software executed VMLAUNCH."), 80 EXIT_REASON(VMX_EXIT_VMPTRLD , 21, "Guest software executed VMPTRLD."), 81 EXIT_REASON(VMX_EXIT_VMPTRST , 22, "Guest software executed VMPTRST."), 82 EXIT_REASON(VMX_EXIT_VMREAD , 23, "Guest software executed VMREAD."), 83 EXIT_REASON(VMX_EXIT_VMRESUME , 24, "Guest software executed VMRESUME."), 84 EXIT_REASON(VMX_EXIT_VMWRITE , 25, "Guest software executed VMWRITE."), 85 EXIT_REASON(VMX_EXIT_VMXOFF , 26, "Guest software executed VMXOFF."), 86 EXIT_REASON(VMX_EXIT_VMXON , 27, "Guest software executed VMXON."), 87 EXIT_REASON(VMX_EXIT_CRX_MOVE , 28, "Control-register accesses."), 88 EXIT_REASON(VMX_EXIT_DRX_MOVE , 29, "Debug-register accesses."), 89 EXIT_REASON(VMX_EXIT_PORT_IO , 30, "I/O instruction."), 90 EXIT_REASON(VMX_EXIT_RDMSR , 31, "RDMSR. Guest software attempted to execute RDMSR."), 91 EXIT_REASON(VMX_EXIT_WRMSR , 32, "WRMSR. Guest software attempted to execute WRMSR."), 92 EXIT_REASON(VMX_EXIT_ERR_INVALID_GUEST_STATE, 33, "VM-entry failure due to invalid guest state."), 93 EXIT_REASON(VMX_EXIT_ERR_MSR_LOAD , 34, "VM-entry failure due to MSR loading."), 94 EXIT_REASON_NIL(), 95 EXIT_REASON(VMX_EXIT_MWAIT , 36, "Guest software executed MWAIT."), 96 EXIT_REASON_NIL(), 97 EXIT_REASON_NIL(), 98 EXIT_REASON(VMX_EXIT_MONITOR , 39, "Guest software attempted to execute MONITOR."), 99 EXIT_REASON(VMX_EXIT_PAUSE , 40, "Guest software attempted to execute PAUSE."), 100 EXIT_REASON(VMX_EXIT_ERR_MACHINE_CHECK , 41, "VM-entry failure due to machine-check."), 101 EXIT_REASON_NIL(), 102 EXIT_REASON(VMX_EXIT_TPR , 43, "TPR below threshold. Guest software executed MOV to CR8."), 103 EXIT_REASON(VMX_EXIT_APIC_ACCESS , 44, "APIC access. Guest software attempted to access memory at a physical address on the APIC-access page."), 104 EXIT_REASON_NIL(), 105 EXIT_REASON(VMX_EXIT_XDTR_ACCESS , 46, "Access to GDTR or IDTR. Guest software attempted to execute LGDT, LIDT, SGDT, or SIDT."), 106 EXIT_REASON(VMX_EXIT_TR_ACCESS , 47, "Access to LDTR or TR. Guest software attempted to execute LLDT, LTR, SLDT, or STR."), 107 EXIT_REASON(VMX_EXIT_EPT_VIOLATION , 48, "EPT violation. An attempt to access memory with a guest-physical address was disallowed by the configuration of the EPT paging structures."), 108 EXIT_REASON(VMX_EXIT_EPT_MISCONFIG , 49, "EPT misconfiguration. An attempt to access memory with a guest-physical address encountered a misconfigured EPT paging-structure entry."), 109 EXIT_REASON(VMX_EXIT_INVEPT , 50, "INVEPT. Guest software attempted to execute INVEPT."), 110 EXIT_REASON_NIL(), 111 EXIT_REASON(VMX_EXIT_PREEMPTION_TIMER , 52, "VMX-preemption timer expired. The preemption timer counted down to zero."), 112 EXIT_REASON(VMX_EXIT_INVVPID , 53, "INVVPID. Guest software attempted to execute INVVPID."), 113 EXIT_REASON(VMX_EXIT_WBINVD , 54, "WBINVD. Guest software attempted to execute WBINVD."), 114 EXIT_REASON(VMX_EXIT_XSETBV , 55, "XSETBV. Guest software attempted to execute XSETBV."), 115 EXIT_REASON_NIL() 116 }; 117 /** Exit reason descriptions for AMD-V, used to describe statistics. */ 118 static const char * const g_apszAmdVExitReasons[MAX_EXITREASON_STAT] = 119 { 120 /** @todo fill in these. */ 121 EXIT_REASON_NIL() 122 }; 123 # undef EXIT_REASON 124 # undef EXIT_REASON_NIL 125 #endif /* VBOX_WITH_STATISTICS */ 49 126 50 127 /******************************************************************************* … … 243 320 if (RT_SUCCESS(rc)) 244 321 { 322 const char * const *papszDesc = ASMIsIntelCpu() ? &g_apszVTxExitReasons[0] : &g_apszAmdVExitReasons[0]; 245 323 for (int j=0;j<MAX_EXITREASON_STAT;j++) 246 324 { 247 rc = STAMR3RegisterF(pVM, &pVCpu->hwaccm.s.paStatExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "Exit reason", 248 "/HWACCM/CPU%d/Exit/Reason/%02x", i, j); 325 rc = STAMR3RegisterF(pVM, &pVCpu->hwaccm.s.paStatExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 326 papszDesc[j] ? papszDesc[j] : "Exit reason", 327 "/HWACCM/CPU%d/Exit/Reason/%02x", i, j); 249 328 AssertRC(rc); 250 329 } 251 rc = STAMR3RegisterF(pVM, &pVCpu->hwaccm.s.StatExitReasonNPF, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, " Exit reason", "/HWACCM/CPU%d/Exit/Reason/#NPF", i);330 rc = STAMR3RegisterF(pVM, &pVCpu->hwaccm.s.StatExitReasonNPF, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, "Nested page fault", "/HWACCM/CPU%d/Exit/Reason/#NPF", i); 252 331 AssertRC(rc); 253 332 }
Note:
See TracChangeset
for help on using the changeset viewer.