VirtualBox

Ignore:
Timestamp:
Jun 5, 2009 12:20:10 PM (16 years ago)
Author:
vboxsync
Message:

Experiment with TPR patching (disabled)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r20222 r20317  
    4040#include <iprt/param.h>
    4141#include <iprt/string.h>
     42#include <iprt/time.h>
    4243#ifdef VBOX_WITH_VMMR0_DISABLE_PREEMPTION
    4344# include <iprt/thread.h>
     
    20092010    unsigned    cResume = 0;
    20102011#ifdef VBOX_STRICT
    2011     RTCPUID  idCpuCheck;
     2012    RTCPUID     idCpuCheck;
     2013#endif
     2014#ifdef VBOX_HIGH_RES_TIMERS_HACK_IN_RING0
     2015    uint64_t    u64LastTime = RTTimeMilliTS();
    20122016#endif
    20132017#ifdef VBOX_WITH_STATISTICS
     
    21392143    }
    21402144
     2145#ifdef VBOX_HIGH_RES_TIMERS_HACK_IN_RING0
     2146    if (RT_UNLIKELY(cResume & 0xf) == 0)
     2147    {
     2148        uint64_t u64CurTime = RTTimeMilliTS();
     2149
     2150        if (RT_UNLIKELY(u64CurTime > u64LastTime))
     2151        {
     2152            u64LastTime = u64CurTime;
     2153            TMTimerPollVoid(pVM, pVCpu);
     2154        }
     2155    }
     2156#endif
     2157
    21412158    /* Check for pending actions that force us to go back to ring 3. */
    2142     if (    VM_FF_ISPENDING(pVM, VM_FF_HWACCM_TO_R3_MASK)
    2143         ||  VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HWACCM_TO_R3_MASK))
    2144     {
    2145         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TO_R3);
    2146         STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatSwitchToR3);
    2147         rc = RT_UNLIKELY(VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_NO_MEMORY : VINF_EM_RAW_TO_R3;
    2148         goto end;
    2149     }
     2159#ifdef DEBUG
     2160    /* Intercept X86_XCPT_DB if stepping is enabled */
     2161    if (!DBGFIsStepping(pVCpu))
     2162#endif
     2163    {
     2164        if (    VM_FF_ISPENDING(pVM, VM_FF_HWACCM_TO_R3_MASK)
     2165            ||  VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HWACCM_TO_R3_MASK))
     2166        {
     2167            VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TO_R3);
     2168            STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatSwitchToR3);
     2169            rc = RT_UNLIKELY(VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_NO_MEMORY : VINF_EM_RAW_TO_R3;
     2170            goto end;
     2171        }
     2172    }
     2173
    21502174    /* Pending request packets might contain actions that need immediate attention, such as pending hardware interrupts. */
    21512175    if (    VM_FF_ISPENDING(pVM, VM_FF_REQUEST)
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