VirtualBox

Changeset 38378 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Aug 9, 2011 1:37:41 PM (13 years ago)
Author:
vboxsync
Message:

Don't issue instructions rescheduling to RAW or HWACCM mode when recompilation is forced.

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

Legend:

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

    r38327 r38378  
    15781578        /*
    15791579         * The instruction following an emulated STI should *always* be executed!
     1580         *
     1581         * Note! We intentionally don't clear VM_FF_INHIBIT_INTERRUPTS here if
     1582         *       the eip is the same as the inhibited instr address.  Before we
     1583         *       are able to execute this instruction in raw mode (iret to
     1584         *       guest code) an external interrupt might force a world switch
     1585         *       again.  Possibly allowing a guest interrupt to be dispatched
     1586         *       in the process.  This could break the guest.  Sounds very
     1587         *       unlikely, but such timing sensitive problem are not as rare as
     1588         *       you might think.
    15801589         */
    15811590        if (    VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)
     
    15841593            Log(("VMCPU_FF_INHIBIT_INTERRUPTS at %RGv successor %RGv\n", (RTGCPTR)CPUMGetGuestRIP(pVCpu), EMGetInhibitInterruptsPC(pVCpu)));
    15851594            if (CPUMGetGuestRIP(pVCpu) != EMGetInhibitInterruptsPC(pVCpu))
    1586             {
    1587                 /* Note: we intentionally don't clear VM_FF_INHIBIT_INTERRUPTS here if the eip is the same as the inhibited instr address.
    1588                  *  Before we are able to execute this instruction in raw mode (iret to guest code) an external interrupt might
    1589                  *  force a world switch again. Possibly allowing a guest interrupt to be dispatched in the process. This could
    1590                  *  break the guest. Sounds very unlikely, but such timing sensitive problem are not as rare as you might think.
    1591                  */
    15921595                VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS);
    1593             }
    1594             if (HWACCMR3IsActive(pVCpu))
     1596
     1597            if (EMIsSupervisorCodeRecompiled(pVM))
     1598                rc2 = VINF_EM_RESCHEDULE_REM;
     1599            else if (HWACCMR3IsActive(pVCpu))
    15951600                rc2 = VINF_EM_RESCHEDULE_HWACC;
    15961601            else
     
    18421847            {
    18431848                rc = emR3ForcedActions(pVM, pVCpu, rc);
    1844                 if (    (   rc == VINF_EM_RESCHEDULE_REM
    1845                          || rc == VINF_EM_RESCHEDULE_HWACC)
    1846                     &&  pVCpu->em.s.fForceRAW)
     1849                if (   (   rc == VINF_EM_RESCHEDULE_REM
     1850                        || rc == VINF_EM_RESCHEDULE_HWACC)
     1851                    && pVCpu->em.s.fForceRAW)
    18471852                    rc = VINF_EM_RESCHEDULE_RAW;
    18481853            }
  • trunk/src/VBox/VMM/VMMR3/TRPM.cpp

    r36823 r38378  
    7979#include <VBox/vmm/ssm.h>
    8080#include <VBox/vmm/pdmapi.h>
     81#include <VBox/vmm/em.h>
    8182#include <VBox/vmm/pgm.h>
    8283#include "internal/pgm.h"
     
    14541455    Assert(enmEvent == TRPM_HARDWARE_INT);
    14551456
    1456     if (REMR3QueryPendingInterrupt(pVM, pVCpu) == REM_NO_PENDING_IRQ)
     1457    if (   REMR3QueryPendingInterrupt(pVM, pVCpu) == REM_NO_PENDING_IRQ
     1458        && !EMIsSupervisorCodeRecompiled(pVM))
    14571459    {
    14581460#ifdef TRPM_FORWARD_TRAPS_IN_GC
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