VirtualBox

Changeset 39699 in vbox


Ignore:
Timestamp:
Jan 4, 2012 3:06:35 PM (13 years ago)
Author:
vboxsync
Message:

REM: sync HF_INHIBIT_IRQ_MASK with VMCPU_FF_INHIBIT_INTERRUPTS/PC.

Location:
trunk/src/recompiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r38838 r39699  
    662662    { REMPARMDESC_FLAGS_INT,        sizeof(int),                NULL }
    663663};
     664static const REMPARMDESC g_aArgsEMSetInhibitInterruptsPC[] =
     665{
     666    { REMPARMDESC_FLAGS_INT,        sizeof(PVMCPU),             NULL },
     667    { REMPARMDESC_FLAGS_INT,        sizeof(RTGCPTR),            NULL }
     668};
    664669static const REMPARMDESC g_aArgsHWACCMR3CanExecuteGuest[] =
    665670{
     
    12201225    { "EMRemUnlock",                            VMM_FN(EMRemUnlock),                    &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_VOID,   0,                  NULL },
    12211226    { "EMRemIsLockOwner",                       VMM_FN(EMRemIsLockOwner),               &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_VOID,   sizeof(bool),       NULL },
     1227    { "EMGetInhibitInterruptsPC",               VMM_FN(EMGetInhibitInterruptsPC),       &g_aArgsVMCPU[0],                           RT_ELEMENTS(g_aArgsVMCPU),                             REMFNDESC_FLAGS_RET_INT,    sizeof(RTGCPTR),    NULL },
     1228    { "EMSetInhibitInterruptsPC",               VMM_FN(EMSetInhibitInterruptsPC),       &g_aArgsEMSetInhibitInterruptsPC[0],        RT_ELEMENTS(g_aArgsEMSetInhibitInterruptsPC),          REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
    12221229    { "HWACCMR3CanExecuteGuest",                VMM_FN(HWACCMR3CanExecuteGuest),        &g_aArgsHWACCMR3CanExecuteGuest[0],         RT_ELEMENTS(g_aArgsHWACCMR3CanExecuteGuest),           REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
    12231230    { "IOMIOPortRead",                          VMM_FN(IOMIOPortRead),                  &g_aArgsIOMIOPortRead[0],                   RT_ELEMENTS(g_aArgsIOMIOPortRead),                     REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
  • trunk/src/recompiler/VBoxRecompiler.c

    r39615 r39699  
    21652165#endif
    21662166
     2167    /* Update the inhibit IRQ mask. */
     2168    pVM->rem.s.Env.hflags &= ~HF_INHIBIT_IRQ_MASK;
     2169    if (VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS))
     2170    {
     2171        RTGCPTR InhibitPC = EMGetInhibitInterruptsPC(pVCpu);
     2172        if (InhibitPC == pCtx->rip)
     2173            pVM->rem.s.Env.hflags |= HF_INHIBIT_IRQ_MASK;
     2174        else
     2175        {
     2176            Log(("Clearing VMCPU_FF_INHIBIT_INTERRUPTS at %RGv - successor %RGv (REM#1)\n", (RTGCPTR)pCtx->rip, InhibitPC));
     2177            VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS);
     2178        }
     2179    }
     2180
    21672181    /*
    21682182     * Sync the A20 gate.
     
    27092723    pCtx->msrKERNELGSBASE  = pVM->rem.s.Env.kernelgsbase;
    27102724#endif
     2725
     2726    /* Inhibit interrupt flag. */
     2727    if (pVM->rem.s.Env.hflags & HF_INHIBIT_IRQ_MASK)
     2728    {
     2729        Log(("Settings VMCPU_FF_INHIBIT_INTERRUPTS at %RGv (REM)\n", (RTGCPTR)pCtx->rip));
     2730        EMSetInhibitInterruptsPC(pVCpu, pCtx->rip);
     2731        VMCPU_FF_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS);
     2732    }
     2733    else if (VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS))
     2734    {
     2735        Log(("Clearing VMCPU_FF_INHIBIT_INTERRUPTS at %RGv - successor %RGv (REM#2)\n", (RTGCPTR)pCtx->rip, EMGetInhibitInterruptsPC(pVCpu)));
     2736        VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS);
     2737    }
    27112738
    27122739    remR3TrapClear(pVM);
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