Changeset 15866 in vbox
- Timestamp:
- Jan 8, 2009 1:54:40 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/HWACCM.cpp
r15860 r15866 282 282 AssertRC(rc); 283 283 284 # define HWACCM_REG_COUNTER(a, b) \285 rc = STAMR3RegisterF(pVM, a, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Profiling of vmlaunch", b, i); \286 AssertRC(rc);287 288 284 # if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) 289 285 rc = STAMR3RegisterF(pVM, &pVCpu->hwaccm.s.StatWorldSwitch3264, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of the 32/64 switcher", 290 286 "/PROF/HWACCM/CPU%d/Switcher3264", i); 291 287 AssertRC(rc); 292 HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatTimeoutResume, "/HWACCM/CPU%d/Timeout/Resume");293 HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatTimeoutSwitcher3264, "/HWACCM/CPU%d/Timeout/Switch3264");294 288 # endif 289 290 # define HWACCM_REG_COUNTER(a, b) \ 291 rc = STAMR3RegisterF(pVM, a, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Profiling of vmlaunch", b, i); \ 292 AssertRC(rc); 295 293 296 294 HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatExitShadowNM, "/HWACCM/CPU%d/Exit/Trap/Shw/#NM"); -
trunk/src/VBox/VMM/HWACCMInternal.h
r15858 r15866 440 440 typedef struct HWACCMCPU 441 441 { 442 /** Time of entry into the ring 0 world switcher code. */443 uint64_t u64TimeEntry;444 445 442 /** Old style FPU reporting trap mask override performed (optimization) */ 446 443 bool fFPUOldStyleOverride; … … 616 613 STAMCOUNTER StatDRxIOCheck; 617 614 618 STAMCOUNTER StatTimeoutSwitcher3264;619 STAMCOUNTER StatTimeoutResume;620 615 621 616 R3PTRTYPE(PSTAMCOUNTER) paStatExitReason; -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r15858 r15866 39 39 #include <iprt/asm.h> 40 40 #include <iprt/string.h> 41 #include <iprt/time.h>42 41 #include "HWVMXR0.h" 43 42 … … 1894 1893 RTGCUINTPTR errCode, instrInfo; 1895 1894 bool fSyncTPR = false; 1896 bool fPreemptPending = false;1897 1895 PHWACCM_CPUINFO pCpu = 0; 1898 1896 unsigned cResume = 0; … … 1968 1966 } 1969 1967 #endif 1970 1971 /* Fetch the current time so we can bail out when necessary. */1972 pVCpu->hwaccm.s.u64TimeEntry = RTTimeNanoTS();1973 1968 1974 1969 /* We can jump to this point to resume execution after determining that a VM-exit is innocent. … … 1985 1980 1986 1981 /* Safety precaution; looping for too long here can have a very bad effect on the host */ 1987 if ( ++cResume > HWACCM_MAX_RESUME_LOOPS 1988 || RTTimeNanoTS() - pVCpu->hwaccm.s.u64TimeEntry >= 2000000) 1989 { 1990 LogFlow(("delta %VX64\n", RTTimeNanoTS() - pVCpu->hwaccm.s.u64TimeEntry)); 1991 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatTimeoutResume); 1982 if (++cResume > HWACCM_MAX_RESUME_LOOPS) 1983 { 1992 1984 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitMaxResume); 1993 1985 rc = VINF_EM_RAW_INTERRUPT; … … 2165 2157 STAM_PROFILE_ADV_START(&pVCpu->hwaccm.s.StatExit1, v); 2166 2158 2167 if ( VBOX_FAILURE(rc))2159 if (rc != VINF_SUCCESS) 2168 2160 { 2169 2161 VMXR0ReportWorldSwitchError(pVM, pVCpu, rc, pCtx); 2170 2162 goto end; 2171 2163 } 2172 if (rc == VINF_VMX_PREEMPT_PENDING)2173 fPreemptPending = true;2174 2164 2175 2165 /* Success. Query the guest state and figure out what has happened. */ … … 2247 2237 { 2248 2238 rc = PDMApicSetTPR(pVM, pVM->hwaccm.s.vmx.pAPIC[0x80] >> 4); 2249 AssertRC(rc);2250 }2251 2252 if (fPreemptPending)2253 {2254 fPreemptPending = false;2255 rc = VMMR0CallHost(pVM, VMMCALLHOST_VM_R0_PREEMPT, 0);2256 2239 AssertRC(rc); 2257 2240 } … … 3608 3591 Assert(!(pCache->TestOut.eflags & X86_EFL_IF)); 3609 3592 #endif 3610 3611 /* Check if we've been running too long. */3612 if ( rc == VINF_SUCCESS3613 && RTTimeNanoTS() - pVCpu->hwaccm.s.u64TimeEntry >= 2000000)3614 {3615 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatTimeoutSwitcher3264);3616 LogFlow(("delta (2) %VX64\n", RTTimeNanoTS() - pVCpu->hwaccm.s.u64TimeEntry));3617 return VINF_VMX_PREEMPT_PENDING;3618 }3619 3593 return rc; 3620 3594 }
Note:
See TracChangeset
for help on using the changeset viewer.