Changeset 80911 in vbox
- Timestamp:
- Sep 20, 2019 5:20:00 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 133487
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r80871 r80911 94 94 DECLR0CALLBACKMEMBER(int, pfnEnableCpu, (PHMPHYSCPU pHostCpu, PVMCC pVM, void *pvCpuPage, RTHCPHYS HCPhysCpuPage, 95 95 bool fEnabledByHost, PCSUPHWVIRTMSRS pHwvirtMsrs)); 96 DECLR0CALLBACKMEMBER(int, pfnDisableCpu, ( void *pvCpuPage, RTHCPHYS HCPhysCpuPage));96 DECLR0CALLBACKMEMBER(int, pfnDisableCpu, (PHMPHYSCPU pHostCpu, void *pvCpuPage, RTHCPHYS HCPhysCpuPage)); 97 97 DECLR0CALLBACKMEMBER(int, pfnInitVM, (PVMCC pVM)); 98 98 DECLR0CALLBACKMEMBER(int, pfnTermVM, (PVMCC pVM)); … … 246 246 } 247 247 248 static DECLCALLBACK(int) hmR0DummyDisableCpu( void *pvCpuPage, RTHCPHYS HCPhysCpuPage)249 { 250 RT_NOREF 2(pvCpuPage, HCPhysCpuPage);248 static DECLCALLBACK(int) hmR0DummyDisableCpu(PHMPHYSCPU pHostCpu, void *pvCpuPage, RTHCPHYS HCPhysCpuPage) 249 { 250 RT_NOREF3(pHostCpu, pvCpuPage, HCPhysCpuPage); 251 251 return VINF_SUCCESS; 252 252 } … … 997 997 if (pHostCpu->fConfigured) 998 998 { 999 rc = g_HmR0.pfnDisableCpu(pHostCpu ->pvMemObj, pHostCpu->HCPhysMemObj);999 rc = g_HmR0.pfnDisableCpu(pHostCpu, pHostCpu->pvMemObj, pHostCpu->HCPhysMemObj); 1000 1000 AssertRCReturn(rc, rc); 1001 1001 -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r80587 r80911 588 588 * 589 589 * @returns VBox status code. 590 * @param pHostCpu The HM physical-CPU structure. 590 591 * @param pvCpuPage Pointer to the global CPU page. 591 592 * @param HCPhysCpuPage Physical address of the global CPU page. 592 593 */ 593 VMMR0DECL(int) SVMR0DisableCpu(void *pvCpuPage, RTHCPHYS HCPhysCpuPage) 594 { 594 VMMR0DECL(int) SVMR0DisableCpu(PHMPHYSCPU pHostCpu, void *pvCpuPage, RTHCPHYS HCPhysCpuPage) 595 { 596 RT_NOREF1(pHostCpu); 595 597 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 596 598 AssertReturn( HCPhysCpuPage -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.h
r80587 r80911 44 44 VMMR0DECL(int) SVMR0EnableCpu(PHMPHYSCPU pHostCpu, PVMCC pVM, void *pvPageCpu, RTHCPHYS HCPhysCpuPage, 45 45 bool fEnabledBySystem, PCSUPHWVIRTMSRS pHwvirtMsrs); 46 VMMR0DECL(int) SVMR0DisableCpu( void *pvPageCpu, RTHCPHYS pPageCpuPhys);46 VMMR0DECL(int) SVMR0DisableCpu(PHMPHYSCPU pHostCpu, void *pvPageCpu, RTHCPHYS pPageCpuPhys); 47 47 VMMR0DECL(int) SVMR0InitVM(PVMCC pVM); 48 48 VMMR0DECL(int) SVMR0TermVM(PVMCC pVM); -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r80871 r80911 1591 1591 * 1592 1592 * @returns VBox status code. 1593 * @param pHostCpu The HM physical-CPU structure. 1593 1594 * @param pVM The cross context VM structure. Can be 1594 1595 * NULL, after a resume. … … 1596 1597 * @param pvCpuPage Pointer to the VMXON region. 1597 1598 */ 1598 static int hmR0VmxEnterRootMode(PVMCC pVM, RTHCPHYS HCPhysCpuPage, void *pvCpuPage) 1599 { 1599 static int hmR0VmxEnterRootMode(PHMPHYSCPU pHostCpu, PVMCC pVM, RTHCPHYS HCPhysCpuPage, void *pvCpuPage) 1600 { 1601 Assert(pHostCpu); 1600 1602 Assert(HCPhysCpuPage && HCPhysCpuPage != NIL_RTHCPHYS); 1601 1603 Assert(RT_ALIGN_T(HCPhysCpuPage, _4K, RTHCPHYS) == HCPhysCpuPage); … … 1615 1617 RTCCUINTREG const uOldCr4 = SUPR0ChangeCR4(X86_CR4_VMXE, RTCCUINTREG_MAX); 1616 1618 1619 /* Record whether VMXE was already prior to us enabling it above. */ 1620 pHostCpu->fVmxeAlreadyEnabled = RT_BOOL(uOldCr4 & X86_CR4_VMXE); 1621 1617 1622 /* Enter VMX root mode. */ 1618 1623 int rc = VMXEnable(HCPhysCpuPage); … … 1620 1625 { 1621 1626 /* Restore CR4.VMXE if it was not set prior to our attempt to set it above. */ 1622 if (! (uOldCr4 & X86_CR4_VMXE))1627 if (!pHostCpu->fVmxeAlreadyEnabled) 1623 1628 SUPR0ChangeCR4(0 /* fOrMask */, ~(uint64_t)X86_CR4_VMXE); 1624 1629 … … 1637 1642 * 1638 1643 * @returns VBox status code. 1639 */ 1640 static int hmR0VmxLeaveRootMode(void) 1644 * @param pHostCpu The HM physical-CPU structure. 1645 */ 1646 static int hmR0VmxLeaveRootMode(PHMPHYSCPU pHostCpu) 1641 1647 { 1642 1648 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); … … 1653 1659 /* Exit VMX root mode and clear the VMX bit in CR4. */ 1654 1660 VMXDisable(); 1655 SUPR0ChangeCR4(0 /* fOrMask */, ~(uint64_t)X86_CR4_VMXE); 1661 1662 /* Clear CR4.VMXE only if it was clear prior to use setting it. */ 1663 if (!pHostCpu->fVmxeAlreadyEnabled) 1664 SUPR0ChangeCR4(0 /* fOrMask */, ~(uint64_t)X86_CR4_VMXE); 1665 1656 1666 rc = VINF_SUCCESS; 1657 1667 } … … 4119 4129 if (!fEnabledByHost) 4120 4130 { 4121 int rc = hmR0VmxEnterRootMode(p VM, HCPhysCpuPage, pvCpuPage);4131 int rc = hmR0VmxEnterRootMode(pHostCpu, pVM, HCPhysCpuPage, pvCpuPage); 4122 4132 if (RT_FAILURE(rc)) 4123 4133 return rc; … … 4148 4158 * 4149 4159 * @returns VBox status code. 4160 * @param pHostCpu The HM physical-CPU structure. 4150 4161 * @param pvCpuPage Pointer to the VMXON region. 4151 4162 * @param HCPhysCpuPage Physical address of the VMXON region. … … 4154 4165 * similar was used to enable VT-x on the host. 4155 4166 */ 4156 VMMR0DECL(int) VMXR0DisableCpu( void *pvCpuPage, RTHCPHYS HCPhysCpuPage)4167 VMMR0DECL(int) VMXR0DisableCpu(PHMPHYSCPU pHostCpu, void *pvCpuPage, RTHCPHYS HCPhysCpuPage) 4157 4168 { 4158 4169 RT_NOREF2(pvCpuPage, HCPhysCpuPage); 4159 4170 4160 4171 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 4161 return hmR0VmxLeaveRootMode( );4172 return hmR0VmxLeaveRootMode(pHostCpu); 4162 4173 } 4163 4174 -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.h
r80587 r80911 36 36 VMMR0DECL(int) VMXR0EnableCpu(PHMPHYSCPU pHostCpu, PVMCC pVM, void *pvPageCpu, RTHCPHYS pPageCpuPhys, 37 37 bool fEnabledBySystem, PCSUPHWVIRTMSRS pHwvirtMsrs); 38 VMMR0DECL(int) VMXR0DisableCpu( void *pvPageCpu, RTHCPHYS pPageCpuPhys);38 VMMR0DECL(int) VMXR0DisableCpu(PHMPHYSCPU pHostCpu, void *pvPageCpu, RTHCPHYS pPageCpuPhys); 39 39 VMMR0DECL(int) VMXR0GlobalInit(void); 40 40 VMMR0DECL(void) VMXR0GlobalTerm(void); -
trunk/src/VBox/VMM/include/HMInternal.h
r80740 r80911 275 275 /** Set if the VBOX_HWVIRTEX_IGNORE_SVM_IN_USE hack is active. */ 276 276 bool fIgnoreAMDVInUseError; 277 /** Whether CR4.VMXE was already enabled prior to us enabling it. */ 278 bool fVmxeAlreadyEnabled; 277 279 /** In use by our code. (for power suspend) */ 278 280 bool volatile fInUse;
Note:
See TracChangeset
for help on using the changeset viewer.