- Timestamp:
- Mar 6, 2012 1:37:23 PM (13 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/EM.cpp
r40371 r40375 44 44 #include <VBox/vmm/iom.h> 45 45 #include <VBox/vmm/dbgf.h> 46 #include <VBox/vmm/dbgftrace.h>47 46 #include <VBox/vmm/pgm.h> 48 47 #ifdef VBOX_WITH_REM … … 69 68 #include <VBox/disopcode.h> 70 69 #include <VBox/vmm/dbgf.h> 70 #include "VMMTracing.h" 71 71 72 72 #include <iprt/asm.h> … … 1103 1103 STAM_REL_PROFILE_ADV_SUSPEND(&pVCpu->em.s.StatREMTotal, a); 1104 1104 rc = emR3ForcedActions(pVM, pVCpu, rc); 1105 VBOXVMMR3_EM_FF_ALL_RET(pVCpu, rc); 1105 1106 STAM_REL_PROFILE_ADV_RESUME(&pVCpu->em.s.StatREMTotal, a); 1106 1107 if ( rc != VINF_SUCCESS … … 1330 1331 int emR3HighPriorityPostForcedActions(PVM pVM, PVMCPU pVCpu, int rc) 1331 1332 { 1333 VBOXVMMR3_EM_FF_HIGH(pVCpu, pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions, rc); 1334 1332 1335 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PDM_CRITSECT)) 1333 1336 PDMCritSectFF(pVCpu); … … 1381 1384 rc = rc2; \ 1382 1385 } while (0) 1386 VBOXVMMR3_EM_FF_ALL(pVCpu, pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions, rc); 1383 1387 1384 1388 /* … … 1885 1889 { 1886 1890 rc = emR3ForcedActions(pVM, pVCpu, rc); 1891 VBOXVMMR3_EM_FF_ALL_RET(pVCpu, rc); 1887 1892 if ( ( rc == VINF_EM_RESCHEDULE_REM 1888 1893 || rc == VINF_EM_RESCHEDULE_HWACC) … … 1910 1915 */ 1911 1916 case VINF_EM_RESCHEDULE_RAW: 1912 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_RAW: %d -> %d (EMSTATE_RAW)\n", pVCpu->em.s.enmState, EMSTATE_RAW));1917 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_RAW: %d -> %d (EMSTATE_RAW)\n", enmOldState, EMSTATE_RAW)); 1913 1918 pVCpu->em.s.enmState = EMSTATE_RAW; 1914 1919 break; … … 1918 1923 */ 1919 1924 case VINF_EM_RESCHEDULE_HWACC: 1920 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_HWACC: %d -> %d (EMSTATE_HWACC)\n", pVCpu->em.s.enmState, EMSTATE_HWACC));1925 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_HWACC: %d -> %d (EMSTATE_HWACC)\n", enmOldState, EMSTATE_HWACC)); 1921 1926 Assert(!pVCpu->em.s.fForceRAW); 1922 1927 pVCpu->em.s.enmState = EMSTATE_HWACC; … … 1927 1932 */ 1928 1933 case VINF_EM_RESCHEDULE_REM: 1929 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_REM: %d -> %d (EMSTATE_REM)\n", pVCpu->em.s.enmState, EMSTATE_REM));1934 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE_REM: %d -> %d (EMSTATE_REM)\n", enmOldState, EMSTATE_REM)); 1930 1935 pVCpu->em.s.enmState = EMSTATE_REM; 1931 1936 break; … … 1935 1940 */ 1936 1941 case VINF_EM_RESUME: 1937 Log2(("EMR3ExecuteVM: VINF_EM_RESUME: %d -> VINF_EM_RESCHEDULE\n", pVCpu->em.s.enmState));1942 Log2(("EMR3ExecuteVM: VINF_EM_RESUME: %d -> VINF_EM_RESCHEDULE\n", enmOldState)); 1938 1943 /* Don't reschedule in the halted or wait for SIPI case. */ 1939 1944 if ( pVCpu->em.s.enmPrevState == EMSTATE_WAIT_SIPI … … 1951 1956 { 1952 1957 EMSTATE enmState = emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx); 1953 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE: %d -> %d (%s)\n", pVCpu->em.s.enmState, enmState, emR3GetStateName(enmState)));1958 Log2(("EMR3ExecuteVM: VINF_EM_RESCHEDULE: %d -> %d (%s)\n", enmOldState, enmState, emR3GetStateName(enmState))); 1954 1959 pVCpu->em.s.enmState = enmState; 1955 1960 break; … … 1960 1965 */ 1961 1966 case VINF_EM_HALT: 1962 Log2(("EMR3ExecuteVM: VINF_EM_HALT: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_HALTED));1967 Log2(("EMR3ExecuteVM: VINF_EM_HALT: %d -> %d\n", enmOldState, EMSTATE_HALTED)); 1963 1968 pVCpu->em.s.enmState = EMSTATE_HALTED; 1964 1969 break; … … 1969 1974 case VINF_EM_WAIT_SIPI: 1970 1975 Assert(pVCpu->idCpu != 0); 1971 Log2(("EMR3ExecuteVM: VINF_EM_WAIT_SIPI: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_WAIT_SIPI));1976 Log2(("EMR3ExecuteVM: VINF_EM_WAIT_SIPI: %d -> %d\n", enmOldState, EMSTATE_WAIT_SIPI)); 1972 1977 pVCpu->em.s.enmState = EMSTATE_WAIT_SIPI; 1973 1978 break; … … 1978 1983 */ 1979 1984 case VINF_EM_SUSPEND: 1980 Log2(("EMR3ExecuteVM: VINF_EM_SUSPEND: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_SUSPENDED));1981 Assert( pVCpu->em.s.enmState != EMSTATE_SUSPENDED);1982 pVCpu->em.s.enmPrevState = pVCpu->em.s.enmState;1985 Log2(("EMR3ExecuteVM: VINF_EM_SUSPEND: %d -> %d\n", enmOldState, EMSTATE_SUSPENDED)); 1986 Assert(enmOldState != EMSTATE_SUSPENDED); 1987 pVCpu->em.s.enmPrevState = enmOldState; 1983 1988 pVCpu->em.s.enmState = EMSTATE_SUSPENDED; 1984 1989 break; … … 1993 1998 { 1994 1999 EMSTATE enmState = emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx); 1995 Log2(("EMR3ExecuteVM: VINF_EM_RESET: %d -> %d (%s)\n", pVCpu->em.s.enmState, enmState, emR3GetStateName(enmState)));2000 Log2(("EMR3ExecuteVM: VINF_EM_RESET: %d -> %d (%s)\n", enmOldState, enmState, emR3GetStateName(enmState))); 1996 2001 pVCpu->em.s.enmState = enmState; 1997 2002 } … … 2009 2014 case VINF_EM_OFF: 2010 2015 pVCpu->em.s.enmState = EMSTATE_TERMINATING; 2011 Log2(("EMR3ExecuteVM: returns VINF_EM_OFF (%d -> %d)\n", pVCpu->em.s.enmState, EMSTATE_TERMINATING));2016 Log2(("EMR3ExecuteVM: returns VINF_EM_OFF (%d -> %d)\n", enmOldState, EMSTATE_TERMINATING)); 2012 2017 TMR3NotifySuspend(pVM, pVCpu); 2013 2018 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatTotal, x); … … 2019 2024 case VINF_EM_TERMINATE: 2020 2025 pVCpu->em.s.enmState = EMSTATE_TERMINATING; 2021 Log(("EMR3ExecuteVM returns VINF_EM_TERMINATE (%d -> %d)\n", pVCpu->em.s.enmState, EMSTATE_TERMINATING));2026 Log(("EMR3ExecuteVM returns VINF_EM_TERMINATE (%d -> %d)\n", enmOldState, EMSTATE_TERMINATING)); 2022 2027 if (pVM->enmVMState < VMSTATE_DESTROYING) /* ugly */ 2023 2028 TMR3NotifySuspend(pVM, pVCpu); … … 2030 2035 */ 2031 2036 case VINF_EM_NO_MEMORY: 2032 Log2(("EMR3ExecuteVM: VINF_EM_NO_MEMORY: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_SUSPENDED));2033 Assert( pVCpu->em.s.enmState != EMSTATE_SUSPENDED);2034 pVCpu->em.s.enmPrevState = pVCpu->em.s.enmState;2037 Log2(("EMR3ExecuteVM: VINF_EM_NO_MEMORY: %d -> %d\n", enmOldState, EMSTATE_SUSPENDED)); 2038 Assert(enmOldState != EMSTATE_SUSPENDED); 2039 pVCpu->em.s.enmPrevState = enmOldState; 2035 2040 pVCpu->em.s.enmState = EMSTATE_SUSPENDED; 2036 2041 TMR3NotifySuspend(pVM, pVCpu); … … 2058 2063 case VINF_EM_DBG_BREAKPOINT: 2059 2064 case VINF_EM_DBG_STEP: 2060 if ( pVCpu->em.s.enmState == EMSTATE_RAW)2065 if (enmOldState == EMSTATE_RAW) 2061 2066 { 2062 Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, pVCpu->em.s.enmState, EMSTATE_DEBUG_GUEST_RAW));2067 Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, enmOldState, EMSTATE_DEBUG_GUEST_RAW)); 2063 2068 pVCpu->em.s.enmState = EMSTATE_DEBUG_GUEST_RAW; 2064 2069 } 2065 2070 else 2066 2071 { 2067 Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, pVCpu->em.s.enmState, EMSTATE_DEBUG_GUEST_REM));2072 Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, enmOldState, EMSTATE_DEBUG_GUEST_REM)); 2068 2073 pVCpu->em.s.enmState = EMSTATE_DEBUG_GUEST_REM; 2069 2074 } … … 2076 2081 case VINF_EM_DBG_HYPER_BREAKPOINT: 2077 2082 case VINF_EM_DBG_HYPER_ASSERTION: 2078 Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, pVCpu->em.s.enmState, EMSTATE_DEBUG_HYPER));2083 Log2(("EMR3ExecuteVM: %Rrc: %d -> %d\n", rc, enmOldState, EMSTATE_DEBUG_HYPER)); 2079 2084 pVCpu->em.s.enmState = EMSTATE_DEBUG_HYPER; 2080 2085 break; … … 2084 2089 */ 2085 2090 case VERR_VMM_RING0_ASSERTION: 2086 Log(("EMR3ExecuteVM: %Rrc: %d -> %d (EMSTATE_GURU_MEDITATION)\n", rc, pVCpu->em.s.enmState, EMSTATE_GURU_MEDITATION));2091 Log(("EMR3ExecuteVM: %Rrc: %d -> %d (EMSTATE_GURU_MEDITATION)\n", rc, enmOldState, EMSTATE_GURU_MEDITATION)); 2087 2092 pVCpu->em.s.enmState = EMSTATE_GURU_MEDITATION; 2088 2093 break; … … 2101 2106 rc = VERR_EM_INTERNAL_ERROR; 2102 2107 } 2103 Log(("EMR3ExecuteVM: %Rrc: %d -> %d (EMSTATE_GURU_MEDITATION)\n", rc, pVCpu->em.s.enmState, EMSTATE_GURU_MEDITATION));2108 Log(("EMR3ExecuteVM: %Rrc: %d -> %d (EMSTATE_GURU_MEDITATION)\n", rc, enmOldState, EMSTATE_GURU_MEDITATION)); 2104 2109 pVCpu->em.s.enmState = EMSTATE_GURU_MEDITATION; 2105 2110 break; … … 2112 2117 if (enmOldState != enmNewState) 2113 2118 { 2114 #ifdef DBGFTRACE_ENABLED 2115 RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-outer %d: %d -> %d", rc, enmOldState, enmNewState); 2116 #endif 2119 VBOXVMMR3_EM_STATE_CHANGED(pVCpu, enmOldState, enmNewState, rc); 2120 2117 2121 /* Clear MWait flags. */ 2118 2122 if ( enmOldState == EMSTATE_HALTED … … 2129 2133 } 2130 2134 } 2131 #ifdef DBGFTRACE_ENABLED2132 2135 else 2133 RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-outer %d: %d", rc, enmOldState); 2134 #endif 2136 VBOXVMMR3_EM_STATE_UNCHANGED(pVCpu, enmNewState, rc); 2135 2137 2136 2138 STAM_PROFILE_ADV_STOP(&pVCpu->em.s.StatTotal, x); /* (skip this in release) */ … … 2138 2140 2139 2141 /* 2140 * Act on the state.2142 * Act on the new state. 2141 2143 */ 2142 switch ( pVCpu->em.s.enmState)2144 switch (enmNewState) 2143 2145 { 2144 2146 /* -
trunk/src/VBox/VMM/VMMR3/EMHwaccm.cpp
r40274 r40375 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 46 46 #include <VBox/disopcode.h> 47 47 #include <VBox/vmm/dbgf.h> 48 #include "VMMTracing.h" 48 49 49 50 #include <iprt/asm.h> … … 584 585 { 585 586 rc = emR3ForcedActions(pVM, pVCpu, rc); 587 VBOXVMMR3_EM_FF_ALL_RET(pVCpu, rc); 586 588 if ( rc != VINF_SUCCESS 587 589 && rc != VINF_EM_RESCHEDULE_HWACC) -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r40371 r40375 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 30 30 #include <VBox/vmm/iom.h> 31 31 #include <VBox/vmm/dbgf.h> 32 #include <VBox/vmm/dbgftrace.h>33 32 #include <VBox/vmm/pgm.h> 34 33 #ifdef VBOX_WITH_REM … … 49 48 #include <VBox/disopcode.h> 50 49 #include <VBox/vmm/dbgf.h> 50 #include "VMMTracing.h" 51 51 52 52 #include <VBox/log.h> … … 173 173 { 174 174 rc = emR3RawForcedActions(pVM, pVCpu, pCtx); 175 VBOXVMMR3_EM_FF_RAW_RET(pVCpu, rc); 175 176 if (rc != VINF_SUCCESS) 176 177 return rc; … … 1201 1202 VMMR3DECL(int) EMR3CheckRawForcedActions(PVM pVM, PVMCPU pVCpu) 1202 1203 { 1203 return emR3RawForcedActions(pVM, pVCpu, pVCpu->em.s.pCtx); 1204 int rc = emR3RawForcedActions(pVM, pVCpu, pVCpu->em.s.pCtx); 1205 VBOXVMMR3_EM_FF_RAW_RET(pVCpu, rc); 1206 return rc; 1204 1207 } 1205 1208 … … 1222 1225 * Also note that SELMR3UpdateFromCPUM may trigger VM_FF_SELM_SYNC_TSS. 1223 1226 */ 1224 1227 VBOXVMMR3_EM_FF_RAW(pVCpu, pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions); 1225 1228 1226 1229 /* … … 1384 1387 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK)) 1385 1388 { 1386 #ifdef DBGFTRACE_ENABLED1387 RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-raw ff %08x/%08x pre", pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions);1388 #endif1389 1389 rc = emR3RawForcedActions(pVM, pVCpu, pCtx); 1390 VBOXVMMR3_EM_FF_RAW_RET(pVCpu, rc); 1390 1391 if (rc != VINF_SUCCESS) 1391 1392 break; … … 1418 1419 { 1419 1420 rc = emR3RawForcedActions(pVM, pVCpu, pCtx); 1421 VBOXVMMR3_EM_FF_RAW_RET(pVCpu, rc); 1420 1422 if (rc != VINF_SUCCESS) 1421 1423 { … … 1451 1453 { 1452 1454 STAM_PROFILE_START(&pVCpu->em.s.StatRAWExec, c); 1455 VBOXVMMR3_EM_RAW_RUN_PRE(pVCpu, pCtx); 1453 1456 rc = VMMR3RawRunGC(pVM, pVCpu); 1457 VBOXVMMR3_EM_RAW_RUN_RET(pVCpu, pCtx, rc); 1454 1458 STAM_PROFILE_STOP(&pVCpu->em.s.StatRAWExec, c); 1455 #ifdef DBGFTRACE_ENABLED1456 RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-raw run => %d", rc);1457 #endif1458 1459 } 1459 1460 else … … 1549 1550 { 1550 1551 Assert(pCtx->eflags.Bits.u1VM || (pCtx->ss & X86_SEL_RPL) != 1); 1551 #ifdef DBGFTRACE_ENABLED1552 RTTraceBufAddMsgF(pVM->CTX_SUFF(hTraceBuf), "em-raw ff %08x/%08x post", pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions);1553 #endif1554 1552 1555 1553 STAM_REL_PROFILE_ADV_SUSPEND(&pVCpu->em.s.StatRAWTotal, a); 1556 1554 rc = emR3ForcedActions(pVM, pVCpu, rc); 1555 VBOXVMMR3_EM_FF_ALL_RET(pVCpu, rc); 1557 1556 STAM_REL_PROFILE_ADV_RESUME(&pVCpu->em.s.StatRAWTotal, a); 1558 1557 if ( rc != VINF_SUCCESS
Note:
See TracChangeset
for help on using the changeset viewer.