VirtualBox

Changeset 15609 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 16, 2008 10:00:21 PM (16 years ago)
Author:
vboxsync
Message:

HWACCM/EM: Sketeched out some scheduling notification from EM to let HWACCM know when to resync the guest state - disabled for the time being.

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

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

    r15572 r15609  
    7878#include <VBox/param.h>
    7979#include <VBox/err.h>
     80
     81
     82/*******************************************************************************
     83*   Defined Constants And Macros                                               *
     84*******************************************************************************/
     85#if 0 /* Disabled till after 2.1.0 when we've time to test it. */
     86#define EM_NOTIFY_HWACCM
     87#endif
    8088
    8189
     
    13121320            {
    13131321                pCtx->rip += Cpu.opsize;
     1322#ifdef EM_NOTIFY_HWACCM
     1323                if (pVM->em.s.enmState == EMSTATE_DEBUG_GUEST_HWACC)
     1324                    HWACCMR3NotifyEmulated(VMMGetCpu(pVM));
     1325#endif
    13141326                STAM_PROFILE_STOP(&pVM->em.s.StatMiscEmu, a);
    13151327                return rc;
     
    13261338    STAM_PROFILE_STOP(&pVM->em.s.StatREMEmu, a);
    13271339
     1340#ifdef EM_NOTIFY_HWACCM
     1341    if (pVM->em.s.enmState == EMSTATE_DEBUG_GUEST_HWACC)
     1342        HWACCMR3NotifyEmulated(VMMGetCpu(pVM));
     1343#endif
    13281344    return rc;
    13291345}
     
    15631579                {
    15641580                    pCtx->rip += cpu.opsize;
     1581#ifdef EM_NOTIFY_HWACCM
     1582                    if (pVM->em.s.enmState == EMSTATE_DEBUG_GUEST_HWACC)
     1583                        HWACCMR3NotifyEmulated(VMMGetCpu(pVM));
     1584#endif
    15651585                    return rc;
    15661586                }
     
    20572077                    {
    20582078                        pCtx->rip += Cpu.opsize;
     2079#ifdef EM_NOTIFY_HWACCM
     2080                        if (pVM->em.s.enmState == EMSTATE_DEBUG_GUEST_HWACC)
     2081                            HWACCMR3NotifyEmulated(VMMGetCpu(pVM));
     2082#endif
    20592083                        STAM_PROFILE_STOP(&pVM->em.s.StatPrivEmu, a);
    20602084
     
    27832807    STAM_COUNTER_INC(&pVM->em.s.StatHwAccExecuteEntry);
    27842808
     2809#ifdef EM_NOTIFY_HWACCM
     2810    HWACCMR3NotifyScheduled(&pVM->aCpus[idCpu]);
     2811#endif
     2812
    27852813    /*
    27862814     * Spin till we get a forced action which returns anything but VINF_SUCCESS.
     
    28652893        }
    28662894    }
     2895
    28672896    /*
    28682897     * Return to outer loop.
  • trunk/src/VBox/VMM/HWACCM.cpp

    r15607 r15609  
    13331333
    13341334/**
     1335 * Notifcation from EM about a rescheduling into hardware assisted execution
     1336 * mode.
     1337 *
     1338 * @param   pVCpu       Pointer to the current virtual cpu structure.
     1339 */
     1340VMMR3DECL(void) HWACCMR3NotifyScheduled(PVMCPU pVCpu)
     1341{
     1342    pVCpu->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_ALL_GUEST;
     1343}
     1344
     1345/**
     1346 * Notifcation from EM about returning from instruction emulation (REM / EM).
     1347 *
     1348 * @param   pVCpu       Pointer to the current virtual cpu structure.
     1349 */
     1350VMMR3DECL(void) HWACCMR3NotifyEmulated(PVMCPU pVCpu)
     1351{
     1352    pVCpu->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_ALL_GUEST;
     1353}
     1354
     1355/**
    13351356 * Checks if we are currently using hardware accelerated raw mode.
    13361357 *
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