VirtualBox

Changeset 58938 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Dec 1, 2015 2:17:45 PM (9 years ago)
Author:
vboxsync
Message:

HM,DBGF: Made DBGF notify HM about changes to VMM event and interrupt breakpoints. Made HM cache the basic info wrt ring-0 loop selection, opting for using a debug loop when debugging takes place to avoid cluttering slowing down the normal execution loop. The plan is to extend the single stepping loop and to put complicated dtrace probes into the same loop. Modified the VMX loop selection already.

File:
1 edited

Legend:

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

    r58918 r58938  
    88558855 * @note    Mostly the same as hmR0VmxRunGuestCodeNormal().
    88568856 */
    8857 static VBOXSTRICTRC hmR0VmxRunGuestCodeStep(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
     8857static VBOXSTRICTRC hmR0VmxRunGuestCodeDebug(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
    88588858{
    88598859    VMXTRANSIENT VmxTransient;
     
    89598959
    89608960/**
     8961 * Checks if any expensive dtrace probes are enabled and we should go to the
     8962 * debug loop.
     8963 *
     8964 * @returns true if we should use debug loop, false if not.
     8965 */
     8966static bool hmR0VmxAnyExpensiveProbesEnabled(void)
     8967{
     8968    /* It's probably faster to OR the raw 32-bit counter variables together.
     8969       Since the variables are in an array and the probes are next to one
     8970       another (more or less), we have good locality. So, better read two three
     8971       cache lines ever time and only have one conditional, than 20+ conditionals. */
     8972    return (  VBOXVMM_XCPT_DE_ENABLED_RAW()
     8973            | VBOXVMM_XCPT_DB_ENABLED_RAW()
     8974            | VBOXVMM_XCPT_BP_ENABLED_RAW()
     8975            | VBOXVMM_XCPT_OF_ENABLED_RAW()
     8976            | VBOXVMM_XCPT_BR_ENABLED_RAW()
     8977            | VBOXVMM_XCPT_UD_ENABLED_RAW()
     8978            | VBOXVMM_XCPT_NM_ENABLED_RAW()
     8979            | VBOXVMM_XCPT_DF_ENABLED_RAW()
     8980            | VBOXVMM_XCPT_TS_ENABLED_RAW()
     8981            | VBOXVMM_XCPT_NP_ENABLED_RAW()
     8982            | VBOXVMM_XCPT_SS_ENABLED_RAW()
     8983            | VBOXVMM_XCPT_GP_ENABLED_RAW()
     8984            | VBOXVMM_XCPT_PG_ENABLED_RAW()
     8985            | VBOXVMM_XCPT_MF_ENABLED_RAW()
     8986            | VBOXVMM_XCPT_AC_ENABLED_RAW()
     8987            | VBOXVMM_XCPT_XF_ENABLED_RAW()
     8988            | VBOXVMM_XCPT_VE_ENABLED_RAW()
     8989            | VBOXVMM_XCPT_SX_ENABLED_RAW()
     8990            | VBOXVMM_INT_SOFTWARE_ENABLED_RAW()
     8991            | VBOXVMM_INT_HARDWARE_ENABLED_RAW()
     8992           ) != 0;
     8993}
     8994
     8995
     8996/**
    89618997 * Runs the guest code using VT-x.
    89628998 *
     
    89759011
    89769012    VBOXSTRICTRC rcStrict;
    8977     if (!pVCpu->hm.s.fSingleInstruction)
     9013    if (   !pVCpu->hm.s.fUseDebugLoop
     9014        && (!VBOXVMM_ANY_PROBES_ENABLED() || !hmR0VmxAnyExpensiveProbesEnabled()) )
    89789015        rcStrict = hmR0VmxRunGuestCodeNormal(pVM, pVCpu, pCtx);
    89799016    else
    8980         rcStrict = hmR0VmxRunGuestCodeStep(pVM, pVCpu, pCtx);
     9017        rcStrict = hmR0VmxRunGuestCodeDebug(pVM, pVCpu, pCtx);
    89819018
    89829019    if (rcStrict == VERR_EM_INTERPRETER)
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