VirtualBox

Changeset 61634 in vbox


Ignore:
Timestamp:
Jun 9, 2016 6:23:17 PM (9 years ago)
Author:
vboxsync
Message:

Fixed DBGFR3_INFO_LOG to only run on the current EMT as we'll easily deadlock if we involv other EMT like for cpumguest.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/dbgf.h

    r61628 r61634  
    967967 * Display a piece of info writing to the log if enabled.
    968968 *
     969 * This is for execution on EMTs and will only show the items on the calling
     970 * EMT.  This is to avoid deadlocking against other CPUs if a rendezvous is
     971 * initiated in parallel to this call.  (Besides, nobody really wants or need
     972 * info for the other EMTs when using this macro.)
     973 *
     974 * @param   a_pVM       The shared VM handle.
     975 * @param   a_pVCpu     The cross context per CPU structure of the calling EMT.
     976 * @param   a_pszName   The identifier of the info to display.
     977 * @param   a_pszArgs   Arguments to the info handler.
     978 */
     979#ifdef LOG_ENABLED
     980# define DBGFR3_INFO_LOG(a_pVM, a_pVCpu, a_pszName, a_pszArgs) \
     981    do { \
     982        if (LogIsEnabled()) \
     983            DBGFR3InfoEx((a_pVM)->pUVM, (a_pVCpu)->idCpu, a_pszName, a_pszArgs, NULL); \
     984    } while (0)
     985#else
     986# define DBGFR3_INFO_LOG(a_pVM, a_pVCpu, a_pszName, a_pszArgs) do { } while (0)
     987#endif
     988
     989/** @def DBGFR3_INFO_LOG_SAFE
     990 * Display a piece of info (rendezvous safe) writing to the log if enabled.
     991 *
    969992 * @param   a_pVM       The shared VM handle.
    970993 * @param   a_pszName   The identifier of the info to display.
    971994 * @param   a_pszArgs   Arguments to the info handler.
     995 *
     996 * @remarks Use DBGFR3_INFO_LOG where ever possible!
    972997 */
    973998#ifdef LOG_ENABLED
    974 # define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) \
     999# define DBGFR3_INFO_LOG_SAFE(a_pVM, a_pszName, a_pszArgs) \
    9751000    do { \
    9761001        if (LogIsEnabled()) \
     
    9781003    } while (0)
    9791004#else
    980 # define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) do { } while (0)
     1005# define DBGFR3_INFO_LOG_SAFE(a_pVM, a_pszName, a_pszArgs) do { } while (0)
    9811006#endif
    9821007
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r61570 r61634  
    25652565    DBGFR3Info(pVM->pUVM, "cpuid", "verbose", DBGFR3InfoLogRelHlp());
    25662566    LogRel(("\n"));
    2567     DBGFR3_INFO_LOG(pVM, "cpuid", "verbose"); /* macro */
     2567    DBGFR3_INFO_LOG_SAFE(pVM, "cpuid", "verbose"); /* macro */
    25682568    RTLogRelSetBuffering(fOldBuffered);
    25692569    LogRel(("******************** End of CPUID dump **********************\n"));
  • trunk/src/VBox/VMM/VMMR3/EMHM.cpp

    r58998 r61634  
    185185    if (pszPrefix)
    186186    {
    187         DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix);
     187        DBGFR3_INFO_LOG(pVM, pVCpu, "cpumguest", pszPrefix);
    188188        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix);
    189189    }
  • trunk/src/VBox/VMM/VMMR3/EMRaw.cpp

    r60900 r61634  
    281281    if (pszPrefix)
    282282    {
    283         DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix);
     283        DBGFR3_INFO_LOG(pVM, pVCpu, "cpumguest", pszPrefix);
    284284        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix);
    285285    }
     
    580580
    581581#ifdef LOG_ENABLED
    582     DBGFR3_INFO_LOG(pVM, "cpumguest", "Guest trap");
     582    DBGFR3_INFO_LOG(pVM, pVCpu, "cpumguest", "Guest trap");
    583583    DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Guest trap");
    584584
     
    716716    {
    717717#ifdef LOG_ENABLED
    718         DBGFR3_INFO_LOG(pVM, "cpumguest", "Trap in patch code");
     718        DBGFR3_INFO_LOG(pVM, pVCpu, "cpumguest", "Trap in patch code");
    719719        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patch code");
    720720
     
    870870        {
    871871#ifdef LOG_ENABLED
    872             DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
     872            DBGFR3_INFO_LOG(pVM, pVCpu, "cpumguest", "PRIV");
    873873#endif
    874874            AssertMsgFailed(("FATAL ERROR: executing random instruction inside generated patch jump %08x\n", pCtx->eip));
     
    884884            {
    885885#ifdef LOG_ENABLED
    886                 DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
     886                DBGFR3_INFO_LOG(pVM, pVCpu, "cpumguest", "PRIV");
    887887#endif
    888888                DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patched privileged instruction");
     
    895895    if (!PATMIsPatchGCAddr(pVM, pCtx->eip))
    896896    {
    897         DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
     897        DBGFR3_INFO_LOG(pVM, pVCpu, "cpumguest", "PRIV");
    898898        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr");
    899899    }
     
    10351035                    if (PATMIsPatchGCAddr(pVM, pCtx->eip))
    10361036                    {
    1037                         DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
     1037                        DBGFR3_INFO_LOG(pVM, pVCpu, "cpumguest", "PRIV");
    10381038                        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr");
    10391039                    }
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r61570 r61634  
    26032603
    26042604#ifdef DEBUG
    2605     DBGFR3_INFO_LOG(pVM, "mappings", NULL);
    2606     DBGFR3_INFO_LOG(pVM, "handlers", "all nostat");
     2605    DBGFR3_INFO_LOG_SAFE(pVM, "mappings", NULL);
     2606    DBGFR3_INFO_LOG_SAFE(pVM, "handlers", "all nostat");
    26072607#endif
    26082608
  • trunk/src/VBox/VMM/VMMR3/TRPM.cpp

    r60884 r61634  
    15051505
    15061506# ifdef LOG_ENABLED
    1507         DBGFR3_INFO_LOG(pVM, "cpumguest", "TRPMInject");
     1507        DBGFR3_INFO_LOG(pVM, pVCpu, "cpumguest", "TRPMInject");
    15081508        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "TRPMInject");
    15091509# endif
  • trunk/src/recompiler/VBoxRecompiler.c

    r60804 r61634  
    40814081     */
    40824082    if (fLog2)
    4083         DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix);
     4083        DBGFR3_INFO_LOG(pVM, env->pVCpu, "cpumguest", pszPrefix);
    40844084
    40854085    /*
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