VirtualBox

Changeset 17295 in vbox


Ignore:
Timestamp:
Mar 3, 2009 3:56:07 PM (16 years ago)
Author:
vboxsync
Message:

Refined HWACCMR3EmulateIoBlock

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/hwaccm.h

    r17292 r17295  
    120120VMMR3DECL(bool) HWACCMR3IsVPIDActive(PVM pVM);
    121121VMMR3DECL(int)  HWACCMR3InjectNMI(PVM pVM);
    122 VMMR3DECL(void) HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx);
     122VMMR3DECL(int) HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx);
    123123
    124124/** @} */
  • trunk/src/VBox/VMM/EM.cpp

    r17292 r17295  
    23602360         */
    23612361        case VINF_EM_RAW_EMULATE_IO_BLOCK:
    2362             HWACCMR3EmulateIoBlock(pVM, pCtx);
    2363             rc = VINF_EM_RESCHEDULE_REM;
     2362            rc =HWACCMR3EmulateIoBlock(pVM, pCtx);
    23642363            break;
    23652364
  • trunk/src/VBox/VMM/HWACCM.cpp

    r17293 r17295  
    11921192 * Force execution of the current IO code in the recompiler
    11931193 *
     1194 * @returns VBox status code.
    11941195 * @param   pVM         The VM to operate on.
    11951196 * @param   pCtx        Partial VM execution context
    11961197 */
    1197 VMMR3DECL(void) HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx)
     1198VMMR3DECL(int) HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx)
    11981199{
    11991200    PVMCPU pVCpu = VMMGetCpu(pVM);
    12001201
    12011202    Assert(pVM->fHWACCMEnabled);
    1202     pVCpu->hwaccm.s.EmulateIoBlock.fEnabled         = true;
    1203     pVCpu->hwaccm.s.EmulateIoBlock.GCPtrFunctionEsp = pCtx->rsp;
     1203    Log(("HWACCMR3EmulateIoBlock\n"));
     1204    if (!CPUMIsGuestInPagedProtectedModeEx(pCtx))
     1205    {
     1206        Log(("HWACCMR3EmulateIoBlock -> enabled\n"));
     1207        pVCpu->hwaccm.s.EmulateIoBlock.fEnabled         = true;
     1208        pVCpu->hwaccm.s.EmulateIoBlock.GCPtrFunctionEsp = pCtx->rsp;
     1209        pVCpu->hwaccm.s.EmulateIoBlock.cr0              = pCtx->cr0;
     1210        return VINF_EM_RESCHEDULE_REM;
     1211    }
     1212    return VINF_SUCCESS;
    12041213}
    12051214
     
    12181227
    12191228    if (    RT_UNLIKELY(pVCpu->hwaccm.s.EmulateIoBlock.fEnabled)
    1220         &&  pCtx->rsp <= pVCpu->hwaccm.s.EmulateIoBlock.GCPtrFunctionEsp)
     1229        &&  pCtx->rsp <= pVCpu->hwaccm.s.EmulateIoBlock.GCPtrFunctionEsp
     1230        &&  pCtx->cr0 == pVCpu->hwaccm.s.EmulateIoBlock.cr0)
    12211231        return false;
    12221232
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r17292 r17295  
    558558        /** Esp at the start of the io code we wish to emulate in the recompiler. */
    559559        RTGCPTR                 GCPtrFunctionEsp;
     560
     561        uint64_t                cr0;
    560562    } EmulateIoBlock;
    561563
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