Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

VMMR0DECL ( int   ) 

Lazily sync in the FPU/XMM state

Returns:
VBox status code.
Parameters:
pVM VM handle.
pVCpu VMCPU handle.
pCtx CPU context
Does global Ring-0 HWACCM termination.

Returns:
VBox status code.
Initializes the dynamic mapping cache for a new VM.

Returns:
VBox status code.
Parameters:
pVM Pointer to the shared VM structure.
Initialize the module. This is called when we're first loaded.

Returns:
0 on success.

VBox status on failure.

Terminates the R0 driver for a particular VM instance.

This is normally called by ring-3 as part of the VM termination process, but may alternatively be called during the support driver session cleanup when the VM object is destroyed (see GVMM).

Returns:
VBox status code.
Parameters:
pVM The VM instance in question.
pGVM Pointer to the global VM structure. Optional. EMT or session clean up thread.
The Ring 0 entry point, called by the support library (SUP).

Returns:
VBox status code.
Parameters:
pVM The VM to operate on.
idCpu Virtual CPU ID argument. Must be NIL_VMCPUID if pVM is NIL_RTR0PTR, and may be NIL_VMCPUID if it isn't
enmOperation Which operation to execute.
pReq This points to a SUPVMMR0REQHDR packet. Optional.
u64Arg Some simple constant argument.
pSession The session of the caller.
Remarks:
Assume called with interrupts _enabled_.

Definition at line 468 of file HWACCMR0.cpp.

{
    int rc;
    if (   HWACCMR0Globals.vmx.fSupported
        && HWACCMR0Globals.vmx.fUsingSUPR0EnableVTx)
    {
        Assert(HWACCMR0Globals.fGlobalInit);
        rc = SUPR0EnableVTx(false /* fEnable */);
        for (unsigned iCpu = 0; iCpu < RT_ELEMENTS(HWACCMR0Globals.aCpuInfo); iCpu++)
        {
            HWACCMR0Globals.aCpuInfo[iCpu].fConfigured = false;
            Assert(HWACCMR0Globals.aCpuInfo[iCpu].pMemObj == NIL_RTR0MEMOBJ);
        }
    }
    else
    {
        Assert(!HWACCMR0Globals.vmx.fUsingSUPR0EnableVTx);
        if (!HWACCMR0Globals.vmx.fUsingSUPR0EnableVTx)
        {
            rc = RTPowerNotificationDeregister(hwaccmR0PowerCallback, 0);
            AssertRC(rc);
        }
        else
            rc = VINF_SUCCESS;

        /* Only disable VT-x/AMD-V on all CPUs if we enabled it before. */
        if (HWACCMR0Globals.fGlobalInit)
        {
            int aRc[RTCPUSET_MAX_CPUS];

            memset(aRc, 0, sizeof(aRc));
            rc = RTMpOnAll(hwaccmR0DisableCpuCallback, aRc, NULL);
            Assert(RT_SUCCESS(rc) || rc == VERR_NOT_SUPPORTED);
#ifdef VBOX_STRICT
            for (unsigned i=0;i<RT_ELEMENTS(HWACCMR0Globals.aCpuInfo);i++)
                AssertMsgRC(aRc[i], ("hwaccmR0DisableCpuCallback failed for cpu %d with rc=%d\n", i, aRc[i]));
#endif
        }

        /* Free the per-cpu pages used for VT-x and AMD-V */
        for (unsigned i=0;i<RT_ELEMENTS(HWACCMR0Globals.aCpuInfo);i++)
        {
            if (HWACCMR0Globals.aCpuInfo[i].pMemObj != NIL_RTR0MEMOBJ)
            {
                RTR0MemObjFree(HWACCMR0Globals.aCpuInfo[i].pMemObj, false);
                HWACCMR0Globals.aCpuInfo[i].pMemObj = NIL_RTR0MEMOBJ;
            }
        }
    }
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index