Changeset 32953 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 6, 2010 3:53:27 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66452
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EM.cpp
r32952 r32953 55 55 #include <VBox/patm.h> 56 56 #include "EMInternal.h" 57 #include "include/internal/em.h" 57 58 #include <VBox/vm.h> 58 59 #include <VBox/cpumdis.h> … … 960 961 * Execute REM. 961 962 */ 962 STAM_PROFILE_START(&pVCpu->em.s.StatREMExec, c); 963 rc = REMR3Run(pVM, pVCpu); 964 STAM_PROFILE_STOP(&pVCpu->em.s.StatREMExec, c); 965 963 if (RT_LIKELY(EMR3IsExecutionAllowed(pVM, pVCpu))) 964 { 965 STAM_PROFILE_START(&pVCpu->em.s.StatREMExec, c); 966 rc = REMR3Run(pVM, pVCpu); 967 STAM_PROFILE_STOP(&pVCpu->em.s.StatREMExec, c); 968 } 969 else 970 { 971 /* Give up this time slice; virtual time continues */ 972 STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatCapped, u); 973 RTThreadSleep(2); 974 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatCapped, u); 975 } 966 976 967 977 /* … … 1675 1685 * 1676 1686 */ 1677 bool emR3IsExecutionAllowed(PVM pVM, PVMCPU pVCpu)1687 VMMR3DECL(bool) EMR3IsExecutionAllowed(PVM pVM, PVMCPU pVCpu) 1678 1688 { 1679 1689 uint64_t u64UserTime, u64KernelTime; … … 2001 2011 */ 2002 2012 case EMSTATE_RAW: 2003 if (emR3IsExecutionAllowed(pVM, pVCpu)) 2004 { 2005 rc = emR3RawExecute(pVM, pVCpu, &fFFDone); 2006 } 2007 else 2008 { 2009 /* Give up this time slice; virtual time continues */ 2010 STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatCapped, u); 2011 RTThreadSleep(10); 2012 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatCapped, u); 2013 rc = VINF_SUCCESS; 2014 } 2013 rc = emR3RawExecute(pVM, pVCpu, &fFFDone); 2015 2014 break; 2016 2015 … … 2019 2018 */ 2020 2019 case EMSTATE_HWACC: 2021 if (emR3IsExecutionAllowed(pVM, pVCpu)) 2022 { 2023 rc = emR3HwAccExecute(pVM, pVCpu, &fFFDone); 2024 } 2025 else 2026 { 2027 /* Give up this time slice; virtual time continues */ 2028 STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatCapped, u); 2029 RTThreadSleep(10); 2030 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatCapped, u); 2031 rc = VINF_SUCCESS; 2032 } 2020 rc = emR3HwAccExecute(pVM, pVCpu, &fFFDone); 2033 2021 break; 2034 2022 … … 2037 2025 */ 2038 2026 case EMSTATE_REM: 2039 if (emR3IsExecutionAllowed(pVM, pVCpu)) 2040 { 2041 rc = emR3RemExecute(pVM, pVCpu, &fFFDone); 2042 Log2(("EMR3ExecuteVM: emR3RemExecute -> %Rrc\n", rc)); 2043 } 2044 else 2045 { 2046 /* Give up this time slice; virtual time continues */ 2047 STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatCapped, u); 2048 RTThreadSleep(10); 2049 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatCapped, u); 2050 rc = VINF_SUCCESS; 2051 } 2027 rc = emR3RemExecute(pVM, pVCpu, &fFFDone); 2028 Log2(("EMR3ExecuteVM: emR3RemExecute -> %Rrc\n", rc)); 2052 2029 break; 2053 2030 -
trunk/src/VBox/VMM/EMHwaccm.cpp
r29329 r32953 53 53 #include <VBox/hwaccm.h> 54 54 #include "EMInternal.h" 55 #include "include/internal/em.h" 55 56 #include <VBox/vm.h> 56 57 #include <VBox/cpumdis.h> … … 544 545 */ 545 546 STAM_PROFILE_ADV_STOP(&pVCpu->em.s.StatHwAccEntry, a); 546 STAM_PROFILE_START(&pVCpu->em.s.StatHwAccExec, x); 547 rc = VMMR3HwAccRunGC(pVM, pVCpu); 548 STAM_PROFILE_STOP(&pVCpu->em.s.StatHwAccExec, x); 547 548 if (RT_LIKELY(EMR3IsExecutionAllowed(pVM, pVCpu))) 549 { 550 STAM_PROFILE_START(&pVCpu->em.s.StatHwAccExec, x); 551 rc = VMMR3HwAccRunGC(pVM, pVCpu); 552 STAM_PROFILE_STOP(&pVCpu->em.s.StatHwAccExec, x); 553 } 554 else 555 { 556 /* Give up this time slice; virtual time continues */ 557 STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatCapped, u); 558 RTThreadSleep(2); 559 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatCapped, u); 560 } 561 549 562 550 563 /* -
trunk/src/VBox/VMM/EMRaw.cpp
r31636 r32953 54 54 #include <VBox/patm.h> 55 55 #include "EMInternal.h" 56 #include "include/internal/em.h" 56 57 #include <VBox/vm.h> 57 58 #include <VBox/cpumdis.h> … … 1528 1529 */ 1529 1530 STAM_PROFILE_ADV_STOP(&pVCpu->em.s.StatRAWEntry, b); 1530 STAM_PROFILE_START(&pVCpu->em.s.StatRAWExec, c); 1531 rc = VMMR3RawRunGC(pVM, pVCpu); 1532 STAM_PROFILE_STOP(&pVCpu->em.s.StatRAWExec, c); 1531 if (RT_LIKELY(EMR3IsExecutionAllowed(pVM, pVCpu))) 1532 { 1533 STAM_PROFILE_START(&pVCpu->em.s.StatRAWExec, c); 1534 rc = VMMR3RawRunGC(pVM, pVCpu); 1535 STAM_PROFILE_STOP(&pVCpu->em.s.StatRAWExec, c); 1536 } 1537 else 1538 { 1539 /* Give up this time slice; virtual time continues */ 1540 STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatCapped, u); 1541 RTThreadSleep(2); 1542 STAM_REL_PROFILE_ADV_STOP(&pVCpu->em.s.StatCapped, u); 1543 } 1533 1544 STAM_PROFILE_ADV_START(&pVCpu->em.s.StatRAWTail, d); 1534 1545 -
trunk/src/VBox/VMM/include/internal/em.h
r32912 r32953 24 24 VMMR3DECL(int) EMR3NotifySuspend(PVM pVM); 25 25 26 VMMR3DECL(bool) EMR3IsExecutionAllowed(PVM pVM, PVMCPU pVCpu); 27 26 28 #endif
Note:
See TracChangeset
for help on using the changeset viewer.