- Timestamp:
- Nov 25, 2009 11:04:36 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EM.cpp
r23211 r24938 85 85 static DECLCALLBACK(int) emR3Save(PVM pVM, PSSMHANDLE pSSM); 86 86 static DECLCALLBACK(int) emR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); 87 static const char *emR3GetStateName(EMSTATE enmState); 87 88 static int emR3Debug(PVM pVM, PVMCPU pVCpu, int rc); 88 89 static int emR3RemStep(PVM pVM, PVMCPU pVCpu); … … 449 450 PVMCPU pVCpu = &pVM->aCpus[i]; 450 451 pVCpu->em.s.fForceRAW = false; 452 453 /* VMR3Reset may return VINF_EM_RESET or VINF_EM_SUSPEND, so transition 454 out of the HALTED state here so that enmPrevState doesn't end up as 455 HALTED when EMR3Execute returns. */ 456 if (pVCpu->em.s.enmState == EMSTATE_HALTED) 457 { 458 Log(("EMR3Reset: Cpu#%u %s -> %s\n", i, emR3GetStateName(pVCpu->em.s.enmState), i == 0 ? "EMSTATE_NONE" : "EMSTATE_WAIT_SIPI")); 459 pVCpu->em.s.enmState = i == 0 ? EMSTATE_NONE : EMSTATE_WAIT_SIPI; 460 } 451 461 } 452 462 } … … 581 591 * @param enmState The state. 582 592 */ 583 VMMR3DECL(const char *) EMR3GetStateName(EMSTATE enmState)593 static const char *emR3GetStateName(EMSTATE enmState) 584 594 { 585 595 switch (enmState) … … 1638 1648 VMMR3DECL(int) EMR3ExecuteVM(PVM pVM, PVMCPU pVCpu) 1639 1649 { 1640 LogFlow(("EMR3ExecuteVM: pVM=%p enmVMState=%d enmState=%d (%s) fForceRAW=%d\n", pVM, pVM->enmVMState, 1641 pVCpu->em.s.enmState, EMR3GetStateName(pVCpu->em.s.enmState), pVCpu->em.s.fForceRAW)); 1650 Log(("EMR3ExecuteVM: pVM=%p enmVMState=%d (%s) enmState=%d (%s) enmPrevState=%d (%s) fForceRAW=%RTbool\n", 1651 pVM, 1652 pVM->enmVMState, VMR3GetStateName(pVM->enmVMState), 1653 pVCpu->em.s.enmState, emR3GetStateName(pVCpu->em.s.enmState), 1654 pVCpu->em.s.enmPrevState, emR3GetStateName(pVCpu->em.s.enmPrevState), 1655 pVCpu->em.s.fForceRAW)); 1642 1656 VM_ASSERT_EMT(pVM); 1643 1657 AssertMsg( pVCpu->em.s.enmState == EMSTATE_NONE 1644 1658 || pVCpu->em.s.enmState == EMSTATE_WAIT_SIPI 1645 1659 || pVCpu->em.s.enmState == EMSTATE_SUSPENDED, 1646 ("%s\n", EMR3GetStateName(pVCpu->em.s.enmState)));1660 ("%s\n", emR3GetStateName(pVCpu->em.s.enmState))); 1647 1661 1648 1662 int rc = setjmp(pVCpu->em.s.u.FatalLongJump); … … 1761 1775 { 1762 1776 EMSTATE enmState = emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx); 1763 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE: %d -> %d (%s)\n", pVCpu->em.s.enmState, enmState, EMR3GetStateName(enmState)));1777 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE: %d -> %d (%s)\n", pVCpu->em.s.enmState, enmState, emR3GetStateName(enmState))); 1764 1778 pVCpu->em.s.enmState = enmState; 1765 1779 break; … … 1802 1816 { 1803 1817 EMSTATE enmState = emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx); 1804 Log2(("EMR3ExecuteVM: VINF_EM_RESET: %d -> %d (%s)\n", pVCpu->em.s.enmState, enmState, EMR3GetStateName(enmState)));1818 Log2(("EMR3ExecuteVM: VINF_EM_RESET: %d -> %d (%s)\n", pVCpu->em.s.enmState, enmState, emR3GetStateName(enmState))); 1805 1819 pVCpu->em.s.enmState = enmState; 1806 1820 } … … 1840 1854 case VINF_EM_NO_MEMORY: 1841 1855 Log2(("EMR3ExecuteVM: VINF_EM_NO_MEMORY: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_SUSPENDED)); 1856 pVCpu->em.s.enmPrevState = pVCpu->em.s.enmState; 1842 1857 pVCpu->em.s.enmState = EMSTATE_SUSPENDED; 1843 1858 TMR3NotifySuspend(pVM, pVCpu); … … 1908 1923 rc = VERR_EM_INTERNAL_ERROR; 1909 1924 } 1925 Log(("EMR3ExecuteVM: %Rrc: %d -> %d (EMSTATE_GURU_MEDITATION)\n", rc, pVCpu->em.s.enmState, EMSTATE_GURU_MEDITATION)); 1910 1926 pVCpu->em.s.enmState = EMSTATE_GURU_MEDITATION; 1911 Log(("EMR3ExecuteVM returns %d\n", rc));1912 1927 break; 1913 1928 } … … 1975 1990 TMR3NotifySuspend(pVM, pVCpu); 1976 1991 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatTotal, x); 1992 Log(("EMR3ExecuteVM: actually returns %Rrc (state %s / %s)\n", rc, emR3GetStateName(pVCpu->em.s.enmState), emR3GetStateName(pVCpu->em.s.enmPrevState))); 1977 1993 return VINF_EM_SUSPEND; 1978 1994 … … 2003 2019 pVCpu->em.s.enmState = EMSTATE_GURU_MEDITATION; 2004 2020 VMMR3FatalDump(pVM, pVCpu, rc); 2021 Log(("EMR3ExecuteVM: actually returns %Rrc (state %s / %s)\n", rc, emR3GetStateName(pVCpu->em.s.enmState), emR3GetStateName(pVCpu->em.s.enmPrevState))); 2005 2022 return rc; 2006 2023 } … … 2020 2037 emR3Debug(pVM, pVCpu, rc); 2021 2038 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatTotal, x); 2039 Log(("EMR3ExecuteVM: actually returns %Rrc (state %s / %s)\n", rc, emR3GetStateName(pVCpu->em.s.enmState), emR3GetStateName(pVCpu->em.s.enmPrevState))); 2022 2040 return rc; 2023 2041 } … … 2033 2051 TMR3NotifySuspend(pVM, pVCpu); 2034 2052 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatTotal, x); 2053 Log(("EMR3ExecuteVM: actually returns %Rrc (state %s / %s)\n", rc, emR3GetStateName(pVCpu->em.s.enmState), emR3GetStateName(pVCpu->em.s.enmPrevState))); 2035 2054 return VERR_EM_INTERNAL_ERROR; 2036 2055 } … … 2042 2061 * Fatal error. 2043 2062 */ 2044 Log Flow(("EMR3ExecuteVM: returns %Rrc (longjmp / fatal error)\n", rc));2063 Log(("EMR3ExecuteVM: returns %Rrc because of longjmp / fatal error; (state %s / %s)\n", rc, emR3GetStateName(pVCpu->em.s.enmState), emR3GetStateName(pVCpu->em.s.enmPrevState))); 2045 2064 TMR3NotifySuspend(pVM, pVCpu); 2046 2065 VMMR3FatalDump(pVM, pVCpu, rc);
Note:
See TracChangeset
for help on using the changeset viewer.