- Timestamp:
- Oct 23, 2008 8:15:56 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 38352
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r13514 r13516 129 129 130 130 HWACCMSTATE enmHwAccmState; 131 132 bool fSuspended; 131 133 } HWACCMR0Globals; 132 134 … … 526 528 { 527 529 Assert(sizeof(HWACCMR0Globals.enmHwAccmState) == sizeof(uint32_t)); 530 531 /* Make sure we don't touch hwaccm after we've disabled hwaccm in preparation of a suspend. */ 532 if (HWACCMR0Globals.fSuspended) 533 return VERR_HWACCM_SUSPEND_PENDING; 534 528 535 if (ASMAtomicCmpXchgU32((volatile uint32_t *)&HWACCMR0Globals.enmHwAccmState, enmNewHwAccmState, HWACCMSTATE_UNINITIALIZED)) 529 536 { … … 677 684 SUPR0Printf("hwaccmR0PowerCallback RTPOWEREVENT_RESUME\n"); 678 685 #endif 686 687 if (enmEvent == RTPOWEREVENT_SUSPEND) 688 HWACCMR0Globals.fSuspended = true; 679 689 680 690 if (HWACCMR0Globals.enmHwAccmState == HWACCMSTATE_ENABLED) … … 709 719 } 710 720 } 721 if (enmEvent == RTPOWEREVENT_RESUME) 722 HWACCMR0Globals.fSuspended = false; 711 723 } 712 724 … … 728 740 SUPR0Printf("HWACCMR0InitVM: %p\n", pVM); 729 741 #endif 742 743 /* Make sure we don't touch hwaccm after we've disabled hwaccm in preparation of a suspend. */ 744 if (HWACCMR0Globals.fSuspended) 745 return VERR_HWACCM_SUSPEND_PENDING; 730 746 731 747 pVM->hwaccm.s.vmx.fSupported = HWACCMR0Globals.vmx.fSupported; … … 783 799 #endif 784 800 801 /* Make sure we don't touch hwaccm after we've disabled hwaccm in preparation of a suspend. */ 802 if (HWACCMR0Globals.fSuspended) 803 return VERR_HWACCM_SUSPEND_PENDING; 804 785 805 /* Terminate a VT-x or AMD-V VM. */ 786 806 return HWACCMR0Globals.pfnTermVM(pVM); … … 797 817 { 798 818 AssertReturn(pVM, VERR_INVALID_PARAMETER); 819 820 /* Make sure we don't touch hwaccm after we've disabled hwaccm in preparation of a suspend. */ 821 if (HWACCMR0Globals.fSuspended) 822 return VERR_HWACCM_SUSPEND_PENDING; 799 823 800 824 #ifdef LOG_ENABLED … … 818 842 int rc; 819 843 RTCPUID idCpu = RTMpCpuId(); 844 845 /* Make sure we can't enter a session after we've disabled hwaccm in preparation of a suspend. */ 846 if (HWACCMR0Globals.fSuspended) 847 return VINF_EM_RAW_INTERRUPT; 820 848 821 849 rc = CPUMQueryGuestCtxPtr(pVM, &pCtx); … … 869 897 int rc; 870 898 899 AssertReturn(!HWACCMR0Globals.fSuspended, VERR_HWACCM_SUSPEND_PENDING); 900 871 901 rc = CPUMQueryGuestCtxPtr(pVM, &pCtx); 872 902 if (VBOX_FAILURE(rc)) … … 912 942 Assert(!VM_FF_ISPENDING(pVM, VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL)); 913 943 Assert(HWACCMR0Globals.aCpuInfo[idCpu].fConfigured); 944 AssertReturn(!HWACCMR0Globals.fSuspended, VERR_HWACCM_SUSPEND_PENDING); 914 945 915 946 rc = CPUMQueryGuestCtxPtr(pVM, &pCtx);
Note:
See TracChangeset
for help on using the changeset viewer.