Changeset 73389 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jul 28, 2018 7:03:03 AM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp
r73290 r73389 1292 1292 { 1293 1293 RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1294 if (pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures.fVmx) 1294 PCCPUMFEATURES pGuestFeatures = &pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures; 1295 if (pGuestFeatures->fVmx) 1295 1296 { 1296 uint64_t const fVmcsRevisionId = VMX_VMCS_REVISION_ID; 1297 uint64_t const f32BitAddrLimit = 0; 1298 uint64_t const fDualMonSmiSmm = 0; 1299 uint64_t const fVmcsMemType = VMX_VMCS_MEM_TYPE_WB; 1300 uint64_t const fVmcsInsOutsInfo = pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures.fVmxInsOutInfo; 1301 uint64_t const fTrueCapMsrs = 0; 1302 *puValue = fVmcsRevisionId 1303 | (f32BitAddrLimit << MSR_IA32_VMX_BASIC_VMCS_PHYS_WIDTH_SHIFT) 1304 | (fDualMonSmiSmm << MSR_IA32_VMX_BASIC_DUAL_MON_SHIFT) 1305 | (fVmcsMemType << MSR_IA32_VMX_BASIC_VMCS_MEM_TYPE_SHIFT) 1306 | (fVmcsInsOutsInfo << MSR_IA32_VMX_BASIC_VMCS_INS_OUTS_SHIFT) 1307 | (fTrueCapMsrs << MSR_IA32_VMX_BASIC_TRUE_CONTROLS_SHIFT); 1297 *puValue = RT_BF_MAKE(VMX_BF_BASIC_VMCS_ID, VMX_VMCS_REVISION_ID ) 1298 | RT_BF_MAKE(VMX_BF_BASIC_DUAL_MON, 0 ) 1299 | RT_BF_MAKE(VMX_BF_BASIC_VMCS_MEM_TYPE, VMX_BASIC_MEM_TYPE_WB ) 1300 | RT_BF_MAKE(VMX_BF_BASIC_VMCS_INS_OUTS, pGuestFeatures->fVmxInsOutInfo) 1301 | RT_BF_MAKE(VMX_BF_BASIC_TRUE_CTLS, 0 ); 1308 1302 } 1309 1303 else … … 1316 1310 static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxPinbasedCtls(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue) 1317 1311 { 1318 RT_NOREF_PV(pVCpu); RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1319 *puValue = 0; 1312 RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1313 PCCPUMFEATURES pGuestFeatures = &pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures; 1314 if (pGuestFeatures->fVmx) 1315 { 1316 uint32_t const fFeatures = (pGuestFeatures->fVmxExtIntExit << VMX_BF_PIN_CTLS_EXT_INT_EXIT_SHIFT ) 1317 | (pGuestFeatures->fVmxNmiExit << VMX_BF_PIN_CTLS_NMI_EXIT_SHIFT ) 1318 | (pGuestFeatures->fVmxVirtNmi << VMX_BF_PIN_CTLS_VIRT_NMI_SHIFT ) 1319 | (pGuestFeatures->fVmxPreemptTimer << VMX_BF_PIN_CTLS_PREEMPT_TIMER_SHIFT); 1320 uint32_t const fVal = VMX_PIN_CTLS_DEFAULT1; 1321 uint32_t const fZap = fFeatures | VMX_PIN_CTLS_DEFAULT1; 1322 AssertMsgReturn((fVal & fZap) == fVal, ("fVal=%#RX32 fZap=%#RX32 fFeatures=%#RX32\n", fVal, fZap, fFeatures), 1323 VERR_CPUM_INVALID_HWVIRT_FEAT_COMBO); 1324 *puValue = RT_MAKE_U64(fVal, fZap); 1325 } 1326 else 1327 *puValue = 0; 1320 1328 return VINF_SUCCESS; 1321 1329 } … … 1325 1333 static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxProcbasedCtls(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue) 1326 1334 { 1327 RT_NOREF_PV(pVCpu); RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1328 *puValue = 0; 1335 RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1336 PCCPUMFEATURES pGuestFeatures = &pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures; 1337 if (pGuestFeatures->fVmx) 1338 { 1339 uint32_t const fFeatures = (pGuestFeatures->fVmxIntWindowExit << VMX_BF_PROC_CTLS_INT_WINDOW_EXIT_SHIFT ) 1340 | (pGuestFeatures->fVmxTscOffsetting << VMX_BF_PROC_CTLS_USE_TSC_OFFSETTING_SHIFT) 1341 | (pGuestFeatures->fVmxHltExit << VMX_BF_PROC_CTLS_HLT_EXIT_SHIFT ) 1342 | (pGuestFeatures->fVmxInvlpgExit << VMX_BF_PROC_CTLS_INVLPG_EXIT_SHIFT ) 1343 | (pGuestFeatures->fVmxMwaitExit << VMX_BF_PROC_CTLS_MWAIT_EXIT_SHIFT ) 1344 | (pGuestFeatures->fVmxRdpmcExit << VMX_BF_PROC_CTLS_RDPMC_EXIT_SHIFT ) 1345 | (pGuestFeatures->fVmxRdtscExit << VMX_BF_PROC_CTLS_RDTSC_EXIT_SHIFT ) 1346 | (pGuestFeatures->fVmxCr3LoadExit << VMX_BF_PROC_CTLS_CR3_LOAD_EXIT_SHIFT ) 1347 | (pGuestFeatures->fVmxCr3StoreExit << VMX_BF_PROC_CTLS_CR3_STORE_EXIT_SHIFT ) 1348 | (pGuestFeatures->fVmxCr8LoadExit << VMX_BF_PROC_CTLS_CR8_LOAD_EXIT_SHIFT ) 1349 | (pGuestFeatures->fVmxCr8StoreExit << VMX_BF_PROC_CTLS_CR8_STORE_EXIT_SHIFT ) 1350 | (pGuestFeatures->fVmxTprShadow << VMX_BF_PROC_CTLS_USE_TPR_SHADOW_SHIFT ) 1351 | (pGuestFeatures->fVmxNmiWindowExit << VMX_BF_PROC_CTLS_NMI_WINDOW_EXIT_SHIFT ) 1352 | (pGuestFeatures->fVmxMovDRxExit << VMX_BF_PROC_CTLS_MOV_DR_EXIT_SHIFT ) 1353 | (pGuestFeatures->fVmxUncondIoExit << VMX_BF_PROC_CTLS_UNCOND_IO_EXIT_SHIFT ) 1354 | (pGuestFeatures->fVmxUseIoBitmaps << VMX_BF_PROC_CTLS_USE_IO_BITMAPS_SHIFT ) 1355 | (pGuestFeatures->fVmxMonitorTrapFlag << VMX_BF_PROC_CTLS_MONITOR_TRAP_FLAG_SHIFT ) 1356 | (pGuestFeatures->fVmxUseMsrBitmaps << VMX_BF_PROC_CTLS_USE_MSR_BITMAPS_SHIFT ) 1357 | (pGuestFeatures->fVmxMonitorExit << VMX_BF_PROC_CTLS_MONITOR_EXIT_SHIFT ) 1358 | (pGuestFeatures->fVmxPauseExit << VMX_BF_PROC_CTLS_PAUSE_EXIT_SHIFT ) 1359 | (pGuestFeatures->fVmxSecondaryExecCtls << VMX_BF_PROC_CTLS_USE_SECONDARY_CTLS_SHIFT); 1360 uint32_t const fVal = VMX_PROC_CTLS_DEFAULT1; 1361 uint32_t const fZap = fFeatures | VMX_PROC_CTLS_DEFAULT1; 1362 AssertMsgReturn((fVal & fZap) == fVal, ("fVal=%#RX32 fZap=%#RX32 fFeatures=%#RX32\n", fVal, fZap, fFeatures), 1363 VERR_CPUM_INVALID_HWVIRT_FEAT_COMBO); 1364 *puValue = RT_MAKE_U64(fVal, fZap); 1365 } 1366 else 1367 *puValue = 0; 1329 1368 return VINF_SUCCESS; 1330 1369 } … … 1334 1373 static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxExitCtls(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue) 1335 1374 { 1336 RT_NOREF_PV(pVCpu); RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1337 *puValue = 0; 1375 RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1376 PCCPUMFEATURES pGuestFeatures = &pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures; 1377 if (pGuestFeatures->fVmx) 1378 { 1379 uint32_t const fFeatures = (pGuestFeatures->fVmxExitSaveDebugCtls << VMX_BF_EXIT_CTLS_SAVE_DEBUG_SHIFT ) 1380 | (pGuestFeatures->fVmxHostAddrSpaceSize << VMX_BF_EXIT_CTLS_HOST_ADDR_SPACE_SIZE_SHIFT) 1381 | (pGuestFeatures->fVmxExitAckExtInt << VMX_BF_EXIT_CTLS_ACK_EXT_INT_SHIFT ) 1382 | (pGuestFeatures->fVmxExitSaveEferMsr << VMX_BF_EXIT_CTLS_SAVE_EFER_MSR_SHIFT ) 1383 | (pGuestFeatures->fVmxExitLoadEferMsr << VMX_BF_EXIT_CTLS_LOAD_EFER_MSR_SHIFT ) 1384 | (pGuestFeatures->fVmxSavePreemptTimer << VMX_BF_EXIT_CTLS_SAVE_PREEMPT_TIMER_SHIFT ); 1385 uint32_t const fVal = VMX_EXIT_CTLS_DEFAULT1; 1386 uint32_t const fZap = fFeatures | VMX_EXIT_CTLS_DEFAULT1; 1387 AssertMsgReturn((fVal & fZap) == fVal, ("fVal=%#RX32 fZap=%#RX32 fFeatures=%#RX32\n", fVal, fZap, fFeatures), 1388 VERR_CPUM_INVALID_HWVIRT_FEAT_COMBO); 1389 *puValue = RT_MAKE_U64(fVal, fZap); 1390 } 1391 else 1392 *puValue = 0; 1338 1393 return VINF_SUCCESS; 1339 1394 } … … 1343 1398 static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxEntryCtls(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue) 1344 1399 { 1345 RT_NOREF_PV(pVCpu); RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1346 *puValue = 0; 1400 RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1401 PCCPUMFEATURES pGuestFeatures = &pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures; 1402 if (pGuestFeatures->fVmx) 1403 { 1404 uint32_t const fFeatures = (pGuestFeatures->fVmxEntryLoadDebugCtls << VMX_BF_ENTRY_CTLS_LOAD_DEBUG_SHIFT ) 1405 | (pGuestFeatures->fVmxIa32eModeGuest << VMX_BF_ENTRY_CTLS_IA32E_MODE_GUEST_SHIFT) 1406 | (pGuestFeatures->fVmxEntryLoadEferMsr << VMX_BF_ENTRY_CTLS_LOAD_EFER_MSR_SHIFT ); 1407 uint32_t const fDefault1 = VMX_ENTRY_CTLS_DEFAULT1; 1408 uint32_t const fVal = fDefault1; 1409 uint32_t const fZap = fFeatures | fDefault1; 1410 AssertMsgReturn((fVal & fZap) == fVal, ("fVal=%#RX32 fZap=%#RX32 fFeatures=%#RX32\n", fVal, fZap, fFeatures), 1411 VERR_CPUM_INVALID_HWVIRT_FEAT_COMBO); 1412 *puValue = RT_MAKE_U64(fVal, fZap); 1413 } 1414 else 1415 *puValue = 0; 1347 1416 return VINF_SUCCESS; 1348 1417 } … … 1352 1421 static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxMisc(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue) 1353 1422 { 1354 RT_NOREF_PV(pVCpu); RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1355 *puValue = 0; 1423 RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1424 PCCPUMFEATURES pGuestFeatures = &pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures; 1425 if (pGuestFeatures->fVmx) 1426 { 1427 /** @todo Think about this especially preemption timer TSC shifts. */ 1428 *puValue = 0; 1429 } 1430 else 1431 *puValue = 0; 1356 1432 return VINF_SUCCESS; 1357 1433 } … … 1406 1482 static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxProcBasedCtls2(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue) 1407 1483 { 1408 RT_NOREF_PV(pVCpu); RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1409 *puValue = 0; 1484 RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 1485 PCCPUMFEATURES pGuestFeatures = &pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures; 1486 if (pGuestFeatures->fVmx) 1487 { 1488 uint32_t const fFeatures = (pGuestFeatures->fVmxVirtApicAccess << VMX_BF_PROC_CTLS2_VIRT_APIC_ACCESS_SHIFT ) 1489 | (pGuestFeatures->fVmxEpt << VMX_BF_PROC_CTLS2_EPT_SHIFT ) 1490 | (pGuestFeatures->fVmxDescTableExit << VMX_BF_PROC_CTLS2_DESC_TABLE_EXIT_SHIFT ) 1491 | (pGuestFeatures->fVmxRdtscp << VMX_BF_PROC_CTLS2_RDTSCP_SHIFT ) 1492 | (pGuestFeatures->fVmxVirtX2ApicAccess << VMX_BF_PROC_CTLS2_VIRT_X2APIC_ACCESS_SHIFT) 1493 | (pGuestFeatures->fVmxVpid << VMX_BF_PROC_CTLS2_VPID_SHIFT ) 1494 | (pGuestFeatures->fVmxWbinvdExit << VMX_BF_PROC_CTLS2_WBINVD_EXIT_SHIFT ) 1495 | (pGuestFeatures->fVmxUnrestrictedGuest << VMX_BF_PROC_CTLS2_UNRESTRICTED_GUEST_SHIFT) 1496 | (pGuestFeatures->fVmxPauseLoopExit << VMX_BF_PROC_CTLS2_PAUSE_LOOP_EXIT_SHIFT ) 1497 | (pGuestFeatures->fVmxInvpcid << VMX_BF_PROC_CTLS2_INVPCID_SHIFT ); 1498 uint32_t const fVal = 0; 1499 uint32_t const fZap = fFeatures; 1500 *puValue = RT_MAKE_U64(fVal, fZap); 1501 } 1502 else 1503 *puValue = 0; 1410 1504 return VINF_SUCCESS; 1411 1505 } -
trunk/src/VBox/VMM/VMMAll/HMAll.cpp
r73293 r73389 349 349 350 350 /** 351 * Checks if MSR bitmaps are a vailable. It is assumed that when it's available351 * Checks if MSR bitmaps are active. It is assumed that when it's available 352 352 * it will be used as well. 353 353 * … … 355 355 * @param pVM The cross context VM structure. 356 356 */ 357 VMM_INT_DECL(bool) HM AreMsrBitmapsAvailable(PVM pVM)357 VMM_INT_DECL(bool) HMIsMsrBitmapActive(PVM pVM) 358 358 { 359 359 if (HMIsEnabled(pVM)) … … 363 363 364 364 if ( pVM->hm.s.vmx.fSupported 365 && (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)) 366 { 365 && (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_MSR_BITMAPS)) 367 366 return true; 368 }369 367 } 370 368 return false; … … 389 387 * Checks if VT-x is active. 390 388 * 391 * @returns true if AMD-Vis active.389 * @returns true if VT-x is active. 392 390 * @param pVM The cross context VM structure. 393 391 * … … 396 394 VMM_INT_DECL(bool) HMIsVmxActive(PVM pVM) 397 395 { 398 return pVM->hm.s.vmx.fSupported && HMIsEnabled(pVM); 396 return HMIsVmxSupported(pVM) && HMIsEnabled(pVM); 397 } 398 399 400 /** 401 * Checks if VT-x is supported by the host CPU. 402 * 403 * @returns true if VT-x is supported, false otherwise. 404 * @param pVM The cross context VM structure. 405 * 406 * @remarks Works before hmR3InitFinalizeR0. 407 */ 408 VMM_INT_DECL(bool) HMIsVmxSupported(PVM pVM) 409 { 410 return pVM->hm.s.vmx.fSupported; 399 411 } 400 412 … … 544 556 545 557 558 /** 559 * Gets a copy of the VMX host MSRs that were read by HM during ring-0 560 * initialization. 561 * 562 * @return VBox status code. 563 * @param pVM The cross context VM structure. 564 * @param pVmxMsrs Where to store the VMXMSRS struct (only valid when 565 * VINF_SUCCESS is returned). 566 * 567 * @remarks Caller needs to take care not to call this function too early. Call 568 * after HM initialization is fully complete. 569 */ 570 VMM_INT_DECL(int) HMVmxGetHostMsrs(PVM pVM, PVMXMSRS pVmxMsrs) 571 { 572 AssertPtrReturn(pVM, VERR_INVALID_PARAMETER); 573 AssertPtrReturn(pVmxMsrs, VERR_INVALID_PARAMETER); 574 if (pVM->hm.s.vmx.fSupported) 575 { 576 *pVmxMsrs = pVM->hm.s.vmx.Msrs; 577 return VINF_SUCCESS; 578 } 579 return VERR_VMX_NOT_SUPPORTED; 580 } 581 582 583 #if 0 /** @todo Update comment hm_vmx.h VMXMSRS struct if this is removed. */ 584 /** 585 * Gets the specified VMX host MSR that was read by HM during ring-0 586 * initialization. 587 * 588 * @return VBox status code. 589 * @param pVM The cross context VM structure. 590 * @param idMsr The MSR. 591 * @param puValue Where to store the MSR value (only updated when VINF_SUCCESS 592 * is returned). 593 * 594 * @remarks Caller needs to take care not to call this function too early. Call 595 * after HM initialization is fully complete. 596 */ 597 VMM_INT_DECL(int) HMVmxGetHostMsr(PVM pVM, uint32_t idMsr, uint64_t *puValue) 598 { 599 AssertPtrReturn(pVM, VERR_INVALID_PARAMETER); 600 AssertPtrReturn(puValue, VERR_INVALID_PARAMETER); 601 602 if (!pVM->hm.s.vmx.fSupported) 603 return VERR_VMX_NOT_SUPPORTED; 604 605 PCVMXMSRS pVmxMsrs = &pVM->hm.s.vmx.Msrs; 606 switch (idMsr) 607 { 608 case MSR_IA32_FEATURE_CONTROL: *puValue = pVmxMsrs->u64FeatCtrl; break; 609 case MSR_IA32_VMX_BASIC: *puValue = pVmxMsrs->u64Basic; break; 610 case MSR_IA32_VMX_PINBASED_CTLS: *puValue = pVmxMsrs->PinCtls.u; break; 611 case MSR_IA32_VMX_PROCBASED_CTLS: *puValue = pVmxMsrs->ProcCtls.u; break; 612 case MSR_IA32_VMX_PROCBASED_CTLS2: *puValue = pVmxMsrs->ProcCtls2.u; break; 613 case MSR_IA32_VMX_EXIT_CTLS: *puValue = pVmxMsrs->ExitCtls.u; break; 614 case MSR_IA32_VMX_ENTRY_CTLS: *puValue = pVmxMsrs->EntryCtls.u; break; 615 case MSR_IA32_VMX_TRUE_PINBASED_CTLS: *puValue = pVmxMsrs->TruePinCtls.u; break; 616 case MSR_IA32_VMX_TRUE_PROCBASED_CTLS: *puValue = pVmxMsrs->TrueProcCtls.u; break; 617 case MSR_IA32_VMX_TRUE_ENTRY_CTLS: *puValue = pVmxMsrs->TrueEntryCtls.u; break; 618 case MSR_IA32_VMX_TRUE_EXIT_CTLS: *puValue = pVmxMsrs->TrueExitCtls.u; break; 619 case MSR_IA32_VMX_MISC: *puValue = pVmxMsrs->u64Misc; break; 620 case MSR_IA32_VMX_CR0_FIXED0: *puValue = pVmxMsrs->u64Cr0Fixed0; break; 621 case MSR_IA32_VMX_CR0_FIXED1: *puValue = pVmxMsrs->u64Cr0Fixed1; break; 622 case MSR_IA32_VMX_CR4_FIXED0: *puValue = pVmxMsrs->u64Cr4Fixed0; break; 623 case MSR_IA32_VMX_CR4_FIXED1: *puValue = pVmxMsrs->u64Cr4Fixed1; break; 624 case MSR_IA32_VMX_VMCS_ENUM: *puValue = pVmxMsrs->u64VmcsEnum; break; 625 case MSR_IA32_VMX_VMFUNC: *puValue = pVmxMsrs->u64VmFunc; break; 626 case MSR_IA32_VMX_EPT_VPID_CAP: *puValue = pVmxMsrs->u64EptVpidCaps; break; 627 default: 628 { 629 AssertMsgFailed(("Invalid MSR %#x\n", idMsr)); 630 return VERR_NOT_FOUND; 631 } 632 } 633 return VINF_SUCCESS; 634 } 635 #endif 636 637 546 638 #ifndef IN_RC 547 639 /** -
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r73293 r73389 122 122 uint64_t u64HostSmmMonitorCtl; 123 123 124 /** VMX MSR values */124 /** VMX MSR values. */ 125 125 VMXMSRS Msrs; 126 126 … … 298 298 * - AAN92 - B1. 299 299 * - AAJ124 - C0, D0. 300 *301 300 * - AAP86 - B1. 302 301 * … … 387 386 * depends on bit 49 of MSR_IA32_VMX_BASIC while table 35-2 says that this MSR is 388 387 * available if either VMX or SMX is supported. */ 389 if ( MSR_IA32_VMX_BASIC_DUAL_MON(g_HmR0.vmx.Msrs.u64Basic))388 if (RT_BF_GET(g_HmR0.vmx.Msrs.u64Basic, VMX_BF_BASIC_DUAL_MON)) 390 389 g_HmR0.vmx.u64HostSmmMonitorCtl = ASMRdMsr(MSR_IA32_SMM_MONITOR_CTL); 391 390 g_HmR0.vmx.Msrs.PinCtls.u = ASMRdMsr(MSR_IA32_VMX_PINBASED_CTLS); … … 399 398 g_HmR0.vmx.Msrs.u64Cr4Fixed1 = ASMRdMsr(MSR_IA32_VMX_CR4_FIXED1); 400 399 g_HmR0.vmx.Msrs.u64VmcsEnum = ASMRdMsr(MSR_IA32_VMX_VMCS_ENUM); 401 if ( MSR_IA32_VMX_BASIC_TRUE_CONTROLS(g_HmR0.vmx.Msrs.u64Basic))400 if (RT_BF_GET(g_HmR0.vmx.Msrs.u64Basic, VMX_BF_BASIC_TRUE_CTLS)) 402 401 { 403 402 g_HmR0.vmx.Msrs.TruePinCtls.u = ASMRdMsr(MSR_IA32_VMX_TRUE_PINBASED_CTLS); … … 410 409 g_HmR0.uMaxAsid = 0x10000; /* exclusive */ 411 410 412 if (g_HmR0.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)411 if (g_HmR0.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 413 412 { 414 413 g_HmR0.vmx.Msrs.ProcCtls2.u = ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS2); 415 if (g_HmR0.vmx.Msrs.ProcCtls2.n.allowed1 & (VMX_ VMCS_CTRL_PROC_EXEC2_EPT | VMX_VMCS_CTRL_PROC_EXEC2_VPID))414 if (g_HmR0.vmx.Msrs.ProcCtls2.n.allowed1 & (VMX_PROC_CTLS2_EPT | VMX_PROC_CTLS2_VPID)) 416 415 g_HmR0.vmx.Msrs.u64EptVpidCaps = ASMRdMsr(MSR_IA32_VMX_EPT_VPID_CAP); 417 416 418 if (g_HmR0.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_VMFUNC)419 g_HmR0.vmx.Msrs.u64Vm func = ASMRdMsr(MSR_IA32_VMX_VMFUNC);417 if (g_HmR0.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VMFUNC) 418 g_HmR0.vmx.Msrs.u64VmFunc = ASMRdMsr(MSR_IA32_VMX_VMFUNC); 420 419 } 421 420 … … 438 437 439 438 /* Set revision dword at the beginning of the structure. */ 440 *(uint32_t *)pvScatchPage = MSR_IA32_VMX_BASIC_VMCS_ID(g_HmR0.vmx.Msrs.u64Basic);439 *(uint32_t *)pvScatchPage = RT_BF_GET(g_HmR0.vmx.Msrs.u64Basic, VMX_BF_BASIC_VMCS_ID); 441 440 442 441 /* Make sure we don't get rescheduled to another cpu during this probe. */ … … 515 514 * Timer Does Not Count Down at the Rate Specified" erratum. 516 515 */ 517 if (g_HmR0.vmx.Msrs.PinCtls.n.allowed1 & VMX_ VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER)516 if (g_HmR0.vmx.Msrs.PinCtls.n.allowed1 & VMX_PIN_CTLS_PREEMPT_TIMER) 518 517 { 519 518 g_HmR0.vmx.fUsePreemptTimer = true; 520 g_HmR0.vmx.cPreemptTimerShift = MSR_IA32_VMX_MISC_PREEMPT_TSC_BIT(g_HmR0.vmx.Msrs.u64Misc);519 g_HmR0.vmx.cPreemptTimerShift = RT_BF_GET(g_HmR0.vmx.Msrs.u64Misc, VMX_BF_MISC_PREEMPT_TIMER_TSC); 521 520 if (hmR0InitIntelIsSubjectToVmxPreemptionTimerErratum()) 522 521 g_HmR0.vmx.cPreemptTimerShift = 0; /* This is about right most of the time here. */ -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r73348 r73389 790 790 { 791 791 /* Write the VMCS revision dword to the VMXON region. */ 792 *(uint32_t *)pvCpuPage = MSR_IA32_VMX_BASIC_VMCS_ID(pVM->hm.s.vmx.Msrs.u64Basic);792 *(uint32_t *)pvCpuPage = RT_BF_GET(pVM->hm.s.vmx.Msrs.u64Basic, VMX_BF_BASIC_VMCS_ID); 793 793 } 794 794 … … 916 916 hmR0VmxPageFree(&pVCpu->hm.s.vmx.hMemObjGuestMsr, &pVCpu->hm.s.vmx.pvGuestMsr, &pVCpu->hm.s.vmx.HCPhysGuestMsr); 917 917 918 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)918 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_MSR_BITMAPS) 919 919 hmR0VmxPageFree(&pVCpu->hm.s.vmx.hMemObjMsrBitmap, &pVCpu->hm.s.vmx.pvMsrBitmap, &pVCpu->hm.s.vmx.HCPhysMsrBitmap); 920 920 … … 968 968 969 969 /* The VMCS size cannot be more than 4096 bytes. See Intel spec. Appendix A.1 "Basic VMX Information". */ 970 AssertReturnStmt( MSR_IA32_VMX_BASIC_VMCS_SIZE(pVM->hm.s.vmx.Msrs.u64Basic) <= PAGE_SIZE,970 AssertReturnStmt(RT_BF_GET(pVM->hm.s.vmx.Msrs.u64Basic, VMX_BF_BASIC_VMCS_SIZE) <= PAGE_SIZE, 971 971 (&pVM->aCpus[0])->hm.s.u32HMError = VMX_UFC_INVALID_VMCS_SIZE, 972 972 VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO); … … 985 985 986 986 /* Allocate the APIC-access page for trapping APIC accesses from the guest. */ 987 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_APIC)987 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VIRT_APIC_ACCESS) 988 988 { 989 989 rc = hmR0VmxPageAllocZ(&pVM->hm.s.vmx.hMemObjApicAccess, (PRTR0PTR)&pVM->hm.s.vmx.pbApicAccess, … … 1008 1008 /* Get the allocated virtual-APIC page from the APIC device for transparent TPR accesses. */ 1009 1009 if ( PDMHasApic(pVM) 1010 && (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW))1010 && (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_TPR_SHADOW)) 1011 1011 { 1012 1012 rc = APICGetApicPageForCpu(pVCpu, &pVCpu->hm.s.vmx.HCPhysVirtApic, (PRTR0PTR)&pVCpu->hm.s.vmx.pbVirtApic, … … 1023 1023 * update HMAreMsrBitmapsAvailable(). 1024 1024 */ 1025 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)1025 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_MSR_BITMAPS) 1026 1026 { 1027 1027 rc = hmR0VmxPageAllocZ(&pVCpu->hm.s.vmx.hMemObjMsrBitmap, &pVCpu->hm.s.vmx.pvMsrBitmap, … … 1251 1251 { 1252 1252 /* Shouldn't ever happen but there -is- a number. We're well within the recommended 512. */ 1253 uint32_t const cMaxSupportedMsrs = MSR_IA32_VMX_MISC_MAX_MSR(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.u64Misc); 1253 uint64_t const uVmxMiscMsr = pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.u64Misc; 1254 uint32_t const cMaxSupportedMsrs = VMX_MISC_MAX_MSRS(uVmxMiscMsr); 1254 1255 if (RT_UNLIKELY(cMsrs > cMaxSupportedMsrs)) 1255 1256 { … … 1309 1310 1310 1311 /* Now that we're swapping MSRs during the world-switch, allow the guest to read/write them without causing VM-exits. */ 1311 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)1312 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS) 1312 1313 hmR0VmxSetMsrPermission(pVCpu, uMsr, VMXMSREXIT_PASSTHRU_READ, VMXMSREXIT_PASSTHRU_WRITE); 1313 1314 … … 1393 1394 1394 1395 /* We're no longer swapping MSRs during the world-switch, intercept guest read/writes to them. */ 1395 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)1396 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS) 1396 1397 hmR0VmxSetMsrPermission(pVCpu, uMsr, VMXMSREXIT_INTERCEPT_READ, VMXMSREXIT_INTERCEPT_WRITE); 1397 1398 … … 1652 1653 VERR_VMX_VMCS_FIELD_CACHE_INVALID); 1653 1654 1654 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)1655 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 1655 1656 { 1656 1657 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC2, &u32Val); … … 1692 1693 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 1693 1694 1694 if (pVCpu->hm.s.vmx.u32ExitCtls & VMX_ VMCS_CTRL_EXIT_LOAD_HOST_EFER_MSR)1695 if (pVCpu->hm.s.vmx.u32ExitCtls & VMX_EXIT_CTLS_LOAD_EFER_MSR) 1695 1696 { 1696 1697 uint64_t u64Val; … … 1738 1739 1739 1740 /* Verify that the permissions are as expected in the MSR bitmap. */ 1740 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)1741 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS) 1741 1742 { 1742 1743 VMXMSREXITREAD enmRead; … … 2295 2296 uint32_t const fZap = pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1; /* Bits cleared here must always be cleared. */ 2296 2297 2297 fVal |= VMX_ VMCS_CTRL_PIN_EXEC_EXT_INT_EXIT/* External interrupts cause a VM-exit. */2298 | VMX_ VMCS_CTRL_PIN_EXEC_NMI_EXIT;/* Non-maskable interrupts (NMIs) cause a VM-exit. */2299 2300 if (pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1 & VMX_ VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI)2301 fVal |= VMX_ VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI;/* Use virtual NMIs and virtual-NMI blocking features. */2298 fVal |= VMX_PIN_CTLS_EXT_INT_EXIT /* External interrupts cause a VM-exit. */ 2299 | VMX_PIN_CTLS_NMI_EXIT; /* Non-maskable interrupts (NMIs) cause a VM-exit. */ 2300 2301 if (pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1 & VMX_PIN_CTLS_VIRT_NMI) 2302 fVal |= VMX_PIN_CTLS_VIRT_NMI; /* Use virtual NMIs and virtual-NMI blocking features. */ 2302 2303 2303 2304 /* Enable the VMX preemption timer. */ 2304 2305 if (pVM->hm.s.vmx.fUsePreemptTimer) 2305 2306 { 2306 Assert(pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1 & VMX_ VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER);2307 fVal |= VMX_ VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER;2307 Assert(pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1 & VMX_PIN_CTLS_PREEMPT_TIMER); 2308 fVal |= VMX_PIN_CTLS_PREEMPT_TIMER; 2308 2309 } 2309 2310 … … 2312 2313 if (pVM->hm.s.fPostedIntrs) 2313 2314 { 2314 Assert(pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1 & VMX_VMCS_CTRL_PIN_EXEC_POSTED_INTR);2315 Assert(pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_ VMCS_CTRL_EXIT_ACK_EXT_INT);2316 fVal |= VMX_ VMCS_CTRL_PIN_EXEC_POSTED_INTR;2315 Assert(pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1 & VMX_PIN_CTLS_POSTED_INT); 2316 Assert(pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_EXIT_CTLS_ACK_EXT_INT); 2317 fVal |= VMX_PIN_CTL_POSTED_INT; 2317 2318 } 2318 2319 #endif … … 2351 2352 2352 2353 /* WBINVD causes a VM-exit. */ 2353 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_WBINVD_EXIT)2354 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_WBINVD_EXIT;2354 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_WBINVD_EXIT) 2355 fVal |= VMX_PROC_CTLS2_WBINVD_EXIT; 2355 2356 2356 2357 /* Enable EPT (aka nested-paging). */ 2357 2358 if (pVM->hm.s.fNestedPaging) 2358 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_EPT;2359 fVal |= VMX_PROC_CTLS2_EPT; 2359 2360 2360 2361 /* … … 2362 2363 * it to the guest. Without this, guest executing INVPCID would cause a #UD. 2363 2364 */ 2364 if ( (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_INVPCID)2365 if ( (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_INVPCID) 2365 2366 && pVM->cpum.ro.GuestFeatures.fInvpcid) 2366 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_INVPCID;2367 fVal |= VMX_PROC_CTLS2_INVPCID; 2367 2368 2368 2369 /* Enable VPID. */ 2369 2370 if (pVM->hm.s.vmx.fVpid) 2370 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_VPID;2371 fVal |= VMX_PROC_CTLS2_VPID; 2371 2372 2372 2373 /* Enable Unrestricted guest execution. */ 2373 2374 if (pVM->hm.s.vmx.fUnrestrictedGuest) 2374 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_UNRESTRICTED_GUEST;2375 fVal |= VMX_PROC_CTLS2_UNRESTRICTED_GUEST; 2375 2376 2376 2377 #if 0 … … 2378 2379 { 2379 2380 /* Enable APIC-register virtualization. */ 2380 Assert(pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_APIC_REG_VIRT);2381 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_APIC_REG_VIRT;2381 Assert(pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_APIC_REG_VIRT); 2382 fVal |= VMX_PROC_CTLS2_APIC_REG_VIRT; 2382 2383 2383 2384 /* Enable virtual-interrupt delivery. */ 2384 Assert(pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_INTR_DELIVERY);2385 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_INTR_DELIVERY;2385 Assert(pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VIRT_INTR_DELIVERY); 2386 fVal |= VMX_PROC_CTLS2_VIRT_INTR_DELIVERY; 2386 2387 } 2387 2388 #endif 2388 2389 2389 /* Enable Virtual-APIC page accesses if supported by the CPU. Thisis where the TPR shadow resides. */2390 /* Virtualize-APIC accesses if supported by the CPU. The virtual-APIC page is where the TPR shadow resides. */ 2390 2391 /** @todo VIRT_X2APIC support, it's mutually exclusive with this. So must be 2391 2392 * done dynamically. */ 2392 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_APIC)2393 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VIRT_APIC_ACCESS) 2393 2394 { 2394 2395 Assert(pVM->hm.s.vmx.HCPhysApicAccess); 2395 2396 Assert(!(pVM->hm.s.vmx.HCPhysApicAccess & 0xfff)); /* Bits 11:0 MBZ. */ 2396 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_APIC;/* Virtualize APIC accesses. */2397 fVal |= VMX_PROC_CTLS2_VIRT_APIC_ACCESS; /* Virtualize APIC accesses. */ 2397 2398 int rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_APIC_ACCESSADDR_FULL, pVM->hm.s.vmx.HCPhysApicAccess); 2398 2399 AssertRCReturn(rc, rc); … … 2400 2401 2401 2402 /* Enable RDTSCP. */ 2402 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_RDTSCP)2403 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_RDTSCP;2403 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_RDTSCP) 2404 fVal |= VMX_PROC_CTLS2_RDTSCP; 2404 2405 2405 2406 /* Enable Pause-Loop exiting. */ 2406 if ( pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_PAUSE_LOOP_EXIT2407 if ( pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_PAUSE_LOOP_EXIT 2407 2408 && pVM->hm.s.vmx.cPleGapTicks 2408 2409 && pVM->hm.s.vmx.cPleWindowTicks) 2409 2410 { 2410 fVal |= VMX_ VMCS_CTRL_PROC_EXEC2_PAUSE_LOOP_EXIT;2411 fVal |= VMX_PROC_CTLS2_PAUSE_LOOP_EXIT; 2411 2412 2412 2413 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PLE_GAP, pVM->hm.s.vmx.cPleGapTicks); … … 2447 2448 uint32_t const fZap = pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1; /* Bits cleared here must be cleared in the VMCS. */ 2448 2449 2449 fVal |= VMX_ VMCS_CTRL_PROC_EXEC_HLT_EXIT/* HLT causes a VM-exit. */2450 | VMX_ VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING/* Use TSC-offsetting. */2451 | VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT/* MOV DRx causes a VM-exit. */2452 | VMX_ VMCS_CTRL_PROC_EXEC_UNCOND_IO_EXIT/* All IO instructions cause a VM-exit. */2453 | VMX_ VMCS_CTRL_PROC_EXEC_RDPMC_EXIT/* RDPMC causes a VM-exit. */2454 | VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_EXIT/* MONITOR causes a VM-exit. */2455 | VMX_ VMCS_CTRL_PROC_EXEC_MWAIT_EXIT;/* MWAIT causes a VM-exit. */2456 2457 /* We toggle VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT later, check if it's not -always- needed to be set or clear. */2458 if ( !(pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT)2459 || (pVM->hm.s.vmx.Msrs.ProcCtls.n.disallowed0 & VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT))2460 { 2461 LogRelFunc(("Unsupported VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT combo!"));2450 fVal |= VMX_PROC_CTLS_HLT_EXIT /* HLT causes a VM-exit. */ 2451 | VMX_PROC_CTLS_USE_TSC_OFFSETTING /* Use TSC-offsetting. */ 2452 | VMX_PROC_CTLS_MOV_DR_EXIT /* MOV DRx causes a VM-exit. */ 2453 | VMX_PROC_CTLS_UNCOND_IO_EXIT /* All IO instructions cause a VM-exit. */ 2454 | VMX_PROC_CTLS_RDPMC_EXIT /* RDPMC causes a VM-exit. */ 2455 | VMX_PROC_CTLS_MONITOR_EXIT /* MONITOR causes a VM-exit. */ 2456 | VMX_PROC_CTLS_MWAIT_EXIT; /* MWAIT causes a VM-exit. */ 2457 2458 /* We toggle VMX_PROC_CTLS_MOV_DR_EXIT later, check if it's not -always- needed to be set or clear. */ 2459 if ( !(pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_MOV_DR_EXIT) 2460 || (pVM->hm.s.vmx.Msrs.ProcCtls.n.disallowed0 & VMX_PROC_CTLS_MOV_DR_EXIT)) 2461 { 2462 LogRelFunc(("Unsupported VMX_PROC_CTLS_MOV_DR_EXIT combo!")); 2462 2463 pVCpu->hm.s.u32HMError = VMX_UFC_CTRL_PROC_MOV_DRX_EXIT; 2463 2464 return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO; … … 2468 2469 { 2469 2470 Assert(!pVM->hm.s.vmx.fUnrestrictedGuest); /* Paranoia. */ 2470 fVal |= VMX_ VMCS_CTRL_PROC_EXEC_INVLPG_EXIT2471 | VMX_ VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT2472 | VMX_ VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT;2471 fVal |= VMX_PROC_CTLS_INVLPG_EXIT 2472 | VMX_PROC_CTLS_CR3_LOAD_EXIT 2473 | VMX_PROC_CTLS_CR3_STORE_EXIT; 2473 2474 } 2474 2475 2475 2476 /* Use TPR shadowing if supported by the CPU. */ 2476 2477 if ( PDMHasApic(pVM) 2477 && pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)2478 && pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_TPR_SHADOW) 2478 2479 { 2479 2480 Assert(pVCpu->hm.s.vmx.HCPhysVirtApic); 2480 2481 Assert(!(pVCpu->hm.s.vmx.HCPhysVirtApic & 0xfff)); /* Bits 11:0 MBZ. */ 2481 2482 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_TPR_THRESHOLD, 0); 2482 rc |= VMXWriteVmcs64(VMX_VMCS64_CTRL_V APIC_PAGEADDR_FULL, pVCpu->hm.s.vmx.HCPhysVirtApic);2483 rc |= VMXWriteVmcs64(VMX_VMCS64_CTRL_VIRT_APIC_PAGEADDR_FULL, pVCpu->hm.s.vmx.HCPhysVirtApic); 2483 2484 AssertRCReturn(rc, rc); 2484 2485 2485 fVal |= VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW;/* CR8 reads from the Virtual-APIC page. */2486 fVal |= VMX_PROC_CTLS_USE_TPR_SHADOW; /* CR8 reads from the Virtual-APIC page. */ 2486 2487 /* CR8 writes cause a VM-exit based on TPR threshold. */ 2487 Assert(!(fVal & VMX_ VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT));2488 Assert(!(fVal & VMX_ VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT));2488 Assert(!(fVal & VMX_PROC_CTLS_CR8_STORE_EXIT)); 2489 Assert(!(fVal & VMX_PROC_CTLS_CR8_LOAD_EXIT)); 2489 2490 } 2490 2491 else … … 2496 2497 if (pVM->hm.s.fAllow64BitGuests) 2497 2498 { 2498 fVal |= VMX_ VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT/* CR8 reads cause a VM-exit. */2499 | VMX_ VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT;/* CR8 writes cause a VM-exit. */2499 fVal |= VMX_PROC_CTLS_CR8_STORE_EXIT /* CR8 reads cause a VM-exit. */ 2500 | VMX_PROC_CTLS_CR8_LOAD_EXIT; /* CR8 writes cause a VM-exit. */ 2500 2501 } 2501 2502 } 2502 2503 2503 2504 /* Use MSR-bitmaps if supported by the CPU. */ 2504 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)2505 { 2506 fVal |= VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS;2505 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_MSR_BITMAPS) 2506 { 2507 fVal |= VMX_PROC_CTLS_USE_MSR_BITMAPS; 2507 2508 2508 2509 Assert(pVCpu->hm.s.vmx.HCPhysMsrBitmap); … … 2543 2544 2544 2545 /* Use the secondary processor-based VM-execution controls if supported by the CPU. */ 2545 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)2546 fVal |= VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL;2546 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 2547 fVal |= VMX_PROC_CTLS_USE_SECONDARY_CTLS; 2547 2548 2548 2549 if ((fVal & fZap) != fVal) … … 2560 2561 2561 2562 /* Set up secondary processor-based VM-execution controls if the CPU supports it. */ 2562 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)2563 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 2563 2564 return hmR0VmxSetupProcCtls2(pVCpu); 2564 2565 … … 2762 2763 Assert(!pVM->hm.s.vmx.fSupportsVmcsEfer); 2763 2764 #if HC_ARCH_BITS == 64 2764 if ( (pVM->hm.s.vmx.Msrs.EntryCtls.n.allowed1 & VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR)2765 && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_ VMCS_CTRL_EXIT_LOAD_HOST_EFER_MSR)2766 && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_ VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR))2765 if ( (pVM->hm.s.vmx.Msrs.EntryCtls.n.allowed1 & VMX_ENTRY_CTLS_LOAD_EFER_MSR) 2766 && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_EXIT_CTLS_LOAD_EFER_MSR) 2767 && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_EXIT_CTLS_SAVE_EFER_MSR)) 2767 2768 { 2768 2769 pVM->hm.s.vmx.fSupportsVmcsEfer = true; … … 2785 2786 2786 2787 /* Set revision dword at the beginning of the VMCS structure. */ 2787 *(uint32_t *)pVCpu->hm.s.vmx.pvVmcs = MSR_IA32_VMX_BASIC_VMCS_ID(pVM->hm.s.vmx.Msrs.u64Basic);2788 *(uint32_t *)pVCpu->hm.s.vmx.pvVmcs = RT_BF_GET(pVM->hm.s.vmx.Msrs.u64Basic, VMX_BF_BASIC_VMCS_ID); 2788 2789 2789 2790 /* Initialize our VMCS region in memory, set the VMCS launch state to "clear". */ … … 2960 2961 /* Assertion is right but we would not have updated u32ExitCtls yet. */ 2961 2962 #if 0 2962 if (!(pVCpu->hm.s.vmx.u32ExitCtls & VMX_ VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE))2963 if (!(pVCpu->hm.s.vmx.u32ExitCtls & VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE)) 2963 2964 Assert(uSelSS != 0); 2964 2965 #endif … … 3233 3234 3234 3235 /* Load debug controls (DR7 & IA32_DEBUGCTL_MSR). The first VT-x capable CPUs only supports the 1-setting of this bit. */ 3235 fVal |= VMX_ VMCS_CTRL_ENTRY_LOAD_DEBUG;3236 fVal |= VMX_ENTRY_CTLS_LOAD_DEBUG; 3236 3237 3237 3238 /* Set if the guest is in long mode. This will set/clear the EFER.LMA bit on VM-entry. */ 3238 3239 if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.GstCtx)) 3239 3240 { 3240 fVal |= VMX_ VMCS_CTRL_ENTRY_IA32E_MODE_GUEST;3241 Log4Func(("VMX_ VMCS_CTRL_ENTRY_IA32E_MODE_GUEST\n"));3241 fVal |= VMX_ENTRY_CTLS_IA32E_MODE_GUEST; 3242 Log4Func(("VMX_ENTRY_CTLS_IA32E_MODE_GUEST\n")); 3242 3243 } 3243 3244 else 3244 Assert(!(fVal & VMX_ VMCS_CTRL_ENTRY_IA32E_MODE_GUEST));3245 Assert(!(fVal & VMX_ENTRY_CTLS_IA32E_MODE_GUEST)); 3245 3246 3246 3247 /* If the CPU supports the newer VMCS controls for managing guest/host EFER, use it. */ … … 3248 3249 && hmR0VmxShouldSwapEferMsr(pVCpu)) 3249 3250 { 3250 fVal |= VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR;3251 Log4Func(("VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR\n"));3251 fVal |= VMX_ENTRY_CTLS_LOAD_EFER_MSR; 3252 Log4Func(("VMX_ENTRY_CTLS_LOAD_EFER_MSR\n")); 3252 3253 } 3253 3254 3254 3255 /* 3255 3256 * The following should -not- be set (since we're not in SMM mode): 3256 * - VMX_ VMCS_CTRL_ENTRY_ENTRY_SMM3257 * - VMX_ VMCS_CTRL_ENTRY_DEACTIVATE_DUALMON3257 * - VMX_ENTRY_CTLS_ENTRY_TO_SMM 3258 * - VMX_ENTRY_CTLS_DEACTIVATE_DUAL_MON 3258 3259 */ 3259 3260 3260 /** @todo VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_PERF_MSR,3261 * VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_PAT_MSR. */3261 /** @todo VMX_ENTRY_CTLS_LOAD_PERF_MSR, 3262 * VMX_ENTRY_CTLS_LOAD_PAT_MSR. */ 3262 3263 3263 3264 if ((fVal & fZap) != fVal) … … 3300 3301 3301 3302 /* Save debug controls (DR7 & IA32_DEBUGCTL_MSR). The first VT-x CPUs only supported the 1-setting of this bit. */ 3302 fVal |= VMX_ VMCS_CTRL_EXIT_SAVE_DEBUG;3303 fVal |= VMX_EXIT_CTLS_SAVE_DEBUG; 3303 3304 3304 3305 /* … … 3308 3309 */ 3309 3310 #if HC_ARCH_BITS == 64 3310 fVal |= VMX_ VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE;3311 Log4Func(("VMX_ VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE\n"));3311 fVal |= VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE; 3312 Log4Func(("VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE\n")); 3312 3313 #else 3313 3314 Assert( pVCpu->hm.s.vmx.pfnStartVM == VMXR0SwitcherStartVM64 … … 3317 3318 { 3318 3319 /* The switcher returns to long mode, EFER is managed by the switcher. */ 3319 fVal |= VMX_ VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE;3320 Log4Func(("VMX_ VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE\n"));3320 fVal |= VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE; 3321 Log4Func(("VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE\n")); 3321 3322 } 3322 3323 else 3323 Assert(!(fVal & VMX_ VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE));3324 Assert(!(fVal & VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE)); 3324 3325 #endif 3325 3326 … … 3328 3329 && hmR0VmxShouldSwapEferMsr(pVCpu)) 3329 3330 { 3330 fVal |= VMX_ VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR3331 | VMX_ VMCS_CTRL_EXIT_LOAD_HOST_EFER_MSR;3332 Log4Func(("VMX_ VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR and VMX_VMCS_CTRL_EXIT_LOAD_HOST_EFER_MSR\n"));3331 fVal |= VMX_EXIT_CTLS_SAVE_EFER_MSR 3332 | VMX_EXIT_CTLS_LOAD_EFER_MSR; 3333 Log4Func(("VMX_EXIT_CTLS_SAVE_EFER_MSR and VMX_EXIT_CTLS_LOAD_EFER_MSR\n")); 3333 3334 } 3334 3335 3335 3336 /* Don't acknowledge external interrupts on VM-exit. We want to let the host do that. */ 3336 Assert(!(fVal & VMX_ VMCS_CTRL_EXIT_ACK_EXT_INT));3337 3338 /** @todo VMX_ VMCS_CTRL_EXIT_LOAD_PERF_MSR,3339 * VMX_ VMCS_CTRL_EXIT_SAVE_GUEST_PAT_MSR,3340 * VMX_ VMCS_CTRL_EXIT_LOAD_HOST_PAT_MSR. */3337 Assert(!(fVal & VMX_EXIT_CTLS_ACK_EXT_INT)); 3338 3339 /** @todo VMX_EXIT_CTLS_LOAD_PERF_MSR, 3340 * VMX_EXIT_CTLS_SAVE_PAT_MSR, 3341 * VMX_EXIT_CTLS_LOAD_PAT_MSR. */ 3341 3342 3342 3343 /* Enable saving of the VMX preemption timer value on VM-exit. */ 3343 3344 if ( pVM->hm.s.vmx.fUsePreemptTimer 3344 && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_ VMCS_CTRL_EXIT_SAVE_VMX_PREEMPT_TIMER))3345 fVal |= VMX_ VMCS_CTRL_EXIT_SAVE_VMX_PREEMPT_TIMER;3345 && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER)) 3346 fVal |= VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER; 3346 3347 3347 3348 if ((fVal & fZap) != fVal) … … 3377 3378 { 3378 3379 Assert(!(u32TprThreshold & 0xfffffff0)); /* Bits 31:4 MBZ. */ 3379 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW); RT_NOREF_PV(pVCpu);3380 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW); RT_NOREF_PV(pVCpu); 3380 3381 return VMXWriteVmcs32(VMX_VMCS32_CTRL_TPR_THRESHOLD, u32TprThreshold); 3381 3382 } … … 3402 3403 * Setup TPR shadowing. 3403 3404 */ 3404 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)3405 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW) 3405 3406 { 3406 3407 Assert(pVCpu->hm.s.vmx.HCPhysVirtApic); … … 3489 3490 */ 3490 3491 if ( VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_BLOCK_NMIS) 3491 && (pVCpu->hm.s.vmx.u32PinCtls & VMX_ VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI))3492 && (pVCpu->hm.s.vmx.u32PinCtls & VMX_PIN_CTLS_VIRT_NMI)) 3492 3493 { 3493 3494 fIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_NMI; … … 3679 3680 { 3680 3681 /* The guest has paging enabled, let it access CR3 without causing a VM-exit if supported. */ 3681 uProcCtls &= ~( VMX_ VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT3682 | VMX_ VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT);3682 uProcCtls &= ~( VMX_PROC_CTLS_CR3_LOAD_EXIT 3683 | VMX_PROC_CTLS_CR3_STORE_EXIT); 3683 3684 } 3684 3685 else 3685 3686 { 3686 3687 /* The guest doesn't have paging enabled, make CR3 access cause a VM-exit to update our shadow. */ 3687 uProcCtls |= VMX_ VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT3688 | VMX_ VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT;3688 uProcCtls |= VMX_PROC_CTLS_CR3_LOAD_EXIT 3689 | VMX_PROC_CTLS_CR3_STORE_EXIT; 3689 3690 } 3690 3691 3691 3692 /* If we have unrestricted guest execution, we never have to intercept CR3 reads. */ 3692 3693 if (pVM->hm.s.vmx.fUnrestrictedGuest) 3693 uProcCtls &= ~VMX_ VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT;3694 uProcCtls &= ~VMX_PROC_CTLS_CR3_STORE_EXIT; 3694 3695 } 3695 3696 else … … 4064 4065 #ifdef VBOX_STRICT 4065 4066 /* Validate. Intel spec. 26.3.1.1 "Checks on Guest Controls Registers, Debug Registers, MSRs" */ 4066 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ VMCS_CTRL_ENTRY_LOAD_DEBUG)4067 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ENTRY_CTLS_LOAD_DEBUG) 4067 4068 { 4068 4069 /* Validate. Intel spec. 17.2 "Debug Registers", recompiler paranoia checks. */ … … 4079 4080 /* If the CPU supports the monitor trap flag, use it for single stepping in DBGF and avoid intercepting #DB. */ 4080 4081 PVM pVM = pVCpu->CTX_SUFF(pVM); 4081 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG)4082 { 4083 uProcCtls |= VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG;4082 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_MONITOR_TRAP_FLAG) 4083 { 4084 uProcCtls |= VMX_PROC_CTLS_MONITOR_TRAP_FLAG; 4084 4085 Assert(fSteppingDB == false); 4085 4086 } … … 4176 4177 4177 4178 if (fInterceptMovDRx) 4178 uProcCtls |= VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT;4179 uProcCtls |= VMX_PROC_CTLS_MOV_DR_EXIT; 4179 4180 else 4180 uProcCtls &= ~VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT;4181 uProcCtls &= ~VMX_PROC_CTLS_MOV_DR_EXIT; 4181 4182 4182 4183 /* … … 4790 4791 4791 4792 /* We need to intercept reads too, see @bugref{7386#c16}. */ 4792 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)4793 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_MSR_BITMAPS) 4793 4794 hmR0VmxSetMsrPermission(pVCpu, MSR_K6_EFER, VMXMSREXIT_INTERCEPT_READ, VMXMSREXIT_INTERCEPT_WRITE); 4794 4795 Log4Func(("MSR[--]: u32Msr=%#RX32 u64Value=%#RX64 cMsrs=%u\n", MSR_K6_EFER, pCtx->msrEFER, … … 5025 5026 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, &u32Val); AssertRC(rc); 5026 5027 Log4(("VMX_VMCS32_CTRL_PROC_EXEC %#RX32\n", u32Val)); 5027 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)5028 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 5028 5029 { 5029 5030 rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC2, &u32Val); AssertRC(rc); … … 5508 5509 case VMX_VMCS64_CTRL_EXEC_VMCS_PTR_FULL: 5509 5510 case VMX_VMCS64_CTRL_TSC_OFFSET_FULL: 5510 case VMX_VMCS64_CTRL_V APIC_PAGEADDR_FULL:5511 case VMX_VMCS64_CTRL_VIRT_APIC_PAGEADDR_FULL: 5511 5512 case VMX_VMCS64_CTRL_APIC_ACCESSADDR_FULL: 5512 5513 case VMX_VMCS64_CTRL_VMFUNC_CTRLS_FULL: … … 5670 5671 } 5671 5672 5672 if (uProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT)5673 { 5674 uProcCtls &= ~VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT;5673 if (uProcCtls & VMX_PROC_CTLS_RDTSC_EXIT) 5674 { 5675 uProcCtls &= ~VMX_PROC_CTLS_RDTSC_EXIT; 5675 5676 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, uProcCtls); 5676 5677 AssertRC(rc); … … 5682 5683 { 5683 5684 /* We can't use TSC-offsetting (non-fixed TSC, warp drive active etc.), VM-exit on RDTSC(P). */ 5684 if (!(uProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT))5685 { 5686 uProcCtls |= VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT;5685 if (!(uProcCtls & VMX_PROC_CTLS_RDTSC_EXIT)) 5686 { 5687 uProcCtls |= VMX_PROC_CTLS_RDTSC_EXIT; 5687 5688 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, uProcCtls); 5688 5689 AssertRC(rc); … … 5887 5888 && ( enmRaise == IEMXCPTRAISE_PREV_EVENT 5888 5889 || (fRaiseInfo & IEMXCPTRAISEINFO_NMI_PF)) 5889 && (pVCpu->hm.s.vmx.u32PinCtls & VMX_ VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI))5890 && (pVCpu->hm.s.vmx.u32PinCtls & VMX_PIN_CTLS_VIRT_NMI)) 5890 5891 { 5891 5892 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS); … … 5978 5979 && VMX_EXIT_INT_INFO_IS_NMI_UNBLOCK_IRET(pVmxTransient->uExitIntInfo) 5979 5980 && uExitVector != X86_XCPT_DF 5980 && (pVCpu->hm.s.vmx.u32PinCtls & VMX_ VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI))5981 && (pVCpu->hm.s.vmx.u32PinCtls & VMX_PIN_CTLS_VIRT_NMI)) 5981 5982 { 5982 5983 /* … … 6806 6807 #ifdef VBOX_STRICT 6807 6808 if (CPUMIsHyperDebugStateActive(pVCpu)) 6808 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT);6809 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_MOV_DR_EXIT); 6809 6810 #endif 6810 6811 CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(pVCpu, true /* save DR6 */); … … 7099 7100 DECLINLINE(void) hmR0VmxSetIntWindowExitVmcs(PVMCPU pVCpu) 7100 7101 { 7101 if (RT_LIKELY(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT))7102 { 7103 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT))7104 { 7105 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_ VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT;7102 if (RT_LIKELY(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_INT_WINDOW_EXIT)) 7103 { 7104 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_INT_WINDOW_EXIT)) 7105 { 7106 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_PROC_CTLS_INT_WINDOW_EXIT; 7106 7107 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 7107 7108 AssertRC(rc); … … 7119 7120 DECLINLINE(void) hmR0VmxClearIntWindowExitVmcs(PVMCPU pVCpu) 7120 7121 { 7121 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT);7122 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_ VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT;7122 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_INT_WINDOW_EXIT); 7123 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_PROC_CTLS_INT_WINDOW_EXIT; 7123 7124 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 7124 7125 AssertRC(rc); … … 7135 7136 DECLINLINE(void) hmR0VmxSetNmiWindowExitVmcs(PVMCPU pVCpu) 7136 7137 { 7137 if (RT_LIKELY(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT))7138 { 7139 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT))7140 { 7141 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_ VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT;7138 if (RT_LIKELY(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_NMI_WINDOW_EXIT)) 7139 { 7140 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_NMI_WINDOW_EXIT)) 7141 { 7142 pVCpu->hm.s.vmx.u32ProcCtls |= VMX_PROC_CTLS_NMI_WINDOW_EXIT; 7142 7143 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 7143 7144 AssertRC(rc); … … 7155 7156 DECLINLINE(void) hmR0VmxClearNmiWindowExitVmcs(PVMCPU pVCpu) 7156 7157 { 7157 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT);7158 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_ VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT;7158 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_NMI_WINDOW_EXIT); 7159 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_PROC_CTLS_NMI_WINDOW_EXIT; 7159 7160 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 7160 7161 AssertRC(rc); … … 7239 7240 else if (rc == VERR_APIC_INTR_MASKED_BY_TPR) 7240 7241 { 7241 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)7242 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW) 7242 7243 hmR0VmxApicSetTprThreshold(pVCpu, u8Interrupt >> 4); 7243 7244 STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchTprMaskedIrq); … … 7370 7371 * BS bit would mean delivering a #DB to the guest upon VM-entry when it shouldn't be. 7371 7372 */ 7372 Assert(!(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG));7373 Assert(!(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_MONITOR_TRAP_FLAG)); 7373 7374 fIntrState = 0; 7374 7375 } … … 7752 7753 static void hmR0VmxClearIntNmiWindowsVmcs(PVMCPU pVCpu) 7753 7754 { 7754 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT)7755 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_INT_WINDOW_EXIT) 7755 7756 { 7756 7757 hmR0VmxClearIntWindowExitVmcs(pVCpu); … … 7758 7759 } 7759 7760 7760 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT)7761 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_NMI_WINDOW_EXIT) 7761 7762 { 7762 7763 hmR0VmxClearNmiWindowExitVmcs(pVCpu); … … 8212 8213 PVM pVM = pVCpu->CTX_SUFF(pVM); 8213 8214 if ( !pVCpu->hm.s.vmx.u64MsrApicBase 8214 && (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_APIC)8215 && (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_PROC_CTLS2_VIRT_APIC_ACCESS) 8215 8216 && PDMHasApic(pVM)) 8216 8217 { … … 8429 8430 * Cache the TPR-shadow for checking on every VM-exit if it might have changed. 8430 8431 */ 8431 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)8432 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW) 8432 8433 pVmxTransient->u8GuestTpr = pVCpu->hm.s.vmx.pbVirtApic[XAPIC_OFF_TPR]; 8433 8434 … … 8454 8455 * Load the TSC_AUX MSR when we are not intercepting RDTSCP. 8455 8456 */ 8456 if (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_ VMCS_CTRL_PROC_EXEC2_RDTSCP)8457 { 8458 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT))8457 if (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_PROC_CTLS2_RDTSCP) 8458 { 8459 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_RDTSC_EXIT)) 8459 8460 { 8460 8461 bool fMsrUpdated; … … 8492 8493 #endif 8493 8494 #ifdef HMVMX_ALWAYS_CHECK_GUEST_STATE 8494 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS))8495 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS)) 8495 8496 { 8496 8497 uint32_t uInvalidReason = hmR0VmxCheckGuestState(pVCpu); … … 8527 8528 pVmxTransient->fVectoringDoublePF = false; /* Vectoring double page-fault needs to be determined later. */ 8528 8529 8529 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT))8530 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_RDTSC_EXIT)) 8530 8531 TMCpuTickSetLastSeen(pVCpu, uHostTsc + pVCpu->hm.s.vmx.u64TscOffset); 8531 8532 … … 8606 8607 * Sync the TPR shadow with our APIC state. 8607 8608 */ 8608 if ( (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)8609 if ( (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW) 8609 8610 && pVmxTransient->u8GuestTpr != pVCpu->hm.s.vmx.pbVirtApic[XAPIC_OFF_TPR]) 8610 8611 { … … 8872 8873 if (pDbgState->fModifiedProcCtls) 8873 8874 { 8874 if (!(pDbgState->fProcCtlsInitial & VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT) && CPUMIsHyperDebugStateActive(pVCpu))8875 pDbgState->fProcCtlsInitial |= VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT; /* Avoid assertion in hmR0VmxLeave */8875 if (!(pDbgState->fProcCtlsInitial & VMX_PROC_CTLS_MOV_DR_EXIT) && CPUMIsHyperDebugStateActive(pVCpu)) 8876 pDbgState->fProcCtlsInitial |= VMX_PROC_CTLS_MOV_DR_EXIT; /* Avoid assertion in hmR0VmxLeave */ 8876 8877 int rc2 = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pDbgState->fProcCtlsInitial); 8877 8878 AssertRCReturn(rc2, rc2); … … 9022 9023 SET_ONLY_XBM_IF_EITHER_EN(INSTR_GETSEC, VMX_EXIT_GETSEC); /* unconditional */ 9023 9024 SET_ONLY_XBM_IF_EITHER_EN( EXIT_GETSEC, VMX_EXIT_GETSEC); 9024 SET_CPE1_XBM_IF_EITHER_EN(INSTR_HALT, VMX_EXIT_HLT, VMX_ VMCS_CTRL_PROC_EXEC_HLT_EXIT); /* paranoia */9025 SET_CPE1_XBM_IF_EITHER_EN(INSTR_HALT, VMX_EXIT_HLT, VMX_PROC_CTLS_HLT_EXIT); /* paranoia */ 9025 9026 SET_ONLY_XBM_IF_EITHER_EN( EXIT_HALT, VMX_EXIT_HLT); 9026 9027 SET_ONLY_XBM_IF_EITHER_EN(INSTR_INVD, VMX_EXIT_INVD); /* unconditional */ 9027 9028 SET_ONLY_XBM_IF_EITHER_EN( EXIT_INVD, VMX_EXIT_INVD); 9028 SET_CPE1_XBM_IF_EITHER_EN(INSTR_INVLPG, VMX_EXIT_INVLPG, VMX_ VMCS_CTRL_PROC_EXEC_INVLPG_EXIT);9029 SET_CPE1_XBM_IF_EITHER_EN(INSTR_INVLPG, VMX_EXIT_INVLPG, VMX_PROC_CTLS_INVLPG_EXIT); 9029 9030 SET_ONLY_XBM_IF_EITHER_EN( EXIT_INVLPG, VMX_EXIT_INVLPG); 9030 SET_CPE1_XBM_IF_EITHER_EN(INSTR_RDPMC, VMX_EXIT_RDPMC, VMX_ VMCS_CTRL_PROC_EXEC_RDPMC_EXIT);9031 SET_CPE1_XBM_IF_EITHER_EN(INSTR_RDPMC, VMX_EXIT_RDPMC, VMX_PROC_CTLS_RDPMC_EXIT); 9031 9032 SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDPMC, VMX_EXIT_RDPMC); 9032 SET_CPE1_XBM_IF_EITHER_EN(INSTR_RDTSC, VMX_EXIT_RDTSC, VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT);9033 SET_CPE1_XBM_IF_EITHER_EN(INSTR_RDTSC, VMX_EXIT_RDTSC, VMX_PROC_CTLS_RDTSC_EXIT); 9033 9034 SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDTSC, VMX_EXIT_RDTSC); 9034 9035 SET_ONLY_XBM_IF_EITHER_EN(INSTR_RSM, VMX_EXIT_RSM); /* unconditional */ … … 9066 9067 #endif 9067 9068 if (IS_EITHER_ENABLED(pVM, INSTR_CRX_READ)) 9068 pDbgState->fCpe1Extra |= VMX_ VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT | VMX_VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT;9069 pDbgState->fCpe1Extra |= VMX_PROC_CTLS_CR3_STORE_EXIT | VMX_PROC_CTLS_CR8_STORE_EXIT; 9069 9070 if (IS_EITHER_ENABLED(pVM, INSTR_CRX_WRITE)) 9070 pDbgState->fCpe1Extra |= VMX_ VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT | VMX_VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT;9071 pDbgState->fCpe1Unwanted |= VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW; /* risky? */9071 pDbgState->fCpe1Extra |= VMX_PROC_CTLS_CR3_LOAD_EXIT | VMX_PROC_CTLS_CR8_LOAD_EXIT; 9072 pDbgState->fCpe1Unwanted |= VMX_PROC_CTLS_USE_TPR_SHADOW; /* risky? */ 9072 9073 /* Note! We currently don't use VMX_VMCS32_CTRL_CR3_TARGET_COUNT. It would 9073 9074 require clearing here and in the loop if we start using it. */ … … 9099 9100 SET_ONLY_XBM_IF_EITHER_EN( EXIT_DRX_WRITE, VMX_EXIT_MOV_DRX); 9100 9101 9101 SET_CPEU_XBM_IF_EITHER_EN(INSTR_RDMSR, VMX_EXIT_RDMSR, VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS); /* risky clearing this? */9102 SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDMSR, 9103 SET_CPEU_XBM_IF_EITHER_EN(INSTR_WRMSR, VMX_EXIT_WRMSR, VMX_VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS);9104 SET_ONLY_XBM_IF_EITHER_EN( EXIT_WRMSR, 9105 SET_CPE1_XBM_IF_EITHER_EN(INSTR_MWAIT, VMX_EXIT_MWAIT, VMX_VMCS_CTRL_PROC_EXEC_MWAIT_EXIT); /* paranoia */9106 SET_ONLY_XBM_IF_EITHER_EN( EXIT_MWAIT, 9107 SET_CPE1_XBM_IF_EITHER_EN(INSTR_MONITOR, VMX_EXIT_MONITOR, VMX_VMCS_CTRL_PROC_EXEC_MONITOR_EXIT); /* paranoia */9108 SET_ONLY_XBM_IF_EITHER_EN( EXIT_MONITOR, 9102 SET_CPEU_XBM_IF_EITHER_EN(INSTR_RDMSR, VMX_EXIT_RDMSR, VMX_PROC_CTLS_USE_MSR_BITMAPS); /* risky clearing this? */ 9103 SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDMSR, VMX_EXIT_RDMSR); 9104 SET_CPEU_XBM_IF_EITHER_EN(INSTR_WRMSR, VMX_EXIT_WRMSR, VMX_PROC_CTLS_USE_MSR_BITMAPS); 9105 SET_ONLY_XBM_IF_EITHER_EN( EXIT_WRMSR, VMX_EXIT_WRMSR); 9106 SET_CPE1_XBM_IF_EITHER_EN(INSTR_MWAIT, VMX_EXIT_MWAIT, VMX_PROC_CTLS_MWAIT_EXIT); /* paranoia */ 9107 SET_ONLY_XBM_IF_EITHER_EN( EXIT_MWAIT, VMX_EXIT_MWAIT); 9108 SET_CPE1_XBM_IF_EITHER_EN(INSTR_MONITOR, VMX_EXIT_MONITOR, VMX_PROC_CTLS_MONITOR_EXIT); /* paranoia */ 9109 SET_ONLY_XBM_IF_EITHER_EN( EXIT_MONITOR, VMX_EXIT_MONITOR); 9109 9110 #if 0 /** @todo too slow, fix handler. */ 9110 SET_CPE1_XBM_IF_EITHER_EN(INSTR_PAUSE, VMX_EXIT_PAUSE, VMX_VMCS_CTRL_PROC_EXEC_PAUSE_EXIT);9111 SET_CPE1_XBM_IF_EITHER_EN(INSTR_PAUSE, VMX_EXIT_PAUSE, VMX_PROC_CTLS_PAUSE_EXIT); 9111 9112 #endif 9112 SET_ONLY_XBM_IF_EITHER_EN( EXIT_PAUSE, 9113 SET_ONLY_XBM_IF_EITHER_EN( EXIT_PAUSE, VMX_EXIT_PAUSE); 9113 9114 9114 9115 if ( IS_EITHER_ENABLED(pVM, INSTR_SGDT) … … 9117 9118 || IS_EITHER_ENABLED(pVM, INSTR_LIDT)) 9118 9119 { 9119 pDbgState->fCpe2Extra |= VMX_ VMCS_CTRL_PROC_EXEC2_DESCRIPTOR_TABLE_EXIT;9120 pDbgState->fCpe2Extra |= VMX_PROC_CTLS2_DESC_TABLE_EXIT; 9120 9121 ASMBitSet(pDbgState->bmExitsToCheck, VMX_EXIT_XDTR_ACCESS); 9121 9122 } … … 9130 9131 || IS_EITHER_ENABLED(pVM, INSTR_LTR)) 9131 9132 { 9132 pDbgState->fCpe2Extra |= VMX_ VMCS_CTRL_PROC_EXEC2_DESCRIPTOR_TABLE_EXIT;9133 pDbgState->fCpe2Extra |= VMX_PROC_CTLS2_DESC_TABLE_EXIT; 9133 9134 ASMBitSet(pDbgState->bmExitsToCheck, VMX_EXIT_TR_ACCESS); 9134 9135 } … … 9140 9141 SET_ONLY_XBM_IF_EITHER_EN(INSTR_VMX_INVEPT, VMX_EXIT_INVEPT); /* unconditional */ 9141 9142 SET_ONLY_XBM_IF_EITHER_EN( EXIT_VMX_INVEPT, VMX_EXIT_INVEPT); 9142 SET_CPE1_XBM_IF_EITHER_EN(INSTR_RDTSCP, VMX_EXIT_RDTSCP, VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT);9143 SET_CPE1_XBM_IF_EITHER_EN(INSTR_RDTSCP, VMX_EXIT_RDTSCP, VMX_PROC_CTLS_RDTSC_EXIT); 9143 9144 SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDTSCP, VMX_EXIT_RDTSCP); 9144 9145 SET_ONLY_XBM_IF_EITHER_EN(INSTR_VMX_INVVPID, VMX_EXIT_INVVPID); /* unconditional */ 9145 9146 SET_ONLY_XBM_IF_EITHER_EN( EXIT_VMX_INVVPID, VMX_EXIT_INVVPID); 9146 SET_CPE2_XBM_IF_EITHER_EN(INSTR_WBINVD, VMX_EXIT_WBINVD, VMX_VMCS_CTRL_PROC_EXEC2_WBINVD_EXIT);9147 SET_CPE2_XBM_IF_EITHER_EN(INSTR_WBINVD, VMX_EXIT_WBINVD, VMX_PROC_CTLS2_WBINVD_EXIT); 9147 9148 SET_ONLY_XBM_IF_EITHER_EN( EXIT_WBINVD, VMX_EXIT_WBINVD); 9148 9149 SET_ONLY_XBM_IF_EITHER_EN(INSTR_XSETBV, VMX_EXIT_XSETBV); /* unconditional */ 9149 9150 SET_ONLY_XBM_IF_EITHER_EN( EXIT_XSETBV, VMX_EXIT_XSETBV); 9150 SET_CPE2_XBM_IF_EITHER_EN(INSTR_RDRAND, VMX_EXIT_RDRAND, VMX_VMCS_CTRL_PROC_EXEC2_RDRAND_EXIT);9151 SET_CPE2_XBM_IF_EITHER_EN(INSTR_RDRAND, VMX_EXIT_RDRAND, VMX_PROC_CTLS2_RDRAND_EXIT); 9151 9152 SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDRAND, VMX_EXIT_RDRAND); 9152 SET_CPE1_XBM_IF_EITHER_EN(INSTR_VMX_INVPCID, VMX_EXIT_INVPCID, VMX_VMCS_CTRL_PROC_EXEC_INVLPG_EXIT);9153 SET_CPE1_XBM_IF_EITHER_EN(INSTR_VMX_INVPCID, VMX_EXIT_INVPCID, VMX_PROC_CTLS_INVLPG_EXIT); 9153 9154 SET_ONLY_XBM_IF_EITHER_EN( EXIT_VMX_INVPCID, VMX_EXIT_INVPCID); 9154 9155 SET_ONLY_XBM_IF_EITHER_EN(INSTR_VMX_VMFUNC, VMX_EXIT_VMFUNC); /* unconditional for the current setup */ 9155 9156 SET_ONLY_XBM_IF_EITHER_EN( EXIT_VMX_VMFUNC, VMX_EXIT_VMFUNC); 9156 SET_CPE2_XBM_IF_EITHER_EN(INSTR_RDSEED, VMX_EXIT_RDSEED, VMX_VMCS_CTRL_PROC_EXEC2_RDSEED_EXIT);9157 SET_CPE2_XBM_IF_EITHER_EN(INSTR_RDSEED, VMX_EXIT_RDSEED, VMX_PROC_CTLS2_RDSEED_EXIT); 9157 9158 SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDSEED, VMX_EXIT_RDSEED); 9158 9159 SET_ONLY_XBM_IF_EITHER_EN(INSTR_XSAVES, VMX_EXIT_XSAVES); /* unconditional (enabled by host, guest cfg) */ … … 9172 9173 pDbgState->fCpe2Extra &= pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1; 9173 9174 if (pDbgState->fCpe2Extra) 9174 pDbgState->fCpe1Extra |= VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL;9175 pDbgState->fCpe1Extra |= VMX_PROC_CTLS_USE_SECONDARY_CTLS; 9175 9176 pDbgState->fCpe1Extra &= pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1; 9176 9177 pDbgState->fCpe1Unwanted &= ~pVM->hm.s.vmx.Msrs.ProcCtls.n.disallowed0; 9177 if (pVCpu->hm.s.fDebugWantRdTscExit != RT_BOOL(pDbgState->fCpe1Extra & VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT))9178 if (pVCpu->hm.s.fDebugWantRdTscExit != RT_BOOL(pDbgState->fCpe1Extra & VMX_PROC_CTLS_RDTSC_EXIT)) 9178 9179 { 9179 9180 pVCpu->hm.s.fDebugWantRdTscExit ^= true; … … 10306 10307 rc = VMXReadVmcs64(VMX_VMCS64_GUEST_DEBUGCTL_FULL, &u64Val); 10307 10308 AssertRCBreak(rc); 10308 if ( (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ VMCS_CTRL_ENTRY_LOAD_DEBUG)10309 if ( (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ENTRY_CTLS_LOAD_DEBUG) 10309 10310 && (u64Val & 0xfffffe3c)) /* Bits 31:9, bits 5:2 MBZ. */ 10310 10311 { … … 10318 10319 Assert(u32Val == pVCpu->hm.s.vmx.u32EntryCtls); 10319 10320 #endif 10320 bool const fLongModeGuest = RT_BOOL(pVCpu->hm.s.vmx.u32EntryCtls & VMX_ VMCS_CTRL_ENTRY_IA32E_MODE_GUEST);10321 bool const fLongModeGuest = RT_BOOL(pVCpu->hm.s.vmx.u32EntryCtls & VMX_ENTRY_CTLS_IA32E_MODE_GUEST); 10321 10322 10322 10323 /* … … 10387 10388 * 51:32 beyond the processor's physical-address width are 0. */ 10388 10389 10389 if ( (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ VMCS_CTRL_ENTRY_LOAD_DEBUG)10390 if ( (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ENTRY_CTLS_LOAD_DEBUG) 10390 10391 && (pCtx->dr[7] & X86_DR7_MBZ_MASK)) 10391 10392 { … … 10405 10406 * PERF_GLOBAL MSR. 10406 10407 */ 10407 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_PERF_MSR)10408 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ENTRY_CTLS_LOAD_PERF_MSR) 10408 10409 { 10409 10410 rc = VMXReadVmcs64(VMX_VMCS64_GUEST_PERF_GLOBAL_CTRL_FULL, &u64Val); … … 10416 10417 * PAT MSR. 10417 10418 */ 10418 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_PAT_MSR)10419 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ENTRY_CTLS_LOAD_PAT_MSR) 10419 10420 { 10420 10421 rc = VMXReadVmcs64(VMX_VMCS64_GUEST_PAT_FULL, &u64Val); … … 10440 10441 * EFER MSR. 10441 10442 */ 10442 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR)10443 if (pVCpu->hm.s.vmx.u32EntryCtls & VMX_ENTRY_CTLS_LOAD_EFER_MSR) 10443 10444 { 10444 10445 Assert(pVM->hm.s.vmx.fSupportsVmcsEfer); … … 10448 10449 VMX_IGS_EFER_MSR_RESERVED); /* Bits 63:12, bit 9, bits 7:1 MBZ. */ 10449 10450 HMVMX_CHECK_BREAK(RT_BOOL(u64Val & MSR_K6_EFER_LMA) == RT_BOOL( pVCpu->hm.s.vmx.u32EntryCtls 10450 & VMX_ VMCS_CTRL_ENTRY_IA32E_MODE_GUEST),10451 & VMX_ENTRY_CTLS_IA32E_MODE_GUEST), 10451 10452 VMX_IGS_EFER_LMA_GUEST_MODE_MISMATCH); 10452 10453 HMVMX_CHECK_BREAK( fUnrestrictedGuest … … 10698 10699 AssertRCBreak(rc); 10699 10700 HMVMX_CHECK_BREAK( !u32ActivityState 10700 || (u32ActivityState & MSR_IA32_VMX_MISC_ACTIVITY_STATES(pVM->hm.s.vmx.Msrs.u64Misc)),10701 || (u32ActivityState & RT_BF_GET(pVM->hm.s.vmx.Msrs.u64Misc, VMX_BF_MISC_ACTIVITY_STATES)), 10701 10702 VMX_IGS_ACTIVITY_STATE_INVALID); 10702 10703 HMVMX_CHECK_BREAK( !(pCtx->ss.Attr.n.u2Dpl) … … 10714 10715 * currently don't use activity states but ACTIVE. */ 10715 10716 10716 HMVMX_CHECK_BREAK( !(pVCpu->hm.s.vmx.u32EntryCtls & VMX_ VMCS_CTRL_ENTRY_ENTRY_SMM)10717 HMVMX_CHECK_BREAK( !(pVCpu->hm.s.vmx.u32EntryCtls & VMX_ENTRY_CTLS_ENTRY_TO_SMM) 10717 10718 || u32ActivityState != VMX_VMCS_GUEST_ACTIVITY_SIPI_WAIT, VMX_IGS_ACTIVITY_STATE_SIPI_WAIT_INVALID); 10718 10719 … … 10744 10745 HMVMX_CHECK_BREAK(!(u32IntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_SMI), 10745 10746 VMX_IGS_INTERRUPTIBILITY_STATE_SMI_INVALID); 10746 HMVMX_CHECK_BREAK( !(pVCpu->hm.s.vmx.u32EntryCtls & VMX_ VMCS_CTRL_ENTRY_ENTRY_SMM)10747 HMVMX_CHECK_BREAK( !(pVCpu->hm.s.vmx.u32EntryCtls & VMX_ENTRY_CTLS_ENTRY_TO_SMM) 10747 10748 || (u32IntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_SMI), 10748 10749 VMX_IGS_INTERRUPTIBILITY_STATE_SMI_SMM_INVALID); 10749 if ( (pVCpu->hm.s.vmx.u32PinCtls & VMX_ VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI)10750 if ( (pVCpu->hm.s.vmx.u32PinCtls & VMX_PIN_CTLS_VIRT_NMI) 10750 10751 && VMX_ENTRY_INT_INFO_IS_VALID(u32EntryInfo) 10751 10752 && VMX_ENTRY_INT_INFO_TYPE(u32EntryInfo) == VMX_EXIT_INT_INFO_TYPE_NMI) … … 10868 10869 10869 10870 uint32_t uIntType = VMX_EXIT_INT_INFO_TYPE(pVmxTransient->uExitIntInfo); 10870 Assert( !(pVCpu->hm.s.vmx.u32ExitCtls & VMX_ VMCS_CTRL_EXIT_ACK_EXT_INT)10871 Assert( !(pVCpu->hm.s.vmx.u32ExitCtls & VMX_EXIT_CTLS_ACK_EXT_INT) 10871 10872 && uIntType != VMX_EXIT_INT_INFO_TYPE_EXT_INT); 10872 10873 Assert(VMX_EXIT_INT_INFO_IS_VALID(pVmxTransient->uExitIntInfo)); … … 11013 11014 { 11014 11015 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); 11015 if (RT_UNLIKELY(!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT)))11016 if (RT_UNLIKELY(!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_NMI_WINDOW_EXIT))) 11016 11017 { 11017 11018 AssertMsgFailed(("Unexpected NMI-window exit.\n")); … … 11151 11152 /* If we get a spurious VM-exit when offsetting is enabled, 11152 11153 we must reset offsetting on VM-reentry. See @bugref{6634}. */ 11153 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING)11154 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TSC_OFFSETTING) 11154 11155 pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true; 11155 11156 ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS … … 11180 11181 /* If we get a spurious VM-exit when offsetting is enabled, 11181 11182 we must reset offsetting on VM-reentry. See @bugref{6634}. */ 11182 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING)11183 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TSC_OFFSETTING) 11183 11184 pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true; 11184 11185 ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS … … 11453 11454 { 11454 11455 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); 11455 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_HLT_EXIT);11456 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_HLT_EXIT); 11456 11457 11457 11458 int rc = hmR0VmxAdvanceGuestRip(pVCpu, pVmxTransient); … … 11632 11633 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); 11633 11634 11634 /* By default, we don't enable VMX_ VMCS_CTRL_PROC_EXEC2_DESCRIPTOR_TABLE_EXIT. */11635 /* By default, we don't enable VMX_PROC_CTLS2_DESCRIPTOR_TABLE_EXIT. */ 11635 11636 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitXdtrAccess); 11636 if (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_ VMCS_CTRL_PROC_EXEC2_DESCRIPTOR_TABLE_EXIT)11637 if (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_PROC_CTLS2_DESC_TABLE_EXIT) 11637 11638 return VERR_EM_INTERPRETER; 11638 11639 AssertMsgFailed(("Unexpected XDTR access\n")); … … 11648 11649 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); 11649 11650 11650 /* By default, we don't enable VMX_ VMCS_CTRL_PROC_EXEC2_RDRAND_EXIT. */11651 if (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_ VMCS_CTRL_PROC_EXEC2_RDRAND_EXIT)11651 /* By default, we don't enable VMX_PROC_CTLS2_RDRAND_EXIT. */ 11652 if (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_PROC_CTLS2_RDRAND_EXIT) 11652 11653 return VERR_EM_INTERPRETER; 11653 11654 AssertMsgFailed(("Unexpected RDRAND exit\n")); … … 11675 11676 11676 11677 #ifdef VBOX_STRICT 11677 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS)11678 if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS) 11678 11679 { 11679 11680 if ( hmR0VmxIsAutoLoadStoreGuestMsr(pVCpu, idMsr) … … 11765 11766 11766 11767 /* Update MSRs that are part of the VMCS and auto-load/store area when MSR-bitmaps are not supported. */ 11767 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS))11768 if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS)) 11768 11769 { 11769 11770 switch (idMsr) … … 11864 11865 { 11865 11866 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); 11866 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW);11867 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW); 11867 11868 11868 11869 /* … … 11974 11975 { 11975 11976 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitCR8Write); 11976 Assert(!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW));11977 Assert(!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW)); 11977 11978 ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, 11978 11979 HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS | HM_CHANGED_GUEST_APIC_TPR); … … 11994 11995 /* CR8 reads only cause a VM-exit when the TPR shadow feature isn't enabled. */ 11995 11996 Assert( VMX_EXIT_QUAL_CRX_REGISTER(uExitQualification) != 8 11996 || !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW));11997 || !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW)); 11997 11998 11998 11999 rcStrict = IEMExecDecodedMovCRxRead(pVCpu, pVmxTransient->cbInstr, … … 12127 12128 Log4(("CS:RIP=%04x:%08RX64 %#06x/%u %c str\n", pCtx->cs.Sel, pCtx->rip, uIOPort, cbValue, fIOWrite ? 'w' : 'r')); 12128 12129 AssertReturn(pCtx->dx == uIOPort, VERR_VMX_IPE_2); 12129 if (MSR_IA32_VMX_BASIC_VMCS_INS_OUTS(pVM->hm.s.vmx.Msrs.u64Basic)) 12130 bool const fInsOutsInfo = RT_BF_GET(pVM->hm.s.vmx.Msrs.u64Basic, VMX_BF_BASIC_VMCS_INS_OUTS); 12131 if (fInsOutsInfo) 12130 12132 { 12131 12133 int rc2 = hmR0VmxReadExitInstrInfoVmcs(pVmxTransient); … … 12368 12370 { 12369 12371 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); 12370 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG);12371 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG;12372 Assert(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_MONITOR_TRAP_FLAG); 12373 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_PROC_CTLS_MONITOR_TRAP_FLAG; 12372 12374 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 12373 12375 AssertRCReturn(rc, rc); … … 12417 12419 case VMX_APIC_ACCESS_TYPE_LINEAR_READ: 12418 12420 { 12419 AssertMsg( !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)12421 AssertMsg( !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW) 12420 12422 || VMX_EXIT_QUAL_APIC_ACCESS_OFFSET(pVmxTransient->uExitQualification) != XAPIC_OFF_TPR, 12421 12423 ("hmR0VmxExitApicAccess: can't access TPR offset while using TPR shadowing.\n")); … … 12478 12480 12479 12481 /* Don't intercept MOV DRx any more. */ 12480 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT;12482 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_PROC_CTLS_MOV_DR_EXIT; 12481 12483 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); 12482 12484 AssertRCReturn(rc, rc); -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r73097 r73389 901 901 902 902 /** 903 * Displays the host and guest VMX features. 904 * 905 * @param pVM The cross context VM structure. 906 * @param pHlp The info helper functions. 907 * @param pszArgs "terse", "default" or "verbose". 908 */ 909 DECLCALLBACK(void) cpumR3InfoVmxFeatures(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs) 910 { 911 RT_NOREF(pszArgs); 912 PCCPUMFEATURES pHostFeatures = &pVM->cpum.s.HostFeatures; 913 PCCPUMFEATURES pGuestFeatures = &pVM->cpum.s.GuestFeatures; 914 if ( pHostFeatures->enmCpuVendor == CPUMCPUVENDOR_INTEL 915 || pHostFeatures->enmCpuVendor == CPUMCPUVENDOR_VIA) 916 { 917 #define VMXFEATDUMP(a_szDesc, a_Var) \ 918 pHlp->pfnPrintf(pHlp, " %s = %u (%u)\n", a_szDesc, pGuestFeatures->a_Var, pHostFeatures->a_Var) 919 920 pHlp->pfnPrintf(pHlp, "Nested hardware virtualization - VMX features\n"); 921 pHlp->pfnPrintf(pHlp, " Mnemonic - Description = guest (host)\n"); 922 VMXFEATDUMP("VMX - Virtual-Machine Extensions ", fVmx); 923 /* Basic. */ 924 VMXFEATDUMP("InsOutInfo - INS/OUTS instruction info. ", fVmxInsOutInfo); 925 /* Pin-based controls. */ 926 VMXFEATDUMP("ExtIntExit - External interrupt VM-exit ", fVmxExtIntExit); 927 VMXFEATDUMP("NmiExit - NMI VM-exit ", fVmxNmiExit); 928 VMXFEATDUMP("VirtNmi - Virtual NMIs ", fVmxVirtNmi); 929 VMXFEATDUMP("PreemptTimer - VMX preemption timer ", fVmxPreemptTimer); 930 /* Processor-based controls. */ 931 VMXFEATDUMP("IntWindowExit - Interrupt-window exiting ", fVmxIntWindowExit); 932 VMXFEATDUMP("TscOffsetting - TSC offsetting ", fVmxTscOffsetting); 933 VMXFEATDUMP("HltExit - HLT exiting ", fVmxHltExit); 934 VMXFEATDUMP("InvlpgExit - INVLPG exiting ", fVmxInvlpgExit); 935 VMXFEATDUMP("MwaitExit - MWAIT exiting ", fVmxMwaitExit); 936 VMXFEATDUMP("RdpmcExit - RDPMC exiting ", fVmxRdpmcExit); 937 VMXFEATDUMP("RdtscExit - RDTSC exiting ", fVmxRdtscExit); 938 VMXFEATDUMP("Cr3LoadExit - CR3-load exiting ", fVmxCr3LoadExit); 939 VMXFEATDUMP("Cr3StoreExit - CR3-store exiting ", fVmxCr3StoreExit); 940 VMXFEATDUMP("Cr8LoadExit - CR8-load exiting ", fVmxCr8LoadExit); 941 VMXFEATDUMP("Cr8StoreExit - CR8-store exiting ", fVmxCr8StoreExit); 942 VMXFEATDUMP("TprShadow - TPR shadow ", fVmxTprShadow); 943 VMXFEATDUMP("NmiWindowExit - NMI-window exiting ", fVmxNmiWindowExit); 944 VMXFEATDUMP("MovDRxExit - Mov-DR exiting ", fVmxMovDRxExit); 945 VMXFEATDUMP("UncondIoExit - Unconditional I/O exiting ", fVmxUncondIoExit); 946 VMXFEATDUMP("UseIoBitmaps - Use I/O bitmaps ", fVmxUseIoBitmaps); 947 VMXFEATDUMP("MonitorTrapFlag - Monitor trap flag ", fVmxMonitorTrapFlag); 948 VMXFEATDUMP("UseMsrBitmaps - MSR bitmaps ", fVmxUseMsrBitmaps); 949 VMXFEATDUMP("MonitorExit - MONITOR exiting ", fVmxMonitorExit); 950 VMXFEATDUMP("PauseExit - PAUSE exiting ", fVmxPauseExit); 951 VMXFEATDUMP("SecondaryExecCtl - Activate secondary controls ", fVmxSecondaryExecCtls); 952 /* Secondary processor-based controls. */ 953 VMXFEATDUMP("VirtApic - Virtualize-APIC accesses ", fVmxVirtApicAccess); 954 VMXFEATDUMP("Ept - Extended Page Tables ", fVmxEpt); 955 VMXFEATDUMP("DescTableExit - Descriptor-table exiting ", fVmxDescTableExit); 956 VMXFEATDUMP("Rdtscp - Enable RDTSCP ", fVmxRdtscp); 957 VMXFEATDUMP("VirtX2Apic - Virtualize-x2APIC accesses ", fVmxVirtX2ApicAccess); 958 VMXFEATDUMP("Vpid - Enable VPID ", fVmxVpid); 959 VMXFEATDUMP("WbinvdExit - WBINVD exiting ", fVmxWbinvdExit); 960 VMXFEATDUMP("UnrestrictedGuest - Unrestricted guest ", fVmxUnrestrictedGuest); 961 VMXFEATDUMP("PauseLoopExit - PAUSE-loop exiting ", fVmxPauseLoopExit); 962 VMXFEATDUMP("Invpcid - Enable INVPCID ", fVmxInvpcid); 963 /* VM-entry controls. */ 964 VMXFEATDUMP("EntryLoadDebugCtls - Load debug controls on VM-entry ", fVmxEntryLoadDebugCtls); 965 VMXFEATDUMP("Ia32eModeGuest - IA-32e mode guest ", fVmxIa32eModeGuest); 966 VMXFEATDUMP("EntryLoadEferMsr - Load IA32_EFER on VM-entry ", fVmxEntryLoadEferMsr); 967 /* VM-exit controls. */ 968 VMXFEATDUMP("ExitSaveDebugCtls - Save debug controls on VM-exit ", fVmxExitSaveDebugCtls); 969 VMXFEATDUMP("HostAddrSpaceSize - Host address-space size ", fVmxHostAddrSpaceSize); 970 VMXFEATDUMP("ExitAckExtInt - Acknowledge interrupt on VM-exit ", fVmxExitAckExtInt); 971 VMXFEATDUMP("ExitSaveEferMsr - Save IA32_EFER on VM-exit ", fVmxExitSaveEferMsr); 972 VMXFEATDUMP("ExitLoadEferMsr - Load IA32_EFER on VM-exit ", fVmxExitLoadEferMsr); 973 VMXFEATDUMP("SavePreemptTimer - Save VMX-preemption timer ", fVmxSavePreemptTimer); 974 VMXFEATDUMP("ExitStoreEferLma - Store EFER.LMA on VM-exit ", fVmxExitStoreEferLma); 975 VMXFEATDUMP("VmwriteAll - VMWRITE to any VMCS field ", fVmxVmwriteAll); 976 VMXFEATDUMP("EntryInjectSoftInt - Inject softint. with 0-len instr. ", fVmxEntryInjectSoftInt); 977 #undef VMXFEATDUMP 978 } 979 else 980 pHlp->pfnPrintf(pHlp, "No VMX features present - requires an Intel or compatible CPU.\n"); 981 } 982 983 984 /** 985 * Initializes VMX host and guest features. 986 * 987 * @param pVM The cross context VM structure. 988 * 989 * @remarks This must be called only after HM has fully initialized since it calls 990 * into HM to retrieve VMX and related MSRs. 991 */ 992 static void cpumR3InitVmxCpuFeatures(PVM pVM) 993 { 994 /* 995 * Init. host features. 996 */ 997 PCPUMFEATURES pHostFeat = &pVM->cpum.s.HostFeatures; 998 VMXMSRS VmxMsrs; 999 int rc = HMVmxGetHostMsrs(pVM, &VmxMsrs); 1000 if (RT_SUCCESS(rc)) 1001 { 1002 /* Basic information. */ 1003 pHostFeat->fVmxInsOutInfo = RT_BF_GET(VmxMsrs.u64Basic, VMX_BF_BASIC_VMCS_INS_OUTS); 1004 1005 /* Pin-based VM-execution controls. */ 1006 uint32_t const fPinCtls = VmxMsrs.PinCtls.n.allowed1; 1007 pHostFeat->fVmxExtIntExit = RT_BOOL(fPinCtls & VMX_PIN_CTLS_EXT_INT_EXIT); 1008 pHostFeat->fVmxNmiExit = RT_BOOL(fPinCtls & VMX_PIN_CTLS_NMI_EXIT); 1009 pHostFeat->fVmxVirtNmi = RT_BOOL(fPinCtls & VMX_PIN_CTLS_VIRT_NMI); 1010 pHostFeat->fVmxPreemptTimer = RT_BOOL(fPinCtls & VMX_PIN_CTLS_PREEMPT_TIMER); 1011 1012 /* Processor-based VM-execution controls. */ 1013 uint32_t const fProcCtls = VmxMsrs.ProcCtls.n.allowed1; 1014 pHostFeat->fVmxIntWindowExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_INT_WINDOW_EXIT); 1015 pHostFeat->fVmxTscOffsetting = RT_BOOL(fProcCtls & VMX_PROC_CTLS_USE_TSC_OFFSETTING); 1016 pHostFeat->fVmxHltExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_HLT_EXIT); 1017 pHostFeat->fVmxInvlpgExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_INVLPG_EXIT); 1018 pHostFeat->fVmxMwaitExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_MWAIT_EXIT); 1019 pHostFeat->fVmxRdpmcExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_RDPMC_EXIT); 1020 pHostFeat->fVmxRdtscExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_RDTSC_EXIT); 1021 pHostFeat->fVmxCr3LoadExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_CR3_LOAD_EXIT); 1022 pHostFeat->fVmxCr3StoreExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_CR3_STORE_EXIT); 1023 pHostFeat->fVmxCr8LoadExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_CR8_LOAD_EXIT); 1024 pHostFeat->fVmxCr8StoreExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_CR8_STORE_EXIT); 1025 pHostFeat->fVmxTprShadow = RT_BOOL(fProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW); 1026 pHostFeat->fVmxNmiWindowExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_NMI_WINDOW_EXIT); 1027 pHostFeat->fVmxMovDRxExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_MOV_DR_EXIT); 1028 pHostFeat->fVmxUncondIoExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_UNCOND_IO_EXIT); 1029 pHostFeat->fVmxUseIoBitmaps = RT_BOOL(fProcCtls & VMX_PROC_CTLS_USE_IO_BITMAPS); 1030 pHostFeat->fVmxMonitorTrapFlag = RT_BOOL(fProcCtls & VMX_PROC_CTLS_MONITOR_TRAP_FLAG); 1031 pHostFeat->fVmxUseMsrBitmaps = RT_BOOL(fProcCtls & VMX_PROC_CTLS_USE_MSR_BITMAPS); 1032 pHostFeat->fVmxMonitorExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_MONITOR_EXIT); 1033 pHostFeat->fVmxPauseExit = RT_BOOL(fProcCtls & VMX_PROC_CTLS_PAUSE_EXIT); 1034 pHostFeat->fVmxSecondaryExecCtls = RT_BOOL(fProcCtls & VMX_PROC_CTLS_USE_SECONDARY_CTLS); 1035 1036 /* Secondary processor-based VM-execution controls. */ 1037 if (pHostFeat->fVmxSecondaryExecCtls) 1038 { 1039 uint32_t const fProcCtls2 = VmxMsrs.ProcCtls2.n.allowed1; 1040 pHostFeat->fVmxVirtApicAccess = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_VIRT_APIC_ACCESS); 1041 pHostFeat->fVmxEpt = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_EPT); 1042 pHostFeat->fVmxDescTableExit = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_DESC_TABLE_EXIT); 1043 pHostFeat->fVmxRdtscp = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_RDTSCP); 1044 pHostFeat->fVmxVirtX2ApicAccess = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_VIRT_X2APIC_ACCESS); 1045 pHostFeat->fVmxVpid = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_VPID); 1046 pHostFeat->fVmxWbinvdExit = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_WBINVD_EXIT); 1047 pHostFeat->fVmxUnrestrictedGuest = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_UNRESTRICTED_GUEST); 1048 pHostFeat->fVmxPauseLoopExit = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_PAUSE_LOOP_EXIT); 1049 pHostFeat->fVmxInvpcid = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_INVPCID); 1050 } 1051 1052 /* VM-entry controls. */ 1053 uint32_t const fEntryCtls = VmxMsrs.EntryCtls.n.allowed1; 1054 pHostFeat->fVmxEntryLoadDebugCtls = RT_BOOL(fEntryCtls & VMX_ENTRY_CTLS_LOAD_DEBUG); 1055 pHostFeat->fVmxIa32eModeGuest = RT_BOOL(fEntryCtls & VMX_ENTRY_CTLS_IA32E_MODE_GUEST); 1056 pHostFeat->fVmxEntryLoadEferMsr = RT_BOOL(fEntryCtls & VMX_ENTRY_CTLS_LOAD_EFER_MSR); 1057 1058 /* VM-exit controls. */ 1059 uint32_t const fExitCtls = VmxMsrs.ExitCtls.n.allowed1; 1060 pHostFeat->fVmxExitSaveDebugCtls = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_SAVE_DEBUG); 1061 pHostFeat->fVmxHostAddrSpaceSize = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE); 1062 pHostFeat->fVmxExitAckExtInt = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_ACK_EXT_INT); 1063 pHostFeat->fVmxExitSaveEferMsr = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_SAVE_EFER_MSR); 1064 pHostFeat->fVmxExitLoadEferMsr = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_LOAD_EFER_MSR); 1065 pHostFeat->fVmxSavePreemptTimer = RT_BOOL(fExitCtls & VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER); 1066 1067 /* Miscellaneous data. */ 1068 uint32_t const fMiscData = VmxMsrs.u64Misc; 1069 pHostFeat->fVmxExitStoreEferLma = RT_BOOL(fMiscData & VMX_MISC_EXIT_STORE_EFER_LMA); 1070 pHostFeat->fVmxVmwriteAll = RT_BOOL(fMiscData & VMX_MISC_VMWRITE_ALL); 1071 pHostFeat->fVmxEntryInjectSoftInt = RT_BOOL(fMiscData & VMX_MISC_ENTRY_INJECT_SOFT_INT); 1072 } 1073 1074 /* 1075 * Initialize the set of VMX features we emulate. 1076 * Note! Some bits might be reported as 1 always if they fall under the default1 class bits 1077 * (e.g. fVmxEntryLoadDebugCtls), see @bugref{9180#c5}. 1078 */ 1079 CPUMFEATURES EmuFeat; 1080 RT_ZERO(EmuFeat); 1081 EmuFeat.fVmx = 1; 1082 EmuFeat.fVmxInsOutInfo = 0; 1083 EmuFeat.fVmxExtIntExit = 1; 1084 EmuFeat.fVmxNmiExit = 1; 1085 EmuFeat.fVmxVirtNmi = 0; 1086 EmuFeat.fVmxPreemptTimer = 0; 1087 EmuFeat.fVmxIntWindowExit = 1; 1088 EmuFeat.fVmxTscOffsetting = 1; 1089 EmuFeat.fVmxHltExit = 1; 1090 EmuFeat.fVmxInvlpgExit = 1; 1091 EmuFeat.fVmxMwaitExit = 1; 1092 EmuFeat.fVmxRdpmcExit = 1; 1093 EmuFeat.fVmxRdtscExit = 1; 1094 EmuFeat.fVmxCr3LoadExit = 1; 1095 EmuFeat.fVmxCr3StoreExit = 1; 1096 EmuFeat.fVmxCr8LoadExit = 1; 1097 EmuFeat.fVmxCr8StoreExit = 1; 1098 EmuFeat.fVmxTprShadow = 0; 1099 EmuFeat.fVmxNmiWindowExit = 0; 1100 EmuFeat.fVmxMovDRxExit = 1; 1101 EmuFeat.fVmxUncondIoExit = 1; 1102 EmuFeat.fVmxUseIoBitmaps = 1; 1103 EmuFeat.fVmxMonitorTrapFlag = 0; 1104 EmuFeat.fVmxUseMsrBitmaps = 0; 1105 EmuFeat.fVmxMonitorExit = 1; 1106 EmuFeat.fVmxPauseExit = 1; 1107 EmuFeat.fVmxSecondaryExecCtls = 1; 1108 EmuFeat.fVmxVirtApicAccess = 0; 1109 EmuFeat.fVmxEpt = 0; 1110 EmuFeat.fVmxDescTableExit = 1; 1111 EmuFeat.fVmxRdtscp = 1; 1112 EmuFeat.fVmxVirtX2ApicAccess = 0; 1113 EmuFeat.fVmxVpid = 0; 1114 EmuFeat.fVmxWbinvdExit = 1; 1115 EmuFeat.fVmxUnrestrictedGuest = 0; 1116 EmuFeat.fVmxPauseLoopExit = 0; 1117 EmuFeat.fVmxInvpcid = 1; 1118 EmuFeat.fVmxEntryLoadDebugCtls = 1; 1119 EmuFeat.fVmxIa32eModeGuest = 1; 1120 EmuFeat.fVmxEntryLoadEferMsr = 1; 1121 EmuFeat.fVmxExitSaveDebugCtls = 1; 1122 EmuFeat.fVmxHostAddrSpaceSize = 1; 1123 EmuFeat.fVmxExitAckExtInt = 0; 1124 EmuFeat.fVmxExitSaveEferMsr = 1; 1125 EmuFeat.fVmxExitLoadEferMsr = 1; 1126 EmuFeat.fVmxSavePreemptTimer = 0; 1127 EmuFeat.fVmxExitStoreEferLma = 1; 1128 EmuFeat.fVmxVmwriteAll = 0; 1129 EmuFeat.fVmxEntryInjectSoftInt = 0; 1130 1131 /* 1132 * Explode guest features. 1133 * 1134 * When hardware-assisted VMX may be used, any feature we emulate must also be supported 1135 * by the hardware, hence we merge our emulated features with the host features below. 1136 */ 1137 bool const fHostSupportsVmx = pHostFeat->fVmx; 1138 AssertLogRelReturnVoid(!fHostSupportsVmx || HMIsVmxSupported(pVM)); 1139 PCCPUMFEATURES pBaseFeat = fHostSupportsVmx ? pHostFeat : &EmuFeat; 1140 PCPUMFEATURES pGuestFeat = &pVM->cpum.s.GuestFeatures; 1141 pGuestFeat->fVmx = (pBaseFeat->fVmx & EmuFeat.fVmx ); 1142 pGuestFeat->fVmxInsOutInfo = (pBaseFeat->fVmxInsOutInfo & EmuFeat.fVmxInsOutInfo ); 1143 pGuestFeat->fVmxExtIntExit = (pBaseFeat->fVmxExtIntExit & EmuFeat.fVmxExtIntExit ); 1144 pGuestFeat->fVmxNmiExit = (pBaseFeat->fVmxNmiExit & EmuFeat.fVmxNmiExit ); 1145 pGuestFeat->fVmxVirtNmi = (pBaseFeat->fVmxVirtNmi & EmuFeat.fVmxVirtNmi ); 1146 pGuestFeat->fVmxPreemptTimer = (pBaseFeat->fVmxPreemptTimer & EmuFeat.fVmxPreemptTimer ); 1147 pGuestFeat->fVmxIntWindowExit = (pBaseFeat->fVmxIntWindowExit & EmuFeat.fVmxIntWindowExit ); 1148 pGuestFeat->fVmxTscOffsetting = (pBaseFeat->fVmxTscOffsetting & EmuFeat.fVmxTscOffsetting ); 1149 pGuestFeat->fVmxHltExit = (pBaseFeat->fVmxHltExit & EmuFeat.fVmxHltExit ); 1150 pGuestFeat->fVmxInvlpgExit = (pBaseFeat->fVmxInvlpgExit & EmuFeat.fVmxInvlpgExit ); 1151 pGuestFeat->fVmxMwaitExit = (pBaseFeat->fVmxMwaitExit & EmuFeat.fVmxMwaitExit ); 1152 pGuestFeat->fVmxRdpmcExit = (pBaseFeat->fVmxRdpmcExit & EmuFeat.fVmxRdpmcExit ); 1153 pGuestFeat->fVmxRdtscExit = (pBaseFeat->fVmxRdtscExit & EmuFeat.fVmxRdtscExit ); 1154 pGuestFeat->fVmxCr3LoadExit = (pBaseFeat->fVmxCr3LoadExit & EmuFeat.fVmxCr3LoadExit ); 1155 pGuestFeat->fVmxCr3StoreExit = (pBaseFeat->fVmxCr3StoreExit & EmuFeat.fVmxCr3StoreExit ); 1156 pGuestFeat->fVmxCr8LoadExit = (pBaseFeat->fVmxCr8LoadExit & EmuFeat.fVmxCr8LoadExit ); 1157 pGuestFeat->fVmxCr8StoreExit = (pBaseFeat->fVmxCr8StoreExit & EmuFeat.fVmxCr8StoreExit ); 1158 pGuestFeat->fVmxTprShadow = (pBaseFeat->fVmxTprShadow & EmuFeat.fVmxTprShadow ); 1159 pGuestFeat->fVmxNmiWindowExit = (pBaseFeat->fVmxNmiWindowExit & EmuFeat.fVmxNmiWindowExit ); 1160 pGuestFeat->fVmxMovDRxExit = (pBaseFeat->fVmxMovDRxExit & EmuFeat.fVmxMovDRxExit ); 1161 pGuestFeat->fVmxUncondIoExit = (pBaseFeat->fVmxUncondIoExit & EmuFeat.fVmxUncondIoExit ); 1162 pGuestFeat->fVmxUseIoBitmaps = (pBaseFeat->fVmxUseIoBitmaps & EmuFeat.fVmxUseIoBitmaps ); 1163 pGuestFeat->fVmxMonitorTrapFlag = (pBaseFeat->fVmxMonitorTrapFlag & EmuFeat.fVmxMonitorTrapFlag ); 1164 pGuestFeat->fVmxUseMsrBitmaps = (pBaseFeat->fVmxUseMsrBitmaps & EmuFeat.fVmxUseMsrBitmaps ); 1165 pGuestFeat->fVmxMonitorExit = (pBaseFeat->fVmxMonitorExit & EmuFeat.fVmxMonitorExit ); 1166 pGuestFeat->fVmxPauseExit = (pBaseFeat->fVmxPauseExit & EmuFeat.fVmxPauseExit ); 1167 pGuestFeat->fVmxSecondaryExecCtls = (pBaseFeat->fVmxSecondaryExecCtls & EmuFeat.fVmxSecondaryExecCtls ); 1168 pGuestFeat->fVmxVirtApicAccess = (pBaseFeat->fVmxVirtApicAccess & EmuFeat.fVmxVirtApicAccess ); 1169 pGuestFeat->fVmxEpt = (pBaseFeat->fVmxEpt & EmuFeat.fVmxEpt ); 1170 pGuestFeat->fVmxDescTableExit = (pBaseFeat->fVmxDescTableExit & EmuFeat.fVmxDescTableExit ); 1171 pGuestFeat->fVmxRdtscp = (pBaseFeat->fVmxRdtscp & EmuFeat.fVmxRdtscp ); 1172 pGuestFeat->fVmxVirtX2ApicAccess = (pBaseFeat->fVmxVirtX2ApicAccess & EmuFeat.fVmxVirtX2ApicAccess ); 1173 pGuestFeat->fVmxVpid = (pBaseFeat->fVmxVpid & EmuFeat.fVmxVpid ); 1174 pGuestFeat->fVmxWbinvdExit = (pBaseFeat->fVmxWbinvdExit & EmuFeat.fVmxWbinvdExit ); 1175 pGuestFeat->fVmxUnrestrictedGuest = (pBaseFeat->fVmxUnrestrictedGuest & EmuFeat.fVmxUnrestrictedGuest ); 1176 pGuestFeat->fVmxPauseLoopExit = (pBaseFeat->fVmxPauseLoopExit & EmuFeat.fVmxPauseLoopExit ); 1177 pGuestFeat->fVmxInvpcid = (pBaseFeat->fVmxInvpcid & EmuFeat.fVmxInvpcid ); 1178 pGuestFeat->fVmxEntryLoadDebugCtls = (pBaseFeat->fVmxEntryLoadDebugCtls & EmuFeat.fVmxEntryLoadDebugCtls ); 1179 pGuestFeat->fVmxIa32eModeGuest = (pBaseFeat->fVmxIa32eModeGuest & EmuFeat.fVmxIa32eModeGuest ); 1180 pGuestFeat->fVmxEntryLoadEferMsr = (pBaseFeat->fVmxEntryLoadEferMsr & EmuFeat.fVmxEntryLoadEferMsr); 1181 pGuestFeat->fVmxExitSaveDebugCtls = (pBaseFeat->fVmxExitSaveDebugCtls & EmuFeat.fVmxExitSaveDebugCtls ); 1182 pGuestFeat->fVmxHostAddrSpaceSize = (pBaseFeat->fVmxHostAddrSpaceSize & EmuFeat.fVmxHostAddrSpaceSize ); 1183 pGuestFeat->fVmxExitAckExtInt = (pBaseFeat->fVmxExitAckExtInt & EmuFeat.fVmxExitAckExtInt ); 1184 pGuestFeat->fVmxExitSaveEferMsr = (pBaseFeat->fVmxExitSaveEferMsr & EmuFeat.fVmxExitSaveEferMsr ); 1185 pGuestFeat->fVmxExitLoadEferMsr = (pBaseFeat->fVmxExitLoadEferMsr & EmuFeat.fVmxExitLoadEferMsr ); 1186 pGuestFeat->fVmxSavePreemptTimer = (pBaseFeat->fVmxSavePreemptTimer & EmuFeat.fVmxSavePreemptTimer ); 1187 pGuestFeat->fVmxExitStoreEferLma = (pBaseFeat->fVmxExitStoreEferLma & EmuFeat.fVmxExitStoreEferLma ); 1188 pGuestFeat->fVmxVmwriteAll = (pBaseFeat->fVmxVmwriteAll & EmuFeat.fVmxVmwriteAll ); 1189 pGuestFeat->fVmxEntryInjectSoftInt = (pBaseFeat->fVmxEntryInjectSoftInt & EmuFeat.fVmxEntryInjectSoftInt ); 1190 } 1191 1192 1193 /** 903 1194 * Initializes the CPUM. 904 1195 * … … 1061 1352 &cpumR3InfoGuestInstr, DBGFINFO_FLAGS_ALL_EMTS); 1062 1353 DBGFR3InfoRegisterInternal( pVM, "cpuid", "Displays the guest cpuid leaves.", &cpumR3CpuIdInfo); 1354 DBGFR3InfoRegisterInternal( pVM, "cpumvmxfeat", "Displays the host and guest VMX hwvirt. features.", 1355 &cpumR3InfoVmxFeatures); 1063 1356 1064 1357 rc = cpumR3DbgInit(pVM); … … 3002 3295 } 3003 3296 3297 case VMINITCOMPLETED_HM: 3298 { 3299 /* 3300 * Currently, nested VMX/SVM both derives their guest VMX/SVM CPUID bit from the host 3301 * CPUID bit. This could be later changed if we need to support nested-VMX on CPUs 3302 * that are not capable of VMX. 3303 */ 3304 if (pVM->cpum.s.GuestFeatures.fVmx) 3305 { 3306 Assert( pVM->cpum.s.GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_INTEL 3307 || pVM->cpum.s.GuestFeatures.enmCpuVendor == CPUMCPUVENDOR_VIA); 3308 cpumR3InitVmxCpuFeatures(pVM); 3309 DBGFR3Info(pVM->pUVM, "cpumvmxfeat", "default", DBGFR3InfoLogRelHlp()); 3310 } 3311 3312 if (pVM->cpum.s.GuestFeatures.fVmx) 3313 LogRel(("CPUM: Enabled guest VMX support\n")); 3314 else if (pVM->cpum.s.GuestFeatures.fSvm) 3315 LogRel(("CPUM: Enabled guest SVM support\n")); 3316 break; 3317 } 3318 3004 3319 default: 3005 3320 break; -
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r73274 r73389 1738 1738 pFeatures->fPcid = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_PCID); 1739 1739 pFeatures->fVmx = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_VMX); 1740 if (pFeatures->fVmx) 1741 { /** @todo Support other VMX features */ } 1740 /* VMX sub-features will be initialized in cpumR3InitVmxCpuFeatures(). */ 1742 1741 1743 1742 /* Structured extended features. */ -
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r73340 r73389 555 555 { 556 556 /* Hypervisor capabilities; features used by the hypervisor. */ 557 pHv->uHyperCaps = HMIsNestedPagingActive(pVM) 558 pHv->uHyperCaps |= HM AreMsrBitmapsAvailable(pVM) ? GIM_HV_HOST_FEAT_MSR_BITMAP: 0;557 pHv->uHyperCaps = HMIsNestedPagingActive(pVM) ? GIM_HV_HOST_FEAT_NESTED_PAGING : 0; 558 pHv->uHyperCaps |= HMIsMsrBitmapActive(pVM) ? GIM_HV_HOST_FEAT_MSR_BITMAP : 0; 559 559 } 560 560 -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r73294 r73389 1334 1334 1335 1335 /** 1336 * Returns the VMCS (and associated regions') memory type given the IA32_VMX_BASIC1337 * MSR.1336 * Returns a description of the VMCS (and associated regions') memory type given the 1337 * IA32_VMX_BASIC MSR. 1338 1338 * 1339 1339 * @returns The descriptive memory type. … … 1342 1342 static const char *hmR3VmxGetMemTypeDesc(uint64_t uMsrVmxBasic) 1343 1343 { 1344 uint8_t const uMemType = MSR_IA32_VMX_BASIC_VMCS_MEM_TYPE(uMsrVmxBasic);1344 uint8_t const uMemType = RT_BF_GET(uMsrVmxBasic, VMX_BF_BASIC_VMCS_MEM_TYPE); 1345 1345 switch (uMemType) 1346 1346 { 1347 case VMX_ VMCS_MEM_TYPE_WB: return "Write Back (WB)";1348 case VMX_ VMCS_MEM_TYPE_UC: return "Uncacheable (UC)";1347 case VMX_BASIC_MEM_TYPE_WB: return "Write Back (WB)"; 1348 case VMX_BASIC_MEM_TYPE_UC: return "Uncacheable (UC)"; 1349 1349 } 1350 1350 return "Unknown"; 1351 } 1352 1353 1354 /** 1355 * Returns a single-line description of all the activity-states supported by the CPU 1356 * given the IA32_VMX_MISC MSR. 1357 * 1358 * @returns All supported activity states. 1359 * @param uMsrMisc IA32_VMX_MISC MSR value. 1360 */ 1361 static const char *hmR3VmxGetActivityStateAllDesc(uint64_t uMsrMisc) 1362 { 1363 static const char * const s_apszActStates[] = 1364 { 1365 "", 1366 " ( HLT )", 1367 " ( SHUTDOWN )", 1368 " ( HLT SHUTDOWN )", 1369 " ( SIPI_WAIT )", 1370 " ( HLT SIPI_WAIT )", 1371 " ( SHUTDOWN SIPI_WAIT )", 1372 " ( HLT SHUTDOWN SIPI_WAIT )" 1373 }; 1374 uint8_t const idxActStates = RT_BF_GET(uMsrMisc, VMX_BF_MISC_ACTIVITY_STATES); 1375 Assert(idxActStates < RT_ELEMENTS(s_apszActStates)); 1376 return s_apszActStates[idxActStates]; 1351 1377 } 1352 1378 … … 1387 1413 static void hmR3VmxReportBasicMsr(uint64_t uBasicMsr) 1388 1414 { 1389 LogRel(("HM: MSR_IA32_VMX_BASIC = %#RX64\n", uBasicMsr));1390 LogRel(("HM: VMCS id = %#x\n", MSR_IA32_VMX_BASIC_VMCS_ID(uBasicMsr)));1391 LogRel(("HM: VMCS size = %u bytes\n", MSR_IA32_VMX_BASIC_VMCS_SIZE(uBasicMsr)));1392 LogRel(("HM: VMCS physical address limit = %s\n", MSR_IA32_VMX_BASIC_VMCS_PHYS_WIDTH(uBasicMsr) ? "< 4 GB"1393 1415 LogRel(("HM: MSR_IA32_VMX_BASIC = %#RX64\n", uBasicMsr)); 1416 LogRel(("HM: VMCS id = %#x\n", RT_BF_GET(uBasicMsr, VMX_BF_BASIC_VMCS_ID))); 1417 LogRel(("HM: VMCS size = %u bytes\n", RT_BF_GET(uBasicMsr, VMX_BF_BASIC_VMCS_SIZE))); 1418 LogRel(("HM: VMCS physical address limit = %s\n", RT_BF_GET(uBasicMsr, VMX_BF_BASIC_PHYSADDR_WIDTH) ? 1419 "< 4 GB" : "None")); 1394 1420 LogRel(("HM: VMCS memory type = %s\n", hmR3VmxGetMemTypeDesc(uBasicMsr))); 1395 LogRel(("HM: Dual-monitor treatment support = %RTbool\n", MSR_IA32_VMX_BASIC_DUAL_MON(uBasicMsr)));1396 LogRel(("HM: OUTS & INS instruction-info = %RTbool\n", MSR_IA32_VMX_BASIC_VMCS_INS_OUTS(uBasicMsr)));1397 LogRel(("HM: Supports true capability MSRs = %RTbool\n", MSR_IA32_VMX_BASIC_TRUE_CONTROLS(uBasicMsr)));1421 LogRel(("HM: Dual-monitor treatment support = %RTbool\n", RT_BF_GET(uBasicMsr, VMX_BF_BASIC_DUAL_MON))); 1422 LogRel(("HM: OUTS & INS instruction-info = %RTbool\n", RT_BF_GET(uBasicMsr, VMX_BF_BASIC_VMCS_INS_OUTS))); 1423 LogRel(("HM: Supports true capability MSRs = %RTbool\n", RT_BF_GET(uBasicMsr, VMX_BF_BASIC_TRUE_CTLS))); 1398 1424 } 1399 1425 … … 1409 1435 uint64_t const zap = pVmxMsr->n.disallowed0; 1410 1436 LogRel(("HM: MSR_IA32_VMX_PINBASED_CTLS = %#RX64\n", pVmxMsr->u)); 1411 HMVMX_REPORT_FEAT(val, zap, "EXT_INT_EXIT", VMX_ VMCS_CTRL_PIN_EXEC_EXT_INT_EXIT);1412 HMVMX_REPORT_FEAT(val, zap, "NMI_EXIT", VMX_ VMCS_CTRL_PIN_EXEC_NMI_EXIT);1413 HMVMX_REPORT_FEAT(val, zap, "VIRTUAL_NMI", VMX_ VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI);1414 HMVMX_REPORT_FEAT(val, zap, "PREEMPT_TIMER", VMX_ VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER);1415 HMVMX_REPORT_FEAT(val, zap, "POSTED_INT R", VMX_VMCS_CTRL_PIN_EXEC_POSTED_INTR);1437 HMVMX_REPORT_FEAT(val, zap, "EXT_INT_EXIT", VMX_PIN_CTLS_EXT_INT_EXIT); 1438 HMVMX_REPORT_FEAT(val, zap, "NMI_EXIT", VMX_PIN_CTLS_NMI_EXIT); 1439 HMVMX_REPORT_FEAT(val, zap, "VIRTUAL_NMI", VMX_PIN_CTLS_VIRT_NMI); 1440 HMVMX_REPORT_FEAT(val, zap, "PREEMPT_TIMER", VMX_PIN_CTLS_PREEMPT_TIMER); 1441 HMVMX_REPORT_FEAT(val, zap, "POSTED_INT", VMX_PIN_CTLS_POSTED_INT); 1416 1442 } 1417 1443 … … 1427 1453 uint64_t const zap = pVmxMsr->n.disallowed0; 1428 1454 LogRel(("HM: MSR_IA32_VMX_PROCBASED_CTLS = %#RX64\n", pVmxMsr->u)); 1429 HMVMX_REPORT_FEAT(val, zap, "INT_WINDOW_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT);1430 HMVMX_REPORT_FEAT(val, zap, "USE_TSC_OFFSETTING", VMX_ VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING);1431 HMVMX_REPORT_FEAT(val, zap, "HLT_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_HLT_EXIT);1432 HMVMX_REPORT_FEAT(val, zap, "INVLPG_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_INVLPG_EXIT);1433 HMVMX_REPORT_FEAT(val, zap, "MWAIT_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_MWAIT_EXIT);1434 HMVMX_REPORT_FEAT(val, zap, "RDPMC_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_RDPMC_EXIT);1435 HMVMX_REPORT_FEAT(val, zap, "RDTSC_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT);1436 HMVMX_REPORT_FEAT(val, zap, "CR3_LOAD_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT);1437 HMVMX_REPORT_FEAT(val, zap, "CR3_STORE_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT);1438 HMVMX_REPORT_FEAT(val, zap, "CR8_LOAD_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT);1439 HMVMX_REPORT_FEAT(val, zap, "CR8_STORE_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT);1440 HMVMX_REPORT_FEAT(val, zap, "USE_TPR_SHADOW", VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW);1441 HMVMX_REPORT_FEAT(val, zap, "NMI_WINDOW_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT);1442 HMVMX_REPORT_FEAT(val, zap, "MOV_DR_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT);1443 HMVMX_REPORT_FEAT(val, zap, "UNCOND_IO_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_UNCOND_IO_EXIT);1444 HMVMX_REPORT_FEAT(val, zap, "USE_IO_BITMAPS", VMX_ VMCS_CTRL_PROC_EXEC_USE_IO_BITMAPS);1445 HMVMX_REPORT_FEAT(val, zap, "MONITOR_TRAP_FLAG", VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG);1446 HMVMX_REPORT_FEAT(val, zap, "USE_MSR_BITMAPS", VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS);1447 HMVMX_REPORT_FEAT(val, zap, "MONITOR_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_EXIT);1448 HMVMX_REPORT_FEAT(val, zap, "PAUSE_EXIT", VMX_ VMCS_CTRL_PROC_EXEC_PAUSE_EXIT);1449 HMVMX_REPORT_FEAT(val, zap, "USE_SECONDARY_ EXEC_CTRL", VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL);1455 HMVMX_REPORT_FEAT(val, zap, "INT_WINDOW_EXIT", VMX_PROC_CTLS_INT_WINDOW_EXIT); 1456 HMVMX_REPORT_FEAT(val, zap, "USE_TSC_OFFSETTING", VMX_PROC_CTLS_USE_TSC_OFFSETTING); 1457 HMVMX_REPORT_FEAT(val, zap, "HLT_EXIT", VMX_PROC_CTLS_HLT_EXIT); 1458 HMVMX_REPORT_FEAT(val, zap, "INVLPG_EXIT", VMX_PROC_CTLS_INVLPG_EXIT); 1459 HMVMX_REPORT_FEAT(val, zap, "MWAIT_EXIT", VMX_PROC_CTLS_MWAIT_EXIT); 1460 HMVMX_REPORT_FEAT(val, zap, "RDPMC_EXIT", VMX_PROC_CTLS_RDPMC_EXIT); 1461 HMVMX_REPORT_FEAT(val, zap, "RDTSC_EXIT", VMX_PROC_CTLS_RDTSC_EXIT); 1462 HMVMX_REPORT_FEAT(val, zap, "CR3_LOAD_EXIT", VMX_PROC_CTLS_CR3_LOAD_EXIT); 1463 HMVMX_REPORT_FEAT(val, zap, "CR3_STORE_EXIT", VMX_PROC_CTLS_CR3_STORE_EXIT); 1464 HMVMX_REPORT_FEAT(val, zap, "CR8_LOAD_EXIT", VMX_PROC_CTLS_CR8_LOAD_EXIT); 1465 HMVMX_REPORT_FEAT(val, zap, "CR8_STORE_EXIT", VMX_PROC_CTLS_CR8_STORE_EXIT); 1466 HMVMX_REPORT_FEAT(val, zap, "USE_TPR_SHADOW", VMX_PROC_CTLS_USE_TPR_SHADOW); 1467 HMVMX_REPORT_FEAT(val, zap, "NMI_WINDOW_EXIT", VMX_PROC_CTLS_NMI_WINDOW_EXIT); 1468 HMVMX_REPORT_FEAT(val, zap, "MOV_DR_EXIT", VMX_PROC_CTLS_MOV_DR_EXIT); 1469 HMVMX_REPORT_FEAT(val, zap, "UNCOND_IO_EXIT", VMX_PROC_CTLS_UNCOND_IO_EXIT); 1470 HMVMX_REPORT_FEAT(val, zap, "USE_IO_BITMAPS", VMX_PROC_CTLS_USE_IO_BITMAPS); 1471 HMVMX_REPORT_FEAT(val, zap, "MONITOR_TRAP_FLAG", VMX_PROC_CTLS_MONITOR_TRAP_FLAG); 1472 HMVMX_REPORT_FEAT(val, zap, "USE_MSR_BITMAPS", VMX_PROC_CTLS_USE_MSR_BITMAPS); 1473 HMVMX_REPORT_FEAT(val, zap, "MONITOR_EXIT", VMX_PROC_CTLS_MONITOR_EXIT); 1474 HMVMX_REPORT_FEAT(val, zap, "PAUSE_EXIT", VMX_PROC_CTLS_PAUSE_EXIT); 1475 HMVMX_REPORT_FEAT(val, zap, "USE_SECONDARY_CTLS", VMX_PROC_CTLS_USE_SECONDARY_CTLS); 1450 1476 } 1451 1477 … … 1461 1487 uint64_t const zap = pVmxMsr->n.disallowed0; 1462 1488 LogRel(("HM: MSR_IA32_VMX_PROCBASED_CTLS2 = %#RX64\n", pVmxMsr->u)); 1463 HMVMX_REPORT_FEAT(val, zap, "VIRT_APIC ", VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC);1464 HMVMX_REPORT_FEAT(val, zap, "EPT", VMX_ VMCS_CTRL_PROC_EXEC2_EPT);1465 HMVMX_REPORT_FEAT(val, zap, "DESC RIPTOR_TABLE_EXIT", VMX_VMCS_CTRL_PROC_EXEC2_DESCRIPTOR_TABLE_EXIT);1466 HMVMX_REPORT_FEAT(val, zap, "RDTSCP", VMX_ VMCS_CTRL_PROC_EXEC2_RDTSCP);1467 HMVMX_REPORT_FEAT(val, zap, "VIRT_X2APIC ", VMX_VMCS_CTRL_PROC_EXEC2_VIRT_X2APIC);1468 HMVMX_REPORT_FEAT(val, zap, "VPID", VMX_ VMCS_CTRL_PROC_EXEC2_VPID);1469 HMVMX_REPORT_FEAT(val, zap, "WBINVD_EXIT", VMX_ VMCS_CTRL_PROC_EXEC2_WBINVD_EXIT);1470 HMVMX_REPORT_FEAT(val, zap, "UNRESTRICTED_GUEST", VMX_ VMCS_CTRL_PROC_EXEC2_UNRESTRICTED_GUEST);1471 HMVMX_REPORT_FEAT(val, zap, "APIC_REG_VIRT", VMX_ VMCS_CTRL_PROC_EXEC2_APIC_REG_VIRT);1472 HMVMX_REPORT_FEAT(val, zap, "VIRT_INT R_DELIVERY", VMX_VMCS_CTRL_PROC_EXEC2_VIRT_INTR_DELIVERY);1473 HMVMX_REPORT_FEAT(val, zap, "PAUSE_LOOP_EXIT", VMX_ VMCS_CTRL_PROC_EXEC2_PAUSE_LOOP_EXIT);1474 HMVMX_REPORT_FEAT(val, zap, "RDRAND_EXIT", VMX_ VMCS_CTRL_PROC_EXEC2_RDRAND_EXIT);1475 HMVMX_REPORT_FEAT(val, zap, "INVPCID", VMX_ VMCS_CTRL_PROC_EXEC2_INVPCID);1476 HMVMX_REPORT_FEAT(val, zap, "VMFUNC", VMX_ VMCS_CTRL_PROC_EXEC2_VMFUNC);1477 HMVMX_REPORT_FEAT(val, zap, "VMCS_SHADOWING", VMX_ VMCS_CTRL_PROC_EXEC2_VMCS_SHADOWING);1478 HMVMX_REPORT_FEAT(val, zap, "ENCLS_EXIT", VMX_ VMCS_CTRL_PROC_EXEC2_ENCLS_EXIT);1479 HMVMX_REPORT_FEAT(val, zap, "RDSEED_EXIT", VMX_ VMCS_CTRL_PROC_EXEC2_RDSEED_EXIT);1480 HMVMX_REPORT_FEAT(val, zap, "PML", VMX_ VMCS_CTRL_PROC_EXEC2_PML);1481 HMVMX_REPORT_FEAT(val, zap, "EPT_VE", VMX_ VMCS_CTRL_PROC_EXEC2_EPT_VE);1482 HMVMX_REPORT_FEAT(val, zap, "CONCEAL_FROM_PT", VMX_ VMCS_CTRL_PROC_EXEC2_CONCEAL_FROM_PT);1483 HMVMX_REPORT_FEAT(val, zap, "XSAVES_XRSTORS", VMX_ VMCS_CTRL_PROC_EXEC2_XSAVES_XRSTORS);1484 HMVMX_REPORT_FEAT(val, zap, "TSC_SCALING", VMX_ VMCS_CTRL_PROC_EXEC2_TSC_SCALING);1489 HMVMX_REPORT_FEAT(val, zap, "VIRT_APIC_ACCESS", VMX_PROC_CTLS2_VIRT_APIC_ACCESS); 1490 HMVMX_REPORT_FEAT(val, zap, "EPT", VMX_PROC_CTLS2_EPT); 1491 HMVMX_REPORT_FEAT(val, zap, "DESC_TABLE_EXIT", VMX_PROC_CTLS2_DESC_TABLE_EXIT); 1492 HMVMX_REPORT_FEAT(val, zap, "RDTSCP", VMX_PROC_CTLS2_RDTSCP); 1493 HMVMX_REPORT_FEAT(val, zap, "VIRT_X2APIC_ACCESS", VMX_PROC_CTLS2_VIRT_X2APIC_ACCESS); 1494 HMVMX_REPORT_FEAT(val, zap, "VPID", VMX_PROC_CTLS2_VPID); 1495 HMVMX_REPORT_FEAT(val, zap, "WBINVD_EXIT", VMX_PROC_CTLS2_WBINVD_EXIT); 1496 HMVMX_REPORT_FEAT(val, zap, "UNRESTRICTED_GUEST", VMX_PROC_CTLS2_UNRESTRICTED_GUEST); 1497 HMVMX_REPORT_FEAT(val, zap, "APIC_REG_VIRT", VMX_PROC_CTLS2_APIC_REG_VIRT); 1498 HMVMX_REPORT_FEAT(val, zap, "VIRT_INT_DELIVERY", VMX_PROC_CTLS2_VIRT_INT_DELIVERY); 1499 HMVMX_REPORT_FEAT(val, zap, "PAUSE_LOOP_EXIT", VMX_PROC_CTLS2_PAUSE_LOOP_EXIT); 1500 HMVMX_REPORT_FEAT(val, zap, "RDRAND_EXIT", VMX_PROC_CTLS2_RDRAND_EXIT); 1501 HMVMX_REPORT_FEAT(val, zap, "INVPCID", VMX_PROC_CTLS2_INVPCID); 1502 HMVMX_REPORT_FEAT(val, zap, "VMFUNC", VMX_PROC_CTLS2_VMFUNC); 1503 HMVMX_REPORT_FEAT(val, zap, "VMCS_SHADOWING", VMX_PROC_CTLS2_VMCS_SHADOWING); 1504 HMVMX_REPORT_FEAT(val, zap, "ENCLS_EXIT", VMX_PROC_CTLS2_ENCLS_EXIT); 1505 HMVMX_REPORT_FEAT(val, zap, "RDSEED_EXIT", VMX_PROC_CTLS2_RDSEED_EXIT); 1506 HMVMX_REPORT_FEAT(val, zap, "PML", VMX_PROC_CTLS2_PML); 1507 HMVMX_REPORT_FEAT(val, zap, "EPT_VE", VMX_PROC_CTLS2_EPT_VE); 1508 HMVMX_REPORT_FEAT(val, zap, "CONCEAL_FROM_PT", VMX_PROC_CTLS2_CONCEAL_FROM_PT); 1509 HMVMX_REPORT_FEAT(val, zap, "XSAVES_XRSTORS", VMX_PROC_CTLS2_XSAVES_XRSTORS); 1510 HMVMX_REPORT_FEAT(val, zap, "TSC_SCALING", VMX_PROC_CTLS2_TSC_SCALING); 1485 1511 } 1486 1512 … … 1496 1522 uint64_t const zap = pVmxMsr->n.disallowed0; 1497 1523 LogRel(("HM: MSR_IA32_VMX_ENTRY_CTLS = %#RX64\n", pVmxMsr->u)); 1498 HMVMX_REPORT_FEAT(val, zap, "LOAD_DEBUG", VMX_ VMCS_CTRL_ENTRY_LOAD_DEBUG);1499 HMVMX_REPORT_FEAT(val, zap, "IA32E_MODE_GUEST", VMX_ VMCS_CTRL_ENTRY_IA32E_MODE_GUEST);1500 HMVMX_REPORT_FEAT(val, zap, "ENTRY_ SMM", VMX_VMCS_CTRL_ENTRY_ENTRY_SMM);1501 HMVMX_REPORT_FEAT(val, zap, "DEACTIVATE_DUAL MON", VMX_VMCS_CTRL_ENTRY_DEACTIVATE_DUALMON);1502 HMVMX_REPORT_FEAT(val, zap, "LOAD_ GUEST_PERF_MSR", VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_PERF_MSR);1503 HMVMX_REPORT_FEAT(val, zap, "LOAD_ GUEST_PAT_MSR", VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_PAT_MSR);1504 HMVMX_REPORT_FEAT(val, zap, "LOAD_ GUEST_EFER_MSR", VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR);1524 HMVMX_REPORT_FEAT(val, zap, "LOAD_DEBUG", VMX_ENTRY_CTLS_LOAD_DEBUG); 1525 HMVMX_REPORT_FEAT(val, zap, "IA32E_MODE_GUEST", VMX_ENTRY_CTLS_IA32E_MODE_GUEST); 1526 HMVMX_REPORT_FEAT(val, zap, "ENTRY_TO_SMM", VMX_ENTRY_CTLS_ENTRY_TO_SMM); 1527 HMVMX_REPORT_FEAT(val, zap, "DEACTIVATE_DUAL_MON", VMX_ENTRY_CTLS_DEACTIVATE_DUAL_MON); 1528 HMVMX_REPORT_FEAT(val, zap, "LOAD_PERF_MSR", VMX_ENTRY_CTLS_LOAD_PERF_MSR); 1529 HMVMX_REPORT_FEAT(val, zap, "LOAD_PAT_MSR", VMX_ENTRY_CTLS_LOAD_PAT_MSR); 1530 HMVMX_REPORT_FEAT(val, zap, "LOAD_EFER_MSR", VMX_ENTRY_CTLS_LOAD_EFER_MSR); 1505 1531 } 1506 1532 … … 1516 1542 uint64_t const zap = pVmxMsr->n.disallowed0; 1517 1543 LogRel(("HM: MSR_IA32_VMX_EXIT_CTLS = %#RX64\n", pVmxMsr->u)); 1518 HMVMX_REPORT_FEAT(val, zap, "SAVE_DEBUG", VMX_ VMCS_CTRL_EXIT_SAVE_DEBUG);1519 HMVMX_REPORT_FEAT(val, zap, "HOST_ADDR_SPACE_SIZE", VMX_ VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE);1520 HMVMX_REPORT_FEAT(val, zap, "LOAD_PERF_MSR", VMX_ VMCS_CTRL_EXIT_LOAD_PERF_MSR);1521 HMVMX_REPORT_FEAT(val, zap, "ACK_EXT_INT", VMX_ VMCS_CTRL_EXIT_ACK_EXT_INT);1522 HMVMX_REPORT_FEAT(val, zap, "SAVE_ GUEST_PAT_MSR", VMX_VMCS_CTRL_EXIT_SAVE_GUEST_PAT_MSR);1523 HMVMX_REPORT_FEAT(val, zap, "LOAD_ HOST_PAT_MSR", VMX_VMCS_CTRL_EXIT_LOAD_HOST_PAT_MSR);1524 HMVMX_REPORT_FEAT(val, zap, "SAVE_ GUEST_EFER_MSR", VMX_VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR);1525 HMVMX_REPORT_FEAT(val, zap, "LOAD_ HOST_EFER_MSR", VMX_VMCS_CTRL_EXIT_LOAD_HOST_EFER_MSR);1526 HMVMX_REPORT_FEAT(val, zap, "SAVE_VMX_PREEMPT_TIMER", VMX_ VMCS_CTRL_EXIT_SAVE_VMX_PREEMPT_TIMER);1544 HMVMX_REPORT_FEAT(val, zap, "SAVE_DEBUG", VMX_EXIT_CTLS_SAVE_DEBUG); 1545 HMVMX_REPORT_FEAT(val, zap, "HOST_ADDR_SPACE_SIZE", VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE); 1546 HMVMX_REPORT_FEAT(val, zap, "LOAD_PERF_MSR", VMX_EXIT_CTLS_LOAD_PERF_MSR); 1547 HMVMX_REPORT_FEAT(val, zap, "ACK_EXT_INT", VMX_EXIT_CTLS_ACK_EXT_INT); 1548 HMVMX_REPORT_FEAT(val, zap, "SAVE_PAT_MSR", VMX_EXIT_CTLS_SAVE_PAT_MSR); 1549 HMVMX_REPORT_FEAT(val, zap, "LOAD_PAT_MSR", VMX_EXIT_CTLS_LOAD_PAT_MSR); 1550 HMVMX_REPORT_FEAT(val, zap, "SAVE_EFER_MSR", VMX_EXIT_CTLS_SAVE_EFER_MSR); 1551 HMVMX_REPORT_FEAT(val, zap, "LOAD_EFER_MSR", VMX_EXIT_CTLS_LOAD_EFER_MSR); 1552 HMVMX_REPORT_FEAT(val, zap, "SAVE_VMX_PREEMPT_TIMER", VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER); 1527 1553 } 1528 1554 … … 1563 1589 { 1564 1590 LogRel(("HM: MSR_IA32_VMX_MISC = %#RX64\n", fMisc)); 1565 if (MSR_IA32_VMX_MISC_PREEMPT_TSC_BIT(fMisc) == pVM->hm.s.vmx.cPreemptTimerShift) 1566 LogRel(("HM: PREEMPT_TSC_BIT = %#x\n", MSR_IA32_VMX_MISC_PREEMPT_TSC_BIT(fMisc))); 1591 uint8_t const cPreemptTimerShift = RT_BF_GET(fMisc, VMX_BF_MISC_PREEMPT_TIMER_TSC); 1592 if (cPreemptTimerShift == pVM->hm.s.vmx.cPreemptTimerShift) 1593 LogRel(("HM: PREEMPT_TIMER_TSC = %#x\n", cPreemptTimerShift)); 1567 1594 else 1568 LogRel(("HM: PREEMPT_TSC_BIT = %#x - erratum detected, using %#x instead\n", 1569 MSR_IA32_VMX_MISC_PREEMPT_TSC_BIT(fMisc), pVM->hm.s.vmx.cPreemptTimerShift)); 1570 LogRel(("HM: STORE_EFERLMA_VMEXIT = %RTbool\n", MSR_IA32_VMX_MISC_STORE_EFERLMA_VMEXIT(fMisc))); 1571 uint8_t const fActivityState = MSR_IA32_VMX_MISC_ACTIVITY_STATES(fMisc); 1572 LogRel(("HM: ACTIVITY_STATES = %#x\n", fActivityState)); 1573 HMVMX_REPORT_MSR_CAP(fActivityState, " HLT", VMX_VMCS_GUEST_ACTIVITY_HLT); 1574 HMVMX_REPORT_MSR_CAP(fActivityState, " SHUTDOWN", VMX_VMCS_GUEST_ACTIVITY_SHUTDOWN); 1575 HMVMX_REPORT_MSR_CAP(fActivityState, " SIPI_WAIT", VMX_VMCS_GUEST_ACTIVITY_SIPI_WAIT); 1576 LogRel(("HM: CR3_TARGET = %#x\n", MSR_IA32_VMX_MISC_CR3_TARGET(fMisc))); 1577 LogRel(("HM: MAX_MSR = %u\n", MSR_IA32_VMX_MISC_MAX_MSR(fMisc))); 1578 LogRel(("HM: RDMSR_SMBASE_MSR_SMM = %RTbool\n", MSR_IA32_VMX_MISC_RDMSR_SMBASE_MSR_SMM(fMisc))); 1579 LogRel(("HM: SMM_MONITOR_CTL_B2 = %RTbool\n", MSR_IA32_VMX_MISC_SMM_MONITOR_CTL_B2(fMisc))); 1580 LogRel(("HM: VMWRITE_VMEXIT_INFO = %RTbool\n", MSR_IA32_VMX_MISC_VMWRITE_VMEXIT_INFO(fMisc))); 1581 LogRel(("HM: MSEG_ID = %#x\n", MSR_IA32_VMX_MISC_MSEG_ID(fMisc))); 1595 { 1596 LogRel(("HM: PREEMPT_TIMER_TSC = %#x - erratum detected, using %#x instead\n", cPreemptTimerShift, 1597 pVM->hm.s.vmx.cPreemptTimerShift)); 1598 } 1599 LogRel(("HM: EXIT_STORE_EFER_LMA = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_EXIT_STORE_EFER_LMA))); 1600 LogRel(("HM: ACTIVITY_STATES = %#x%s\n", RT_BF_GET(fMisc, VMX_BF_MISC_ACTIVITY_STATES), 1601 hmR3VmxGetActivityStateAllDesc(fMisc))); 1602 LogRel(("HM: PT = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_PT))); 1603 LogRel(("HM: SMM_READ_SMBASE_MSR = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_SMM_READ_SMBASE_MSR))); 1604 LogRel(("HM: CR3_TARGET = %#x\n", RT_BF_GET(fMisc, VMX_BF_MISC_CR3_TARGET))); 1605 LogRel(("HM: MAX_MSR = %#x ( %u )\n", RT_BF_GET(fMisc, VMX_BF_MISC_MAX_MSRS), 1606 VMX_MISC_MAX_MSRS(fMisc))); 1607 LogRel(("HM: VMXOFF_BLOCK_SMI = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_VMXOFF_BLOCK_SMI))); 1608 LogRel(("HM: VMWRITE_ALL = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_VMWRITE_ALL))); 1609 LogRel(("HM: ENTRY_INJECT_SOFT_INT = %#x\n", RT_BF_GET(fMisc, VMX_BF_MISC_ENTRY_INJECT_SOFT_INT))); 1610 LogRel(("HM: MSEG_ID = %#x\n", RT_BF_GET(fMisc, VMX_BF_MISC_MSEG_ID))); 1582 1611 } 1583 1612 … … 1590 1619 static void hmR3VmxReportVmcsEnumMsr(uint64_t uVmcsEnum) 1591 1620 { 1592 uint64_t const val = uVmcsEnum; 1593 LogRel(("HM: MSR_IA32_VMX_VMCS_ENUM = %#RX64\n", val)); 1594 LogRel(("HM: HIGHEST_INDEX = %#x\n", MSR_IA32_VMX_VMCS_ENUM_HIGHEST_INDEX(val))); 1621 LogRel(("HM: MSR_IA32_VMX_VMCS_ENUM = %#RX64\n", uVmcsEnum)); 1622 LogRel(("HM: HIGHEST_IDX = %#x\n", RT_BF_GET(uVmcsEnum, VMX_BF_VMCS_ENUM_HIGHEST_IDX))); 1595 1623 } 1596 1624 … … 1601 1629 * @param uVmFunc The VMX VMFUNC MSR value. 1602 1630 */ 1603 static void hmR3VmxReportVm funcMsr(uint64_t uVmFunc)1631 static void hmR3VmxReportVmFuncMsr(uint64_t uVmFunc) 1604 1632 { 1605 1633 LogRel(("HM: MSR_IA32_VMX_VMFUNC = %#RX64\n", uVmFunc)); 1606 HMVMX_REPORT_ALLOWED_FEAT(uVmFunc, "EPTP_SWITCHING", VMX_VMCS_CTRL_VMFUNC_EPTP_SWITCHING);1634 HMVMX_REPORT_ALLOWED_FEAT(uVmFunc, "EPTP_SWITCHING", RT_BF_GET(uVmFunc, VMX_BF_VMFUNC_EPTP_SWITCHING)); 1607 1635 } 1608 1636 … … 1646 1674 hmR3VmxReportPinBasedCtlsMsr(&pVM->hm.s.vmx.Msrs.PinCtls); 1647 1675 hmR3VmxReportProcBasedCtlsMsr(&pVM->hm.s.vmx.Msrs.ProcCtls); 1648 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)1676 if (pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 1649 1677 hmR3VmxReportProcBasedCtls2Msr(&pVM->hm.s.vmx.Msrs.ProcCtls2); 1650 1678 … … 1652 1680 hmR3VmxReportExitCtlsMsr(&pVM->hm.s.vmx.Msrs.ExitCtls); 1653 1681 1654 if (MSR_IA32_VMX_BASIC_TRUE_CONTROLS(pVM->hm.s.vmx.Msrs.u64Basic)) 1655 { 1656 /* We don't do extensive dumping of the true capability MSRs as we don't use them yet. */ 1657 /** @todo Consider using true capability MSRs and dumping them extensively. */ 1682 if (RT_BF_GET(pVM->hm.s.vmx.Msrs.u64Basic, VMX_BF_BASIC_TRUE_CTLS)) 1683 { 1684 /* We don't extensively dump the true capability MSRs as we don't use them, see @bugref{9180#c5}. */ 1658 1685 LogRel(("HM: MSR_IA32_VMX_TRUE_PINBASED_CTLS = %#RX64\n", pVM->hm.s.vmx.Msrs.TruePinCtls)); 1659 1686 LogRel(("HM: MSR_IA32_VMX_TRUE_PROCBASED_CTLS = %#RX64\n", pVM->hm.s.vmx.Msrs.TrueProcCtls)); … … 1666 1693 if (pVM->hm.s.vmx.Msrs.u64EptVpidCaps) 1667 1694 hmR3VmxReportEptVpidCapsMsr(pVM->hm.s.vmx.Msrs.u64EptVpidCaps); 1668 if (pVM->hm.s.vmx.Msrs.u64Vm func)1669 hmR3VmxReportVm funcMsr(pVM->hm.s.vmx.Msrs.u64Vmfunc);1695 if (pVM->hm.s.vmx.Msrs.u64VmFunc) 1696 hmR3VmxReportVmFuncMsr(pVM->hm.s.vmx.Msrs.u64VmFunc); 1670 1697 hmR3VmxReportCrFixedMsrs(&pVM->hm.s.vmx.Msrs); 1671 1698 … … 1681 1708 */ 1682 1709 AssertLogRelReturn( !pVM->hm.s.fNestedPaging 1683 || (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_EPT),1710 || (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_EPT), 1684 1711 VERR_HM_IPE_1); 1685 1712 AssertLogRelReturn( !pVM->hm.s.vmx.fUnrestrictedGuest 1686 || ( (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_UNRESTRICTED_GUEST)1713 || ( (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_UNRESTRICTED_GUEST) 1687 1714 && pVM->hm.s.fNestedPaging), 1688 1715 VERR_HM_IPE_1); … … 1691 1718 * Enable VPID if configured and supported. 1692 1719 */ 1693 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_VPID)1720 if (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VPID) 1694 1721 pVM->hm.s.vmx.fVpid = pVM->hm.s.vmx.fAllowVpid; 1695 1722 … … 1698 1725 * Enable APIC register virtualization and virtual-interrupt delivery if supported. 1699 1726 */ 1700 if ( (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_APIC_REG_VIRT)1701 && (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_INTR_DELIVERY))1727 if ( (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_APIC_REG_VIRT) 1728 && (pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VIRT_INTR_DELIVERY)) 1702 1729 pVM->hm.s.fVirtApicRegs = true; 1703 1730 … … 1707 1734 /** @todo Add and query IPRT API for host OS support for posted-interrupt IPI 1708 1735 * here. */ 1709 if ( (pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1 & VMX_ VMCS_CTRL_PIN_EXEC_POSTED_INTR)1710 && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_ VMCS_CTRL_EXIT_ACK_EXT_INT))1736 if ( (pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1 & VMX_PIN_CTLS_POSTED_INT) 1737 && (pVM->hm.s.vmx.Msrs.ExitCtls.n.allowed1 & VMX_EXIT_CTLS_ACK_EXT_INT)) 1711 1738 pVM->hm.s.fPostedIntrs = true; 1712 1739 #endif … … 1717 1744 * in Nehalems and secondary VM exec. controls should be supported in all of them, but nonetheless it's Intel... 1718 1745 */ 1719 if ( !(pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)1746 if ( !(pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 1720 1747 && CPUMR3GetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_RDTSCP)) 1721 1748 { … … 3413 3440 { 3414 3441 uint32_t const u32Val = pVCpu->hm.s.vmx.u32PinCtls; 3415 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PIN_EXEC_EXT_INT_EXIT );3416 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PIN_EXEC_NMI_EXIT );3417 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PIN_EXEC_VIRTUAL_NMI);3418 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PIN_EXEC_PREEMPT_TIMER);3419 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PIN_EXEC_POSTED_INTR);3442 HMVMX_LOGREL_FEAT(u32Val, VMX_PIN_CTLS_EXT_INT_EXIT ); 3443 HMVMX_LOGREL_FEAT(u32Val, VMX_PIN_CTLS_NMI_EXIT ); 3444 HMVMX_LOGREL_FEAT(u32Val, VMX_PIN_CTLS_VIRT_NMI ); 3445 HMVMX_LOGREL_FEAT(u32Val, VMX_PIN_CTLS_PREEMPT_TIMER); 3446 HMVMX_LOGREL_FEAT(u32Val, VMX_PIN_CTLS_POSTED_INT ); 3420 3447 } 3421 3448 LogRel(("HM: CPU[%u] ProcCtls %#RX32\n", i, pVCpu->hm.s.vmx.u32ProcCtls)); 3422 3449 { 3423 3450 uint32_t const u32Val = pVCpu->hm.s.vmx.u32ProcCtls; 3424 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_INT_WINDOW_EXIT );3425 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_USE_TSC_OFFSETTING);3426 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_HLT_EXIT );3427 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_INVLPG_EXIT );3428 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_MWAIT_EXIT );3429 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_RDPMC_EXIT );3430 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_RDTSC_EXIT );3431 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT );3432 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT );3433 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT );3434 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT );3435 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW );3436 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_NMI_WINDOW_EXIT );3437 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT );3438 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_UNCOND_IO_EXIT );3439 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_USE_IO_BITMAPS );3440 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG );3441 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_USE_MSR_BITMAPS );3442 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_MONITOR_EXIT );3443 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_PAUSE_EXIT );3444 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL);3451 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_INT_WINDOW_EXIT ); 3452 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_USE_TSC_OFFSETTING); 3453 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_HLT_EXIT ); 3454 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_INVLPG_EXIT ); 3455 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_MWAIT_EXIT ); 3456 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_RDPMC_EXIT ); 3457 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_RDTSC_EXIT ); 3458 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_CR3_LOAD_EXIT ); 3459 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_CR3_STORE_EXIT ); 3460 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_CR8_LOAD_EXIT ); 3461 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_CR8_STORE_EXIT ); 3462 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_USE_TPR_SHADOW ); 3463 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_NMI_WINDOW_EXIT ); 3464 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_MOV_DR_EXIT ); 3465 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_UNCOND_IO_EXIT ); 3466 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_USE_IO_BITMAPS ); 3467 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_MONITOR_TRAP_FLAG ); 3468 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_USE_MSR_BITMAPS ); 3469 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_MONITOR_EXIT ); 3470 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_PAUSE_EXIT ); 3471 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS_USE_SECONDARY_CTLS); 3445 3472 } 3446 3473 LogRel(("HM: CPU[%u] ProcCtls2 %#RX32\n", i, pVCpu->hm.s.vmx.u32ProcCtls2)); 3447 3474 { 3448 3475 uint32_t const u32Val = pVCpu->hm.s.vmx.u32ProcCtls2; 3449 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_APIC);3450 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_EPT);3451 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_DESCRIPTOR_TABLE_EXIT);3452 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_RDTSCP);3453 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_X2APIC);3454 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_VPID);3455 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_WBINVD_EXIT);3456 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_UNRESTRICTED_GUEST);3457 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_APIC_REG_VIRT);3458 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_VIRT_INTR_DELIVERY);3459 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_PAUSE_LOOP_EXIT);3460 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_RDRAND_EXIT);3461 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_INVPCID);3462 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_VMFUNC);3463 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_VMCS_SHADOWING);3464 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_ENCLS_EXIT);3465 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_RDSEED_EXIT);3466 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_PML);3467 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_EPT_VE);3468 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_CONCEAL_FROM_PT);3469 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_XSAVES_XRSTORS);3470 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_PROC_EXEC2_TSC_SCALING);3476 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_VIRT_APIC_ACCESS ); 3477 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_EPT ); 3478 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_DESC_TABLE_EXIT ); 3479 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_RDTSCP ); 3480 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_VIRT_X2APIC_ACCESS); 3481 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_VPID ); 3482 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_WBINVD_EXIT ); 3483 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_UNRESTRICTED_GUEST); 3484 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_APIC_REG_VIRT ); 3485 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_VIRT_INT_DELIVERY ); 3486 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_PAUSE_LOOP_EXIT ); 3487 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_RDRAND_EXIT ); 3488 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_INVPCID ); 3489 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_VMFUNC ); 3490 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_VMCS_SHADOWING ); 3491 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_ENCLS_EXIT ); 3492 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_RDSEED_EXIT ); 3493 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_PML ); 3494 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_EPT_VE ); 3495 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_CONCEAL_FROM_PT ); 3496 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_XSAVES_XRSTORS ); 3497 HMVMX_LOGREL_FEAT(u32Val, VMX_PROC_CTLS2_TSC_SCALING ); 3471 3498 } 3472 3499 LogRel(("HM: CPU[%u] EntryCtls %#RX32\n", i, pVCpu->hm.s.vmx.u32EntryCtls)); 3473 3500 { 3474 3501 uint32_t const u32Val = pVCpu->hm.s.vmx.u32EntryCtls; 3475 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_ENTRY_LOAD_DEBUG );3476 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_ENTRY_IA32E_MODE_GUEST );3477 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_ENTRY_ENTRY_SMM);3478 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_ENTRY_DEACTIVATE_DUALMON);3479 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_PERF_MSR);3480 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_PAT_MSR);3481 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR);3502 HMVMX_LOGREL_FEAT(u32Val, VMX_ENTRY_CTLS_LOAD_DEBUG ); 3503 HMVMX_LOGREL_FEAT(u32Val, VMX_ENTRY_CTLS_IA32E_MODE_GUEST ); 3504 HMVMX_LOGREL_FEAT(u32Val, VMX_ENTRY_CTLS_ENTRY_TO_SMM ); 3505 HMVMX_LOGREL_FEAT(u32Val, VMX_ENTRY_CTLS_DEACTIVATE_DUAL_MON); 3506 HMVMX_LOGREL_FEAT(u32Val, VMX_ENTRY_CTLS_LOAD_PERF_MSR ); 3507 HMVMX_LOGREL_FEAT(u32Val, VMX_ENTRY_CTLS_LOAD_PAT_MSR ); 3508 HMVMX_LOGREL_FEAT(u32Val, VMX_ENTRY_CTLS_LOAD_EFER_MSR ); 3482 3509 } 3483 3510 LogRel(("HM: CPU[%u] ExitCtls %#RX32\n", i, pVCpu->hm.s.vmx.u32ExitCtls)); 3484 3511 { 3485 3512 uint32_t const u32Val = pVCpu->hm.s.vmx.u32ExitCtls; 3486 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_EXIT_SAVE_DEBUG );3487 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE );3488 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_EXIT_LOAD_PERF_MSR );3489 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_EXIT_ACK_EXT_INT );3490 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_EXIT_SAVE_GUEST_PAT_MSR);3491 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_EXIT_LOAD_HOST_PAT_MSR);3492 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR);3493 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_EXIT_LOAD_HOST_EFER_MSR);3494 HMVMX_LOGREL_FEAT(u32Val, VMX_ VMCS_CTRL_EXIT_SAVE_VMX_PREEMPT_TIMER);3513 HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_SAVE_DEBUG ); 3514 HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE ); 3515 HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_LOAD_PERF_MSR ); 3516 HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_ACK_EXT_INT ); 3517 HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_SAVE_PAT_MSR ); 3518 HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_LOAD_PAT_MSR ); 3519 HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_SAVE_EFER_MSR ); 3520 HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_LOAD_EFER_MSR ); 3521 HMVMX_LOGREL_FEAT(u32Val, VMX_EXIT_CTLS_SAVE_VMX_PREEMPT_TIMER); 3495 3522 } 3496 3523 LogRel(("HM: CPU[%u] HCPhysMsrBitmap %#RHp\n", i, pVCpu->hm.s.vmx.HCPhysMsrBitmap)); -
trunk/src/VBox/VMM/include/CPUMInternal.h
r72178 r73389 441 441 #ifndef VBOX_FOR_DTRACE_LIB 442 442 AssertCompileMemberOffset(CPUM, HostFeatures, 64); 443 AssertCompileMemberOffset(CPUM, GuestFeatures, 96);443 AssertCompileMemberOffset(CPUM, GuestFeatures, 104); 444 444 #endif 445 445 /** Pointer to the CPUM instance data residing in the shared VM structure. */ -
trunk/src/VBox/VMM/include/CPUMInternal.mac
r72643 r73389 97 97 98 98 alignb 64 99 .HostFeatures resb 32100 .GuestFeatures resb 3299 .HostFeatures resb 40 100 .GuestFeatures resb 40 101 101 .GuestInfo resb RTHCPTR_CB*4 + RTRCPTR_CB*2 + 4*12 102 102 -
trunk/src/VBox/VMM/include/HMInternal.h
r73293 r73389 726 726 uint32_t u32Alignment0; 727 727 #endif 728 /** Current VMX_VMCS32_CTRL_PIN_EXEC. */728 /** Current pin-based VM-execution controls. */ 729 729 uint32_t u32PinCtls; 730 /** Current VMX_VMCS32_CTRL_PROC_EXEC. */730 /** Current processor-based VM-execution controls. */ 731 731 uint32_t u32ProcCtls; 732 /** Current VMX_VMCS32_CTRL_PROC_EXEC2. */732 /** Current secondary processor-based VM-execution controls. */ 733 733 uint32_t u32ProcCtls2; 734 /** Current VMX_VMCS32_CTRL_EXIT. */ 734 /** Current VM-entry controls. */ 735 uint32_t u32EntryCtls; 736 /** Current VM-exit controls. */ 735 737 uint32_t u32ExitCtls; 736 /** Current VMX_VMCS32_CTRL_ENTRY. */737 uint32_t u32EntryCtls;738 738 739 739 /** Current CR0 mask. */ … … 823 823 X86DESCATTR AttrSS; 824 824 X86EFLAGS Eflags; 825 uint32_tfRealOnV86Active;825 bool fRealOnV86Active; 826 826 } RealMode; 827 827
Note:
See TracChangeset
for help on using the changeset viewer.