VirtualBox

Changeset 75004 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Oct 23, 2018 2:43:06 PM (6 years ago)
Author:
vboxsync
Message:

VMM: Register ring-3 probes after initialization of SUPLib to avoid asserting when SUPR3Init failed during RTR3Init(). ticketref:18048

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r74786 r75004  
    117117
    118118/**
    119  * Do global VMM init.
    120  *
    121  * @returns VBox status code.
    122  */
    123 VMMR3DECL(int)   VMR3GlobalInit(void)
    124 {
    125     /*
    126      * Only once.
    127      */
    128     static bool volatile s_fDone = false;
    129     if (s_fDone)
    130         return VINF_SUCCESS;
    131 
    132 #if defined(VBOX_WITH_DTRACE_R3) && !defined(VBOX_WITH_NATIVE_DTRACE)
    133     SUPR3TracerRegisterModule(~(uintptr_t)0, "VBoxVMM", &g_VTGObjHeader, (uintptr_t)&g_VTGObjHeader,
    134                               SUP_TRACER_UMOD_FLAGS_SHARED);
    135 #endif
    136 
    137     /*
    138      * We're done.
    139      */
    140     s_fDone = true;
    141     return VINF_SUCCESS;
    142 }
    143 
    144 
    145 /**
    146119 * Creates a virtual machine by calling the supplied configuration constructor.
    147120 *
     
    201174
    202175    /*
    203      * Because of the current hackiness of the applications
    204      * we'll have to initialize global stuff from here.
    205      * Later the applications will take care of this in a proper way.
    206      */
    207     static bool fGlobalInitDone = false;
    208     if (!fGlobalInitDone)
    209     {
    210         int rc = VMR3GlobalInit();
    211         if (RT_FAILURE(rc))
    212             return rc;
    213         fGlobalInitDone = true;
    214     }
    215 
    216     /*
    217176     * Validate input.
    218177     */
     
    237196        if (RT_SUCCESS(rc))
    238197        {
     198#if defined(VBOX_WITH_DTRACE_R3) && !defined(VBOX_WITH_NATIVE_DTRACE)
     199            /* Now that we've opened the device, we can register trace probes. */
     200            static bool s_fRegisteredProbes = false;
     201            if (ASMAtomicCmpXchgBool(&s_fRegisteredProbes, true, false))
     202                SUPR3TracerRegisterModule(~(uintptr_t)0, "VBoxVMM", &g_VTGObjHeader, (uintptr_t)&g_VTGObjHeader,
     203                                          SUP_TRACER_UMOD_FLAGS_SHARED);
     204#endif
     205
    239206            /*
    240207             * Call vmR3CreateU in the EMT thread and wait for it to finish.
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