Changeset 47803 in vbox for trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
- Timestamp:
- Aug 16, 2013 11:58:57 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r47802 r47803 1620 1620 Assert(pVCpu->hm.s.fContextUseFlags & (HM_CHANGED_HOST_CONTEXT | HM_CHANGED_GUEST_CR0)); 1621 1621 1622 pVCpu->hm.s.fLeaveDone = false; 1622 1623 RTThreadPreemptRestore(&PreemptState); 1623 1624 break; … … 1895 1896 RTThreadPreemptDisable(&PreemptState); 1896 1897 fPreemptDisabled = true; 1897 if (pVCpu->hm.s.fLeaveDone)1898 { 1899 RTThreadPreemptRestore(&PreemptState);1900 return;1901 }1902 }1903 1904 /* Restore host FPU state if necessary and resync on next R0 reentry .*/1905 if (CPUMIsGuestFPUStateActive(pVCpu))1906 {1907 CPUMR0SaveGuestFPU(pVM, pVCpu, pCtx);1908 Assert(!CPUMIsGuestFPUStateActive(pVCpu)); 1909 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0;1910 }1911 1912 /*1913 * Restore host debug registers if necessary and resync on next R0 reentry.1914 */1915 #ifdef VBOX_STRICT 1916 if (CPUMIsHyperDebugStateActive(pVCpu))1917 {1918 PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb;1919 Assert(pVmcb->ctrl.u16InterceptRdDRx == 0xffff);1920 Assert(pVmcb->ctrl.u16InterceptWrDRx == 0xffff);1921 }1922 #endif 1923 if (CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(pVCpu, false /* save DR6 */))1924 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_DEBUG;1925 1926 Assert(!CPUMIsHyperDebugStateActive(pVCpu));1927 Assert(!CPUMIsGuestDebugStateActive(pVCpu));1928 1929 STAM_PROFILE_ADV_SET_STOPPED(&pVCpu->hm.s.StatEntry);1930 STAM_PROFILE_ADV_SET_STOPPED(&pVCpu->hm.s.StatLoadGuestState);1931 STAM_PROFILE_ADV_SET_STOPPED(&pVCpu->hm.s.StatExit1); 1932 STAM_PROFILE_ADV_SET_STOPPED(&pVCpu->hm.s.StatExit2);1933 STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchLongJmpToR3); 1934 1935 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_HM, VMCPUSTATE_STARTED_EXEC);1898 } 1899 1900 if (!pVCpu->hm.s.fLeaveDone) 1901 { 1902 /* Restore host FPU state if necessary and resync on next R0 reentry .*/ 1903 if (CPUMIsGuestFPUStateActive(pVCpu)) 1904 { 1905 CPUMR0SaveGuestFPU(pVM, pVCpu, pCtx); 1906 Assert(!CPUMIsGuestFPUStateActive(pVCpu)); 1907 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_CR0; 1908 } 1909 1910 /* 1911 * Restore host debug registers if necessary and resync on next R0 reentry. 1912 */ 1913 #ifdef VBOX_STRICT 1914 if (CPUMIsHyperDebugStateActive(pVCpu)) 1915 { 1916 PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb; 1917 Assert(pVmcb->ctrl.u16InterceptRdDRx == 0xffff); 1918 Assert(pVmcb->ctrl.u16InterceptWrDRx == 0xffff); 1919 } 1920 #endif 1921 if (CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(pVCpu, false /* save DR6 */)) 1922 pVCpu->hm.s.fContextUseFlags |= HM_CHANGED_GUEST_DEBUG; 1923 1924 Assert(!CPUMIsHyperDebugStateActive(pVCpu)); 1925 Assert(!CPUMIsGuestDebugStateActive(pVCpu)); 1926 1927 STAM_PROFILE_ADV_SET_STOPPED(&pVCpu->hm.s.StatEntry); 1928 STAM_PROFILE_ADV_SET_STOPPED(&pVCpu->hm.s.StatLoadGuestState); 1929 STAM_PROFILE_ADV_SET_STOPPED(&pVCpu->hm.s.StatExit1); 1930 STAM_PROFILE_ADV_SET_STOPPED(&pVCpu->hm.s.StatExit2); 1931 STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchLongJmpToR3); 1932 1933 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_HM, VMCPUSTATE_STARTED_EXEC); 1934 1935 pVCpu->hm.s.fLeaveDone = true; 1936 } 1936 1937 1937 1938 /* Restore preemption if we previous disabled it ourselves. */ 1938 1939 if (fPreemptDisabled) 1939 {1940 pVCpu->hm.s.fLeaveDone = true;1941 1940 RTThreadPreemptRestore(&PreemptState); 1942 }1943 1941 } 1944 1942
Note:
See TracChangeset
for help on using the changeset viewer.