- Timestamp:
- Nov 9, 2009 10:21:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r24482 r24484 732 732 int *paRc = (int *)pvUser2; 733 733 734 if (!HWACCMR0Globals.fGlobalInit) 735 { 736 paRc[idCpu] = VINF_SUCCESS; 737 AssertFailed(); 738 return; 739 } 740 734 741 paRc[idCpu] = hwaccmR0EnableCpu(pVM, idCpu); 735 742 } … … 785 792 { 786 793 int *paRc = (int *)pvUser1; 794 795 if (!HWACCMR0Globals.fGlobalInit) 796 { 797 paRc[idCpu] = VINF_SUCCESS; 798 AssertFailed(); 799 return; 800 } 787 801 788 802 paRc[idCpu] = hwaccmR0DisableCpu(idCpu); … … 810 824 ASMAtomicWriteBool(&HWACCMR0Globals.fSuspended, true); 811 825 812 if ( HWACCMR0Globals.enmHwAccmState == HWACCMSTATE_ENABLED 813 && HWACCMR0Globals.fGlobalInit) 826 if (HWACCMR0Globals.enmHwAccmState == HWACCMSTATE_ENABLED) 814 827 { 815 828 int aRc[RTCPUSET_MAX_CPUS]; … … 820 833 if (enmEvent == RTPOWEREVENT_SUSPEND) 821 834 { 822 /* Turn off VT-x or AMD-V on all CPUs. */ 823 rc = RTMpOnAll(hwaccmR0DisableCpuCallback, aRc, NULL); 824 Assert(RT_SUCCESS(rc) || rc == VERR_NOT_SUPPORTED); 835 if (HWACCMR0Globals.fGlobalInit) 836 { 837 /* Turn off VT-x or AMD-V on all CPUs. */ 838 rc = RTMpOnAll(hwaccmR0DisableCpuCallback, aRc, NULL); 839 Assert(RT_SUCCESS(rc) || rc == VERR_NOT_SUPPORTED); 840 } 841 /* else nothing to do here for the local init case */ 825 842 } 826 843 else 827 844 { 828 /* Reinit the CPUs from scratch as the suspend state has messed with the MSRs.*/845 /* Reinit the CPUs from scratch as the suspend state might have messed with the MSRs. (lousy BIOSes as usual) */ 829 846 rc = RTMpOnAll(HWACCMR0InitCPU, (void *)((HWACCMR0Globals.vmx.fSupported) ? X86_CPUID_VENDOR_INTEL_EBX : X86_CPUID_VENDOR_AMD_EBX), aRc); 830 847 Assert(RT_SUCCESS(rc) || rc == VERR_NOT_SUPPORTED); … … 837 854 #endif 838 855 839 /* Turn VT-x or AMD-V back on on all CPUs. */ 840 rc = RTMpOnAll(hwaccmR0EnableCpuCallback, NULL, aRc); 841 Assert(RT_SUCCESS(rc) || rc == VERR_NOT_SUPPORTED); 856 if (HWACCMR0Globals.fGlobalInit) 857 { 858 /* Turn VT-x or AMD-V back on on all CPUs. */ 859 rc = RTMpOnAll(hwaccmR0EnableCpuCallback, NULL, aRc); 860 Assert(RT_SUCCESS(rc) || rc == VERR_NOT_SUPPORTED); 861 } 862 /* else nothing to do here for the local init case */ 842 863 } 843 864 }
Note:
See TracChangeset
for help on using the changeset viewer.