Changeset 71344 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Mar 15, 2018 9:15:57 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121295
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/HM.cpp
r71108 r71344 1043 1043 #undef HM_REG_COUNTER 1044 1044 1045 const char *const *papszDesc = ASMIsIntelCpu() || ASMIsViaCentaurCpu() ? &g_apszVTxExitReasons[0] 1046 : &g_apszAmdVExitReasons[0]; 1047 1048 /* 1049 * Guest Exit reason stats. 1050 */ 1045 1051 pVCpu->hm.s.paStatExitReason = NULL; 1046 1047 1052 rc = MMHyperAlloc(pVM, MAX_EXITREASON_STAT * sizeof(*pVCpu->hm.s.paStatExitReason), 0 /* uAlignment */, MM_TAG_HM, 1048 1053 (void **)&pVCpu->hm.s.paStatExitReason); 1049 AssertRC(rc); 1050 if (RT_SUCCESS(rc)) 1051 { 1052 const char *const *papszDesc = ASMIsIntelCpu() || ASMIsViaCentaurCpu() ? 1053 &g_apszVTxExitReasons[0] : &g_apszAmdVExitReasons[0]; 1054 for (int j = 0; j < MAX_EXITREASON_STAT; j++) 1054 AssertRCReturn(rc, rc); 1055 for (int j = 0; j < MAX_EXITREASON_STAT; j++) 1056 { 1057 if (papszDesc[j]) 1055 1058 { 1056 if (papszDesc[j]) 1057 { 1058 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, 1059 STAMUNIT_OCCURENCES, papszDesc[j], "/HM/CPU%d/Exit/Reason/%02x", i, j); 1060 AssertRC(rc); 1061 } 1059 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, 1060 STAMUNIT_OCCURENCES, papszDesc[j], "/HM/CPU%d/Exit/Reason/%02x", i, j); 1061 AssertRCReturn(rc, rc); 1062 1062 } 1063 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitReasonNpf, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,1064 "Nested page fault", "/HM/CPU%d/Exit/Reason/#NPF", i);1065 AssertRC(rc);1066 }1063 } 1064 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatExitReasonNpf, STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1065 "Nested page fault", "/HM/CPU%d/Exit/Reason/#NPF", i); 1066 AssertRCReturn(rc, rc); 1067 1067 pVCpu->hm.s.paStatExitReasonR0 = MMHyperR3ToR0(pVM, pVCpu->hm.s.paStatExitReason); 1068 1068 # ifdef VBOX_WITH_2X_4GB_ADDR_SPACE … … 1072 1072 # endif 1073 1073 1074 #ifdef VBOX_WITH_NESTED_HWVIRT 1075 /* 1076 * Nested-guest Exit reason stats. 1077 */ 1078 pVCpu->hm.s.paStatNestedExitReason = NULL; 1079 rc = MMHyperAlloc(pVM, MAX_EXITREASON_STAT * sizeof(*pVCpu->hm.s.paStatNestedExitReason), 0 /* uAlignment */, MM_TAG_HM, 1080 (void **)&pVCpu->hm.s.paStatNestedExitReason); 1081 AssertRCReturn(rc, rc); 1082 for (int j = 0; j < MAX_EXITREASON_STAT; j++) 1083 { 1084 if (papszDesc[j]) 1085 { 1086 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatNestedExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED, 1087 STAMUNIT_OCCURENCES, papszDesc[j], "/HM/CPU%d/NestedExit/Reason/%02x", i, j); 1088 AssertRC(rc); 1089 } 1090 } 1091 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatNestedExitReasonNpf, STAMTYPE_COUNTER, STAMVISIBILITY_USED, 1092 STAMUNIT_OCCURENCES, "Nested page fault", "/HM/CPU%d/NestedExit/Reason/#NPF", i); 1093 AssertRCReturn(rc, rc); 1094 pVCpu->hm.s.paStatNestedExitReasonR0 = MMHyperR3ToR0(pVM, pVCpu->hm.s.paStatNestedExitReason); 1095 # ifdef VBOX_WITH_2X_4GB_ADDR_SPACE 1096 Assert(pVCpu->hm.s.paStatNestedExitReasonR0 != NIL_RTR0PTR || !HMIsEnabled(pVM)); 1097 # else 1098 Assert(pVCpu->hm.s.paStatNestedExitReasonR0 != NIL_RTR0PTR); 1099 # endif 1100 #endif 1101 1102 /* 1103 * Injected events stats. 1104 */ 1074 1105 rc = MMHyperAlloc(pVM, sizeof(STAMCOUNTER) * 256, 8, MM_TAG_HM, (void **)&pVCpu->hm.s.paStatInjectedIrqs); 1075 1106 AssertRCReturn(rc, rc);
Note:
See TracChangeset
for help on using the changeset viewer.