Changeset 76490 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Dec 27, 2018 5:12:59 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r76469 r76490 1234 1234 1235 1235 /** 1236 * Checks whether VMX nested-guest may be executed using hardware-assisted VMX (e.g,1237 * using HM or NEM).1238 * 1239 * @returns @c true if hardware-assisted VMX nested-guestis allowed, @c false1240 * otherwise.1236 * Checks whether nested-guest execution using hardware-assisted VMX (e.g, using HM 1237 * or NEM) is allowed. 1238 * 1239 * @returns @c true if hardware-assisted nested-guest execution is allowed, @c false 1240 * otherwise. 1241 1241 * @param pVM The cross context VM structure. 1242 1242 */ 1243 static bool cpumR3IsHwAssist VmxNstGstExecAllowed(PVM pVM)1243 static bool cpumR3IsHwAssistNstGstExecAllowed(PVM pVM) 1244 1244 { 1245 1245 AssertMsg(pVM->bMainExecutionEngine != VM_EXEC_ENGINE_NOT_SET, ("Calling this function too early!\n")); … … 1270 1270 static void cpumR3InitVmxGuestMsrs(PVM pVM, PCVMXMSRS pHostVmxMsrs, PCCPUMFEATURES pGuestFeatures, PVMXMSRS pGuestVmxMsrs) 1271 1271 { 1272 Assert(!cpumR3IsHwAssistVmxNstGstExecAllowed(pVM) || pHostVmxMsrs); 1272 bool const fIsNstGstHwExecAllowed = cpumR3IsHwAssistNstGstExecAllowed(pVM); 1273 1274 Assert(!fIsNstGstHwExecAllowed || pHostVmxMsrs); 1273 1275 Assert(pGuestFeatures->fVmx); 1274 1276 … … 1402 1404 /* Miscellaneous data. */ 1403 1405 { 1404 uint64_t const uHostMsr = cpumR3IsHwAssistVmxNstGstExecAllowed(pVM)? pHostVmxMsrs->u64Misc : 0;1406 uint64_t const uHostMsr = fIsNstGstHwExecAllowed ? pHostVmxMsrs->u64Misc : 0; 1405 1407 1406 1408 uint8_t const cMaxMsrs = RT_MIN(RT_BF_GET(uHostMsr, VMX_BF_MISC_MAX_MSRS), VMX_V_AUTOMSR_COUNT_MAX); … … 1424 1426 /* CR0 Fixed-1. */ 1425 1427 { 1426 uint64_t const uHostMsr = cpumR3IsHwAssistVmxNstGstExecAllowed(pVM)? pHostVmxMsrs->u64Cr0Fixed1 : 0;1428 uint64_t const uHostMsr = fIsNstGstHwExecAllowed ? pHostVmxMsrs->u64Cr0Fixed1 : 0; 1427 1429 pGuestVmxMsrs->u64Cr0Fixed1 = uHostMsr | VMX_V_CR0_FIXED0; /* Make sure the CR0 MB1 bits are not clear. */ 1428 1430 } … … 1433 1435 /* CR4 Fixed-1. */ 1434 1436 { 1435 uint64_t const uHostMsr = cpumR3IsHwAssistVmxNstGstExecAllowed(pVM)? pHostVmxMsrs->u64Cr4Fixed1 : 0;1437 uint64_t const uHostMsr = fIsNstGstHwExecAllowed ? pHostVmxMsrs->u64Cr4Fixed1 : 0; 1436 1438 pGuestVmxMsrs->u64Cr4Fixed1 = uHostMsr | VMX_V_CR4_FIXED0; /* Make sure the CR4 MB1 bits are not clear. */ 1437 1439 } … … 1630 1632 * by the hardware, hence we merge our emulated features with the host features below. 1631 1633 */ 1632 PCCPUMFEATURES pBaseFeat = cpumR3IsHwAssist VmxNstGstExecAllowed(pVM) ? &pVM->cpum.s.HostFeatures : &EmuFeat;1634 PCCPUMFEATURES pBaseFeat = cpumR3IsHwAssistNstGstExecAllowed(pVM) ? &pVM->cpum.s.HostFeatures : &EmuFeat; 1633 1635 PCPUMFEATURES pGuestFeat = &pVM->cpum.s.GuestFeatures; 1634 1636 Assert(pBaseFeat->fVmx);
Note:
See TracChangeset
for help on using the changeset viewer.