VirtualBox

Changeset 15607 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Dec 16, 2008 8:59:43 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
41119
Message:

Moved code around

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/HWACCM.cpp

    r15605 r15607  
    963963        }
    964964    }
    965 
     965    return VINF_SUCCESS;
     966}
     967
     968/**
     969 * Applies relocations to data and code managed by this
     970 * component. This function will be called at init and
     971 * whenever the VMM need to relocate it self inside the GC.
     972 *
     973 * @param   pVM     The VM.
     974 */
     975VMMR3DECL(void) HWACCMR3Relocate(PVM pVM)
     976{
     977    Log(("HWACCMR3Relocate to %RGv\n", MMHyperGetArea(pVM, 0)));
     978
     979    /* Fetch the current paging mode during the relocate callback during state loading. */
     980    if (VMR3GetState(pVM) == VMSTATE_LOADING)
     981    {
     982        for (unsigned i=0;i<pVM->cCPUs;i++)
     983        {
     984            PVMCPU pVCpu = &pVM->aCpus[i];
     985            /* @todo SMP */
     986            pVCpu->hwaccm.s.enmShadowMode            = PGMGetShadowMode(pVM);
     987            pVCpu->hwaccm.s.vmx.enmLastSeenGuestMode = PGMGetGuestMode(pVM);
     988        }
     989    }
    966990#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
    967991    if (pVM->fHWACCMEnabled)
    968992    {
     993        int rc;
     994
    969995        switch(PGMGetHostMode(pVM))
    970996        {
     
    9821008            break;
    9831009        }
    984 
    9851010        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       "VMXGCStartVM64", &pVM->hwaccm.s.pfnVMXGCStartVM64);
    986         AssertMsgRCReturn(rc, ("VMXGCStartVM64 -> rc=%Rrc\n", rc), rc);
     1011        AssertReleaseMsgRC(rc, ("VMXGCStartVM64 -> rc=%Rrc\n", rc));
    9871012
    9881013        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       "SVMGCVMRun64",   &pVM->hwaccm.s.pfnSVMGCVMRun64);
    989         AssertMsgRCReturn(rc, ("SVMGCVMRun64 -> rc=%Rrc\n", rc), rc);
     1014        AssertReleaseMsgRC(rc, ("SVMGCVMRun64 -> rc=%Rrc\n", rc));
    9901015
    9911016        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       "HWACCMSaveGuestFPU64",   &pVM->hwaccm.s.pfnSaveGuestFPU64);
    992         AssertMsgRCReturn(rc, ("HWACCMSetupFPU64 -> rc=%Rrc\n", rc), rc);
     1017        AssertReleaseMsgRC(rc, ("HWACCMSetupFPU64 -> rc=%Rrc\n", rc));
    9931018
    9941019        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       "HWACCMSaveGuestDebug64",   &pVM->hwaccm.s.pfnSaveGuestDebug64);
    995         AssertMsgRCReturn(rc, ("HWACCMSetupDebug64 -> rc=%Rrc\n", rc), rc);
     1020        AssertReleaseMsgRC(rc, ("HWACCMSetupDebug64 -> rc=%Rrc\n", rc));
    9961021
    9971022# ifdef DEBUG
    9981023        rc = PDMR3LdrGetSymbolRC(pVM, NULL,       "HWACCMTestSwitcher64",   &pVM->hwaccm.s.pfnTest64);
    999         AssertMsgRCReturn(rc, ("HWACCMTestSwitcher64 -> rc=%Rrc\n", rc), rc);
     1024        AssertReleaseMsgRC(rc, ("HWACCMTestSwitcher64 -> rc=%Rrc\n", rc));
    10001025# endif
    10011026    }
    10021027#endif
    1003     return VINF_SUCCESS;
    1004 }
    1005 
    1006 /**
    1007  * Applies relocations to data and code managed by this
    1008  * component. This function will be called at init and
    1009  * whenever the VMM need to relocate it self inside the GC.
    1010  *
    1011  * @param   pVM     The VM.
    1012  */
    1013 VMMR3DECL(void) HWACCMR3Relocate(PVM pVM)
    1014 {
    1015     Log(("HWACCMR3Relocate to %RGv\n", MMHyperGetArea(pVM, 0)));
    1016 
    1017     /* Fetch the current paging mode during the relocate callback during state loading. */
    1018     if (VMR3GetState(pVM) == VMSTATE_LOADING)
    1019     {
    1020         for (unsigned i=0;i<pVM->cCPUs;i++)
    1021         {
    1022             PVMCPU pVCpu = &pVM->aCpus[i];
    1023             /* @todo SMP */
    1024             pVCpu->hwaccm.s.enmShadowMode            = PGMGetShadowMode(pVM);
    1025             pVCpu->hwaccm.s.vmx.enmLastSeenGuestMode = PGMGetGuestMode(pVM);
    1026         }
    1027     }
    1028 
    10291028    return;
    10301029}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette