VirtualBox

Ignore:
Timestamp:
May 20, 2018 4:14:53 PM (7 years ago)
Author:
vboxsync
Message:

TRPMR3InjectEvent: Don't reschedule to REM when in NEM mode. bugref:9044

File:
1 edited

Legend:

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

    r70948 r72266  
    8787#include <VBox/vmm/csam.h>
    8888#include <VBox/vmm/patm.h>
     89#include <VBox/vmm/iem.h>
    8990#include "TRPMInternal.h"
    9091#include <VBox/vmm/vm.h>
     
    15201521        if (EMIsSupervisorCodeRecompiled(pVM) || !VM_IS_RAW_MODE_ENABLED(pVM))
    15211522        {
    1522             rc = TRPMAssertTrap(pVCpu, u8Interrupt, enmEvent);
    1523             AssertRC(rc);
    15241523            STAM_COUNTER_INC(&pVM->trpm.s.paStatForwardedIRQR3[u8Interrupt]);
    1525             return HMR3IsActive(pVCpu) ? VINF_EM_RESCHEDULE_HM : VINF_EM_RESCHEDULE_REM;
    1526         }
     1524            if (!VM_IS_NEM_ENABLED(pVM))
     1525            {
     1526                rc = TRPMAssertTrap(pVCpu, u8Interrupt, enmEvent);
     1527                AssertRC(rc);
     1528                return HMR3IsActive(pVCpu) ? VINF_EM_RESCHEDULE_HM : VINF_EM_RESCHEDULE_REM;
     1529            }
     1530            VBOXSTRICTRC rcStrict = IEMInjectTrap(pVCpu, u8Interrupt, enmEvent, 0, 0, 0);
     1531            if (rcStrict == VINF_SUCCESS)
     1532                return VINF_EM_RESCHEDULE;
     1533            return VBOXSTRICTRC_TODO(rcStrict);
     1534        }
     1535
    15271536        /* If the guest gate is not patched, then we will check (again) if we can patch it. */
    15281537        if (pVM->trpm.s.aGuestTrapHandler[u8Interrupt] == TRPM_INVALID_HANDLER)
     
    15591568        /* Can happen if the interrupt is masked by TPR or APIC is disabled. */
    15601569        AssertMsg(rc == VERR_APIC_INTR_MASKED_BY_TPR || rc == VERR_NO_DATA, ("PDMGetInterrupt failed. rc=%Rrc\n", rc));
    1561         return HMR3IsActive(pVCpu) ? VINF_EM_RESCHEDULE_HM : VINF_EM_RESCHEDULE_REM; /* (Heed the halted state if this is changed!) */
     1570        return HMR3IsActive(pVCpu)    ? VINF_EM_RESCHEDULE_HM
     1571             : VM_IS_NEM_ENABLED(pVM) ? VINF_EM_RESCHEDULE
     1572             :                          VINF_EM_RESCHEDULE_REM; /* (Heed the halted state if this is changed!) */
    15621573    }
    15631574
     
    15771588    if (RT_SUCCESS(rc))
    15781589    {
    1579         rc = TRPMAssertTrap(pVCpu, u8Interrupt, TRPM_HARDWARE_INT);
    1580         AssertRC(rc);
     1590        if (!VM_IS_NEM_ENABLED(pVM))
     1591        {
     1592            rc = TRPMAssertTrap(pVCpu, u8Interrupt, TRPM_HARDWARE_INT);
     1593            AssertRC(rc);
     1594        }
     1595        else
     1596        {
     1597            VBOXSTRICTRC rcStrict = IEMInjectTrap(pVCpu, u8Interrupt, enmEvent, 0, 0, 0);
     1598            if (rcStrict != VINF_SUCCESS)
     1599                return VBOXSTRICTRC_TODO(rcStrict);
     1600        }
    15811601        STAM_COUNTER_INC(&pVM->trpm.s.paStatForwardedIRQR3[u8Interrupt]);
    15821602    }
     
    15861606        AssertMsg(rc == VERR_APIC_INTR_MASKED_BY_TPR || rc == VERR_NO_DATA, ("PDMGetInterrupt failed. rc=%Rrc\n", rc));
    15871607    }
    1588     return HMR3IsActive(pVCpu) ? VINF_EM_RESCHEDULE_HM : VINF_EM_RESCHEDULE_REM; /* (Heed the halted state if this is changed!) */
     1608    return HMR3IsActive(pVCpu)    ? VINF_EM_RESCHEDULE_HM
     1609         : VM_IS_NEM_ENABLED(pVM) ? VINF_EM_RESCHEDULE
     1610         :                          VINF_EM_RESCHEDULE_REM; /* (Heed the halted state if this is changed!) */
    15891611#endif /* !TRPM_FORWARD_TRAPS_IN_GC || IEM_VERIFICATION_MODE */
    1590 
    15911612}
    15921613
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