Changeset 71344 in vbox
- Timestamp:
- Mar 15, 2018 9:15:57 AM (7 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
-
VMMR0/HMSVMR0.cpp (modified) (3 diffs)
-
VMMR3/HM.cpp (modified) (2 diffs)
-
include/HMInternal.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r71313 r71344 58 58 STAM_COUNTER_INC(&pVCpu->hm.s.paStatExitReasonR0[(u64ExitCode) & MASK_EXITREASON_STAT]); \ 59 59 } while (0) 60 61 # ifdef VBOX_WITH_NESTED_HWVIRT 62 # define HMSVM_NESTED_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { \ 63 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitAll); \ 64 if ((u64ExitCode) == SVM_EXIT_NPF) \ 65 STAM_COUNTER_INC(&pVCpu->hm.s.StatNestedExitReasonNpf); \ 66 else \ 67 STAM_COUNTER_INC(&pVCpu->hm.s.paStatNestedExitReasonR0[(u64ExitCode) & MASK_EXITREASON_STAT]); \ 68 } while (0) 69 # endif 60 70 #else 61 # define HMSVM_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { } while (0) 62 #endif 71 # define HMSVM_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { } while (0) 72 # ifdef VBOX_WITH_NESTED_HWVIRT 73 # define HMSVM_NESTED_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { } while (0) 74 # endif 75 #endif /* !VBOX_WITH_STATISTICS */ 76 63 77 64 78 /** If we decide to use a function table approach this can be useful to … … 2538 2552 * Guest Virtual GIF (Global Interrupt Flag). 2539 2553 */ 2540 if ( pVmcb->ctrl.IntCtrl.n.u1VGifEnable == 1 2541 && !CPUMIsGuestInSvmNestedHwVirtMode(pMixedCtx)) 2554 if (pVmcb->ctrl.IntCtrl.n.u1VGifEnable == 1) 2542 2555 { 2543 2556 Assert(pVCpu->CTX_SUFF(pVM)->hm.s.svm.fVGif); 2557 Assert(!CPUMIsGuestInSvmNestedHwVirtMode(pMixedCtx)); 2544 2558 pMixedCtx->hwvirt.fGif = pVmcb->ctrl.IntCtrl.n.u1VGif; 2545 2559 } … … 4879 4893 4880 4894 /* Handle the #VMEXIT. */ 4881 HMSVM_ EXITCODE_STAM_COUNTER_INC(SvmTransient.u64ExitCode);4895 HMSVM_NESTED_EXITCODE_STAM_COUNTER_INC(SvmTransient.u64ExitCode); 4882 4896 STAM_PROFILE_ADV_STOP_START(&pVCpu->hm.s.StatExit1, &pVCpu->hm.s.StatExit2, x); 4883 4897 VBOXVMM_R0_HMSVM_VMEXIT(pVCpu, pCtx, SvmTransient.u64ExitCode, pCtx->hwvirt.svm.CTX_SUFF(pVmcb)); -
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); -
trunk/src/VBox/VMM/include/HMInternal.h
r71108 r71344 1095 1095 STAMCOUNTER StatVmxCheckPmOk; 1096 1096 1097 STAMCOUNTER StatNestedExitReasonNpf; 1098 1097 1099 #if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) 1098 1100 STAMCOUNTER StatFpu64SwitchBack; … … 1105 1107 R3PTRTYPE(PSTAMCOUNTER) paStatInjectedIrqs; 1106 1108 R0PTRTYPE(PSTAMCOUNTER) paStatInjectedIrqsR0; 1109 R3PTRTYPE(PSTAMCOUNTER) paStatNestedExitReason; 1110 R0PTRTYPE(PSTAMCOUNTER) paStatNestedExitReasonR0; 1107 1111 #endif 1108 1112 #ifdef HM_PROFILE_EXIT_DISPATCH
Note:
See TracChangeset
for help on using the changeset viewer.

