VirtualBox

Changeset 97776 in vbox


Ignore:
Timestamp:
Dec 12, 2022 12:46:22 PM (2 years ago)
Author:
vboxsync
Message:

VMM/EM: When responding to VINF_EM_RESCHEDULE_HM in the EM loop, we must consult HMCanExecuteGuest before setting the state to EMSTATE_HM otherwise we can get into trouble on systems which doesn't support unrestricted guest mode. In this particular case, the guest HLTed in real mode and after injecting an interrupt we would resume in HM rather than IEM/REM as we ought to. ticketref:21332

File:
1 edited

Legend:

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

    r97231 r97776  
    22442244                    if (VM_IS_HM_ENABLED(pVM))
    22452245                    {
    2246                         Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_HM: %d -> %d (EMSTATE_HM)\n", enmOldState, EMSTATE_HM));
    2247                         pVCpu->em.s.enmState = EMSTATE_HM;
     2246                        if (HMCanExecuteGuest(pVM, pVCpu, &pVCpu->cpum.GstCtx))
     2247                        {
     2248                            Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_HM: %d -> %d (EMSTATE_HM)\n", enmOldState, EMSTATE_HM));
     2249                            pVCpu->em.s.enmState = EMSTATE_HM;
     2250                        }
     2251                        else
     2252                        {
     2253                            Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_HM: %d -> %d (EMSTATE_IEM_THEN_REM)\n", enmOldState, EMSTATE_IEM_THEN_REM));
     2254                            pVCpu->em.s.enmState = EMSTATE_IEM_THEN_REM;
     2255                        }
    22482256                    }
    22492257                    else if (VM_IS_NEM_ENABLED(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