VirtualBox

Changeset 15866 in vbox


Ignore:
Timestamp:
Jan 8, 2009 1:54:40 PM (16 years ago)
Author:
vboxsync
Message:

Backed out previous experiments.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/HWACCM.cpp

    r15860 r15866  
    282282        AssertRC(rc);
    283283
    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 
    288284# if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
    289285        rc = STAMR3RegisterF(pVM, &pVCpu->hwaccm.s.StatWorldSwitch3264, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_TICKS_PER_CALL, "Profiling of the 32/64 switcher",
    290286                             "/PROF/HWACCM/CPU%d/Switcher3264", i);
    291287        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");
    294288# 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);
    295293
    296294        HWACCM_REG_COUNTER(&pVCpu->hwaccm.s.StatExitShadowNM,           "/HWACCM/CPU%d/Exit/Trap/Shw/#NM");
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r15858 r15866  
    440440typedef struct HWACCMCPU
    441441{
    442     /** Time of entry into the ring 0 world switcher code. */
    443     uint64_t                    u64TimeEntry;
    444 
    445442    /** Old style FPU reporting trap mask override performed (optimization) */
    446443    bool                        fFPUOldStyleOverride;
     
    616613    STAMCOUNTER             StatDRxIOCheck;
    617614
    618     STAMCOUNTER             StatTimeoutSwitcher3264;
    619     STAMCOUNTER             StatTimeoutResume;
    620615
    621616    R3PTRTYPE(PSTAMCOUNTER) paStatExitReason;
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r15858 r15866  
    3939#include <iprt/asm.h>
    4040#include <iprt/string.h>
    41 #include <iprt/time.h>
    4241#include "HWVMXR0.h"
    4342
     
    18941893    RTGCUINTPTR errCode, instrInfo;
    18951894    bool        fSyncTPR = false;
    1896     bool        fPreemptPending = false;
    18971895    PHWACCM_CPUINFO pCpu = 0;
    18981896    unsigned    cResume = 0;
     
    19681966    }
    19691967#endif
    1970 
    1971     /* Fetch the current time so we can bail out when necessary. */
    1972     pVCpu->hwaccm.s.u64TimeEntry = RTTimeNanoTS();
    19731968
    19741969    /* We can jump to this point to resume execution after determining that a VM-exit is innocent.
     
    19851980
    19861981    /* 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    {
    19921984        STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitMaxResume);
    19931985        rc = VINF_EM_RAW_INTERRUPT;
     
    21652157    STAM_PROFILE_ADV_START(&pVCpu->hwaccm.s.StatExit1, v);
    21662158
    2167     if (VBOX_FAILURE(rc))
     2159    if (rc != VINF_SUCCESS)
    21682160    {
    21692161        VMXR0ReportWorldSwitchError(pVM, pVCpu, rc, pCtx);
    21702162        goto end;
    21712163    }
    2172     if (rc == VINF_VMX_PREEMPT_PENDING)
    2173         fPreemptPending = true;
    21742164
    21752165    /* Success. Query the guest state and figure out what has happened. */
     
    22472237    {
    22482238        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);
    22562239        AssertRC(rc);
    22572240    }
     
    36083591    Assert(!(pCache->TestOut.eflags & X86_EFL_IF));
    36093592#endif
    3610 
    3611     /* Check if we've been running too long. */
    3612     if (    rc == VINF_SUCCESS
    3613         &&  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     }
    36193593    return rc;
    36203594}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette