VirtualBox

Changeset 73389 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 28, 2018 7:03:03 AM (6 years ago)
Author:
vboxsync
Message:

VMM, SUPDrv: Nested VMX: bugref:9180 Implement some of the VMX MSRs.

Location:
trunk/src/VBox
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp

    r73293 r73389  
    43314331
    43324332                    vtCaps.u = ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS);
    4333                     if (vtCaps.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)
     4333                    if (vtCaps.n.allowed1 & VMX_PROC_CTLS_USE_SECONDARY_CTLS)
    43344334                    {
    43354335                        vtCaps.u = ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS2);
    4336                         if (vtCaps.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_EPT)
     4336                        if (vtCaps.n.allowed1 & VMX_PROC_CTLS2_EPT)
    43374337                            *pfCaps |= SUPVTCAPS_NESTED_PAGING;
    4338                         if (vtCaps.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_UNRESTRICTED_GUEST)
     4338                        if (vtCaps.n.allowed1 & VMX_PROC_CTLS2_UNRESTRICTED_GUEST)
    43394339                            *pfCaps |= SUPVTCAPS_VTX_UNRESTRICTED_GUEST;
    43404340                    }
  • trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp

    r73290 r73389  
    12921292{
    12931293    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)
    12951296    {
    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                             );
    13081302    }
    13091303    else
     
    13161310static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxPinbasedCtls(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
    13171311{
    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;
    13201328    return VINF_SUCCESS;
    13211329}
     
    13251333static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxProcbasedCtls(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
    13261334{
    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;
    13291368    return VINF_SUCCESS;
    13301369}
     
    13341373static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxExitCtls(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
    13351374{
    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;
    13381393    return VINF_SUCCESS;
    13391394}
     
    13431398static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxEntryCtls(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
    13441399{
    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;
    13471416    return VINF_SUCCESS;
    13481417}
     
    13521421static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxMisc(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
    13531422{
    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;
    13561432    return VINF_SUCCESS;
    13571433}
     
    14061482static DECLCALLBACK(VBOXSTRICTRC) cpumMsrRd_Ia32VmxProcBasedCtls2(PVMCPU pVCpu, uint32_t idMsr, PCCPUMMSRRANGE pRange, uint64_t *puValue)
    14071483{
    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;
    14101504    return VINF_SUCCESS;
    14111505}
  • trunk/src/VBox/VMM/VMMAll/HMAll.cpp

    r73293 r73389  
    349349
    350350/**
    351  * Checks if MSR bitmaps are available. It is assumed that when it's available
     351 * Checks if MSR bitmaps are active. It is assumed that when it's available
    352352 * it will be used as well.
    353353 *
     
    355355 * @param   pVM         The cross context VM structure.
    356356 */
    357 VMM_INT_DECL(bool) HMAreMsrBitmapsAvailable(PVM pVM)
     357VMM_INT_DECL(bool) HMIsMsrBitmapActive(PVM pVM)
    358358{
    359359    if (HMIsEnabled(pVM))
     
    363363
    364364        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))
    367366            return true;
    368         }
    369367    }
    370368    return false;
     
    389387 * Checks if VT-x is active.
    390388 *
    391  * @returns true if AMD-V is active.
     389 * @returns true if VT-x is active.
    392390 * @param   pVM         The cross context VM structure.
    393391 *
     
    396394VMM_INT_DECL(bool) HMIsVmxActive(PVM pVM)
    397395{
    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 */
     408VMM_INT_DECL(bool) HMIsVmxSupported(PVM pVM)
     409{
     410    return pVM->hm.s.vmx.fSupported;
    399411}
    400412
     
    544556
    545557
     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 */
     570VMM_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 */
     597VMM_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
    546638#ifndef IN_RC
    547639/**
  • trunk/src/VBox/VMM/VMMR0/HMR0.cpp

    r73293 r73389  
    122122        uint64_t                    u64HostSmmMonitorCtl;
    123123
    124         /** VMX MSR values */
     124        /** VMX MSR values. */
    125125        VMXMSRS                     Msrs;
    126126
     
    298298 *      - AAN92  - B1.
    299299 *      - AAJ124 - C0, D0.
    300  *
    301300 *      - AAP86  - B1.
    302301 *
     
    387386             * depends on bit 49 of MSR_IA32_VMX_BASIC while table 35-2 says that this MSR is
    388387             * 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))
    390389                g_HmR0.vmx.u64HostSmmMonitorCtl = ASMRdMsr(MSR_IA32_SMM_MONITOR_CTL);
    391390            g_HmR0.vmx.Msrs.PinCtls.u       = ASMRdMsr(MSR_IA32_VMX_PINBASED_CTLS);
     
    399398            g_HmR0.vmx.Msrs.u64Cr4Fixed1    = ASMRdMsr(MSR_IA32_VMX_CR4_FIXED1);
    400399            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))
    402401            {
    403402                g_HmR0.vmx.Msrs.TruePinCtls.u   = ASMRdMsr(MSR_IA32_VMX_TRUE_PINBASED_CTLS);
     
    410409            g_HmR0.uMaxAsid = 0x10000; /* exclusive */
    411410
    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)
    413412            {
    414413                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))
    416415                    g_HmR0.vmx.Msrs.u64EptVpidCaps = ASMRdMsr(MSR_IA32_VMX_EPT_VPID_CAP);
    417416
    418                 if (g_HmR0.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_VMFUNC)
    419                     g_HmR0.vmx.Msrs.u64Vmfunc = 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);
    420419            }
    421420
     
    438437
    439438                /* 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);
    441440
    442441                /* Make sure we don't get rescheduled to another cpu during this probe. */
     
    515514                 * Timer Does Not Count Down at the Rate Specified" erratum.
    516515                 */
    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)
    518517                {
    519518                    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);
    521520                    if (hmR0InitIntelIsSubjectToVmxPreemptionTimerErratum())
    522521                        g_HmR0.vmx.cPreemptTimerShift = 0; /* This is about right most of the time here. */
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r73348 r73389  
    790790    {
    791791        /* 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);
    793793    }
    794794
     
    916916        hmR0VmxPageFree(&pVCpu->hm.s.vmx.hMemObjGuestMsr, &pVCpu->hm.s.vmx.pvGuestMsr, &pVCpu->hm.s.vmx.HCPhysGuestMsr);
    917917
    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)
    919919            hmR0VmxPageFree(&pVCpu->hm.s.vmx.hMemObjMsrBitmap, &pVCpu->hm.s.vmx.pvMsrBitmap, &pVCpu->hm.s.vmx.HCPhysMsrBitmap);
    920920
     
    968968
    969969    /* 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,
    971971                     (&pVM->aCpus[0])->hm.s.u32HMError = VMX_UFC_INVALID_VMCS_SIZE,
    972972                     VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO);
     
    985985
    986986    /* 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)
    988988    {
    989989        rc = hmR0VmxPageAllocZ(&pVM->hm.s.vmx.hMemObjApicAccess, (PRTR0PTR)&pVM->hm.s.vmx.pbApicAccess,
     
    10081008        /* Get the allocated virtual-APIC page from the APIC device for transparent TPR accesses. */
    10091009        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))
    10111011        {
    10121012            rc = APICGetApicPageForCpu(pVCpu, &pVCpu->hm.s.vmx.HCPhysVirtApic, (PRTR0PTR)&pVCpu->hm.s.vmx.pbVirtApic,
     
    10231023         * update HMAreMsrBitmapsAvailable().
    10241024         */
    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)
    10261026        {
    10271027            rc = hmR0VmxPageAllocZ(&pVCpu->hm.s.vmx.hMemObjMsrBitmap, &pVCpu->hm.s.vmx.pvMsrBitmap,
     
    12511251{
    12521252    /* 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);
    12541255    if (RT_UNLIKELY(cMsrs > cMaxSupportedMsrs))
    12551256    {
     
    13091310
    13101311        /* 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)
    13121313            hmR0VmxSetMsrPermission(pVCpu, uMsr, VMXMSREXIT_PASSTHRU_READ, VMXMSREXIT_PASSTHRU_WRITE);
    13131314
     
    13931394
    13941395        /* 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)
    13961397            hmR0VmxSetMsrPermission(pVCpu, uMsr, VMXMSREXIT_INTERCEPT_READ, VMXMSREXIT_INTERCEPT_WRITE);
    13971398
     
    16521653                        VERR_VMX_VMCS_FIELD_CACHE_INVALID);
    16531654
    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)
    16551656    {
    16561657        rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC2, &u32Val);
     
    16921693    Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
    16931694
    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)
    16951696    {
    16961697        uint64_t u64Val;
     
    17381739
    17391740        /* 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)
    17411742        {
    17421743            VMXMSREXITREAD  enmRead;
     
    22952296    uint32_t const fZap = pVM->hm.s.vmx.Msrs.PinCtls.n.allowed1;      /* Bits cleared here must always be cleared. */
    22962297
    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. */
    23022303
    23032304    /* Enable the VMX preemption timer. */
    23042305    if (pVM->hm.s.vmx.fUsePreemptTimer)
    23052306    {
    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;
    23082309    }
    23092310
     
    23122313    if (pVM->hm.s.fPostedIntrs)
    23132314    {
    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;
    23172318    }
    23182319#endif
     
    23512352
    23522353    /* 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;
    23552356
    23562357    /* Enable EPT (aka nested-paging). */
    23572358    if (pVM->hm.s.fNestedPaging)
    2358         fVal |= VMX_VMCS_CTRL_PROC_EXEC2_EPT;
     2359        fVal |= VMX_PROC_CTLS2_EPT;
    23592360
    23602361    /*
     
    23622363     * it to the guest. Without this, guest executing INVPCID would cause a #UD.
    23632364     */
    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)
    23652366        && pVM->cpum.ro.GuestFeatures.fInvpcid)
    2366         fVal |= VMX_VMCS_CTRL_PROC_EXEC2_INVPCID;
     2367        fVal |= VMX_PROC_CTLS2_INVPCID;
    23672368
    23682369    /* Enable VPID. */
    23692370    if (pVM->hm.s.vmx.fVpid)
    2370         fVal |= VMX_VMCS_CTRL_PROC_EXEC2_VPID;
     2371        fVal |= VMX_PROC_CTLS2_VPID;
    23712372
    23722373    /* Enable Unrestricted guest execution. */
    23732374    if (pVM->hm.s.vmx.fUnrestrictedGuest)
    2374         fVal |= VMX_VMCS_CTRL_PROC_EXEC2_UNRESTRICTED_GUEST;
     2375        fVal |= VMX_PROC_CTLS2_UNRESTRICTED_GUEST;
    23752376
    23762377#if 0
     
    23782379    {
    23792380        /* 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;
    23822383
    23832384        /* 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;
    23862387    }
    23872388#endif
    23882389
    2389     /* Enable Virtual-APIC page accesses if supported by the CPU. This is where the TPR shadow resides. */
     2390    /* Virtualize-APIC accesses if supported by the CPU. The virtual-APIC page is where the TPR shadow resides. */
    23902391    /** @todo VIRT_X2APIC support, it's mutually exclusive with this. So must be
    23912392     *        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)
    23932394    {
    23942395        Assert(pVM->hm.s.vmx.HCPhysApicAccess);
    23952396        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. */
    23972398        int rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_APIC_ACCESSADDR_FULL, pVM->hm.s.vmx.HCPhysApicAccess);
    23982399        AssertRCReturn(rc, rc);
     
    24002401
    24012402    /* 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;
    24042405
    24052406    /* Enable Pause-Loop exiting. */
    2406     if (   pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC2_PAUSE_LOOP_EXIT
     2407    if (   pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_PAUSE_LOOP_EXIT
    24072408        && pVM->hm.s.vmx.cPleGapTicks
    24082409        && pVM->hm.s.vmx.cPleWindowTicks)
    24092410    {
    2410         fVal |= VMX_VMCS_CTRL_PROC_EXEC2_PAUSE_LOOP_EXIT;
     2411        fVal |= VMX_PROC_CTLS2_PAUSE_LOOP_EXIT;
    24112412
    24122413        int rc  = VMXWriteVmcs32(VMX_VMCS32_CTRL_PLE_GAP, pVM->hm.s.vmx.cPleGapTicks);
     
    24472448    uint32_t const fZap = pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1;     /* Bits cleared here must be cleared in the VMCS. */
    24482449
    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!"));
    24622463        pVCpu->hm.s.u32HMError = VMX_UFC_CTRL_PROC_MOV_DRX_EXIT;
    24632464        return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO;
     
    24682469    {
    24692470        Assert(!pVM->hm.s.vmx.fUnrestrictedGuest);                /* Paranoia. */
    2470         fVal |= VMX_VMCS_CTRL_PROC_EXEC_INVLPG_EXIT
    2471               | VMX_VMCS_CTRL_PROC_EXEC_CR3_LOAD_EXIT
    2472               | 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;
    24732474    }
    24742475
    24752476    /* Use TPR shadowing if supported by the CPU. */
    24762477    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)
    24782479    {
    24792480        Assert(pVCpu->hm.s.vmx.HCPhysVirtApic);
    24802481        Assert(!(pVCpu->hm.s.vmx.HCPhysVirtApic & 0xfff));        /* Bits 11:0 MBZ. */
    24812482        int rc  = VMXWriteVmcs32(VMX_VMCS32_CTRL_TPR_THRESHOLD, 0);
    2482         rc     |= VMXWriteVmcs64(VMX_VMCS64_CTRL_VAPIC_PAGEADDR_FULL, pVCpu->hm.s.vmx.HCPhysVirtApic);
     2483        rc     |= VMXWriteVmcs64(VMX_VMCS64_CTRL_VIRT_APIC_PAGEADDR_FULL, pVCpu->hm.s.vmx.HCPhysVirtApic);
    24832484        AssertRCReturn(rc, rc);
    24842485
    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. */
    24862487                                                                  /* 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));
    24892490    }
    24902491    else
     
    24962497        if (pVM->hm.s.fAllow64BitGuests)
    24972498        {
    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. */
    25002501        }
    25012502    }
    25022503
    25032504    /* 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;
    25072508
    25082509        Assert(pVCpu->hm.s.vmx.HCPhysMsrBitmap);
     
    25432544
    25442545    /* 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;
    25472548
    25482549    if ((fVal & fZap) != fVal)
     
    25602561
    25612562    /* 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)
    25632564        return hmR0VmxSetupProcCtls2(pVCpu);
    25642565
     
    27622763    Assert(!pVM->hm.s.vmx.fSupportsVmcsEfer);
    27632764#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))
    27672768    {
    27682769        pVM->hm.s.vmx.fSupportsVmcsEfer = true;
     
    27852786
    27862787        /* 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);
    27882789
    27892790        /* Initialize our VMCS region in memory, set the VMCS launch state to "clear". */
     
    29602961    /* Assertion is right but we would not have updated u32ExitCtls yet. */
    29612962#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))
    29632964        Assert(uSelSS != 0);
    29642965#endif
     
    32333234
    32343235        /* 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;
    32363237
    32373238        /* Set if the guest is in long mode. This will set/clear the EFER.LMA bit on VM-entry. */
    32383239        if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.GstCtx))
    32393240        {
    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"));
    32423243        }
    32433244        else
    3244             Assert(!(fVal & VMX_VMCS_CTRL_ENTRY_IA32E_MODE_GUEST));
     3245            Assert(!(fVal & VMX_ENTRY_CTLS_IA32E_MODE_GUEST));
    32453246
    32463247        /* If the CPU supports the newer VMCS controls for managing guest/host EFER, use it. */
     
    32483249            && hmR0VmxShouldSwapEferMsr(pVCpu))
    32493250        {
    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"));
    32523253        }
    32533254
    32543255        /*
    32553256         * The following should -not- be set (since we're not in SMM mode):
    3256          * - VMX_VMCS_CTRL_ENTRY_ENTRY_SMM
    3257          * - VMX_VMCS_CTRL_ENTRY_DEACTIVATE_DUALMON
     3257         * - VMX_ENTRY_CTLS_ENTRY_TO_SMM
     3258         * - VMX_ENTRY_CTLS_DEACTIVATE_DUAL_MON
    32583259         */
    32593260
    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. */
    32623263
    32633264        if ((fVal & fZap) != fVal)
     
    33003301
    33013302        /* 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;
    33033304
    33043305        /*
     
    33083309         */
    33093310#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"));
    33123313#else
    33133314        Assert(   pVCpu->hm.s.vmx.pfnStartVM == VMXR0SwitcherStartVM64
     
    33173318        {
    33183319            /* 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"));
    33213322        }
    33223323        else
    3323             Assert(!(fVal & VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE));
     3324            Assert(!(fVal & VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE));
    33243325#endif
    33253326
     
    33283329            && hmR0VmxShouldSwapEferMsr(pVCpu))
    33293330        {
    3330             fVal |= VMX_VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR
    3331                   | 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"));
    33333334        }
    33343335
    33353336        /* 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. */
    33413342
    33423343        /* Enable saving of the VMX preemption timer value on VM-exit. */
    33433344        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;
    33463347
    33473348        if ((fVal & fZap) != fVal)
     
    33773378{
    33783379    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);
    33803381    return VMXWriteVmcs32(VMX_VMCS32_CTRL_TPR_THRESHOLD, u32TprThreshold);
    33813382}
     
    34023403             * Setup TPR shadowing.
    34033404             */
    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)
    34053406            {
    34063407                Assert(pVCpu->hm.s.vmx.HCPhysVirtApic);
     
    34893490     */
    34903491    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))
    34923493    {
    34933494        fIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_NMI;
     
    36793680            {
    36803681                /* 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_EXIT
    3682                                | VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT);
     3682                uProcCtls &= ~(  VMX_PROC_CTLS_CR3_LOAD_EXIT
     3683                               | VMX_PROC_CTLS_CR3_STORE_EXIT);
    36833684            }
    36843685            else
    36853686            {
    36863687                /* 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_EXIT
    3688                            | VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT;
     3688                uProcCtls |= VMX_PROC_CTLS_CR3_LOAD_EXIT
     3689                           | VMX_PROC_CTLS_CR3_STORE_EXIT;
    36893690            }
    36903691
    36913692            /* If we have unrestricted guest execution, we never have to intercept CR3 reads. */
    36923693            if (pVM->hm.s.vmx.fUnrestrictedGuest)
    3693                 uProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_CR3_STORE_EXIT;
     3694                uProcCtls &= ~VMX_PROC_CTLS_CR3_STORE_EXIT;
    36943695        }
    36953696        else
     
    40644065#ifdef VBOX_STRICT
    40654066    /* 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)
    40674068    {
    40684069        /* Validate. Intel spec. 17.2 "Debug Registers", recompiler paranoia checks. */
     
    40794080        /* If the CPU supports the monitor trap flag, use it for single stepping in DBGF and avoid intercepting #DB. */
    40804081        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;
    40844085            Assert(fSteppingDB == false);
    40854086        }
     
    41764177
    41774178    if (fInterceptMovDRx)
    4178         uProcCtls |= VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT;
     4179        uProcCtls |= VMX_PROC_CTLS_MOV_DR_EXIT;
    41794180    else
    4180         uProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT;
     4181        uProcCtls &= ~VMX_PROC_CTLS_MOV_DR_EXIT;
    41814182
    41824183    /*
     
    47904791
    47914792                /* 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)
    47934794                    hmR0VmxSetMsrPermission(pVCpu, MSR_K6_EFER, VMXMSREXIT_INTERCEPT_READ, VMXMSREXIT_INTERCEPT_WRITE);
    47944795                Log4Func(("MSR[--]: u32Msr=%#RX32 u64Value=%#RX64 cMsrs=%u\n", MSR_K6_EFER, pCtx->msrEFER,
     
    50255026                rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, &u32Val);                 AssertRC(rc);
    50265027                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)
    50285029                {
    50295030                    rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC2, &u32Val);            AssertRC(rc);
     
    55085509        case VMX_VMCS64_CTRL_EXEC_VMCS_PTR_FULL:
    55095510        case VMX_VMCS64_CTRL_TSC_OFFSET_FULL:
    5510         case VMX_VMCS64_CTRL_VAPIC_PAGEADDR_FULL:
     5511        case VMX_VMCS64_CTRL_VIRT_APIC_PAGEADDR_FULL:
    55115512        case VMX_VMCS64_CTRL_APIC_ACCESSADDR_FULL:
    55125513        case VMX_VMCS64_CTRL_VMFUNC_CTRLS_FULL:
     
    56705671        }
    56715672
    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;
    56755676            int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, uProcCtls);
    56765677            AssertRC(rc);
     
    56825683    {
    56835684        /* 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;
    56875688            int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, uProcCtls);
    56885689            AssertRC(rc);
     
    58875888            && (   enmRaise   == IEMXCPTRAISE_PREV_EVENT
    58885889                || (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))
    58905891        {
    58915892            VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS);
     
    59785979             && VMX_EXIT_INT_INFO_IS_NMI_UNBLOCK_IRET(pVmxTransient->uExitIntInfo)
    59795980             && 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))
    59815982    {
    59825983        /*
     
    68066807#ifdef VBOX_STRICT
    68076808    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);
    68096810#endif
    68106811    CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(pVCpu, true /* save DR6 */);
     
    70997100DECLINLINE(void) hmR0VmxSetIntWindowExitVmcs(PVMCPU pVCpu)
    71007101{
    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;
    71067107            int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls);
    71077108            AssertRC(rc);
     
    71197120DECLINLINE(void) hmR0VmxClearIntWindowExitVmcs(PVMCPU pVCpu)
    71207121{
    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;
    71237124    int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls);
    71247125    AssertRC(rc);
     
    71357136DECLINLINE(void) hmR0VmxSetNmiWindowExitVmcs(PVMCPU pVCpu)
    71367137{
    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;
    71427143            int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls);
    71437144            AssertRC(rc);
     
    71557156DECLINLINE(void) hmR0VmxClearNmiWindowExitVmcs(PVMCPU pVCpu)
    71567157{
    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;
    71597160    int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls);
    71607161    AssertRC(rc);
     
    72397240            else if (rc == VERR_APIC_INTR_MASKED_BY_TPR)
    72407241            {
    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)
    72427243                    hmR0VmxApicSetTprThreshold(pVCpu, u8Interrupt >> 4);
    72437244                STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchTprMaskedIrq);
     
    73707371             * BS bit would mean delivering a #DB to the guest upon VM-entry when it shouldn't be.
    73717372             */
    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));
    73737374            fIntrState = 0;
    73747375        }
     
    77527753static void hmR0VmxClearIntNmiWindowsVmcs(PVMCPU pVCpu)
    77537754{
    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)
    77557756    {
    77567757        hmR0VmxClearIntWindowExitVmcs(pVCpu);
     
    77587759    }
    77597760
    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)
    77617762    {
    77627763        hmR0VmxClearNmiWindowExitVmcs(pVCpu);
     
    82128213    PVM pVM = pVCpu->CTX_SUFF(pVM);
    82138214    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)
    82158216        && PDMHasApic(pVM))
    82168217    {
     
    84298430     * Cache the TPR-shadow for checking on every VM-exit if it might have changed.
    84308431     */
    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)
    84328433        pVmxTransient->u8GuestTpr = pVCpu->hm.s.vmx.pbVirtApic[XAPIC_OFF_TPR];
    84338434
     
    84548455     * Load the TSC_AUX MSR when we are not intercepting RDTSCP.
    84558456     */
    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))
    84598460        {
    84608461            bool fMsrUpdated;
     
    84928493#endif
    84938494#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))
    84958496    {
    84968497        uint32_t uInvalidReason = hmR0VmxCheckGuestState(pVCpu);
     
    85278528    pVmxTransient->fVectoringDoublePF  = false;                 /* Vectoring double page-fault needs to be determined later. */
    85288529
    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))
    85308531        TMCpuTickSetLastSeen(pVCpu, uHostTsc + pVCpu->hm.s.vmx.u64TscOffset);
    85318532
     
    86068607             * Sync the TPR shadow with our APIC state.
    86078608             */
    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)
    86098610                && pVmxTransient->u8GuestTpr != pVCpu->hm.s.vmx.pbVirtApic[XAPIC_OFF_TPR])
    86108611            {
     
    88728873    if (pDbgState->fModifiedProcCtls)
    88738874    {
    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 */
    88768877        int rc2 = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pDbgState->fProcCtlsInitial);
    88778878        AssertRCReturn(rc2, rc2);
     
    90229023    SET_ONLY_XBM_IF_EITHER_EN(INSTR_GETSEC,             VMX_EXIT_GETSEC);           /* unconditional */
    90239024    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 */
    90259026    SET_ONLY_XBM_IF_EITHER_EN( EXIT_HALT,               VMX_EXIT_HLT);
    90269027    SET_ONLY_XBM_IF_EITHER_EN(INSTR_INVD,               VMX_EXIT_INVD);             /* unconditional */
    90279028    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);
    90299030    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);
    90319032    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);
    90339034    SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDTSC,              VMX_EXIT_RDTSC);
    90349035    SET_ONLY_XBM_IF_EITHER_EN(INSTR_RSM,                VMX_EXIT_RSM);              /* unconditional */
     
    90669067#endif
    90679068        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;
    90699070        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? */
    90729073        /* Note! We currently don't use VMX_VMCS32_CTRL_CR3_TARGET_COUNT.  It would
    90739074                 require clearing here and in the loop if we start using it. */
     
    90999100    SET_ONLY_XBM_IF_EITHER_EN( EXIT_DRX_WRITE,          VMX_EXIT_MOV_DRX);
    91009101
    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,               VMX_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,               VMX_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,               VMX_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,             VMX_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);
    91099110#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);
    91119112#endif
    9112     SET_ONLY_XBM_IF_EITHER_EN( EXIT_PAUSE,               VMX_EXIT_PAUSE);
     9113    SET_ONLY_XBM_IF_EITHER_EN( EXIT_PAUSE,              VMX_EXIT_PAUSE);
    91139114
    91149115    if (   IS_EITHER_ENABLED(pVM, INSTR_SGDT)
     
    91179118        || IS_EITHER_ENABLED(pVM, INSTR_LIDT))
    91189119    {
    9119         pDbgState->fCpe2Extra |= VMX_VMCS_CTRL_PROC_EXEC2_DESCRIPTOR_TABLE_EXIT;
     9120        pDbgState->fCpe2Extra |= VMX_PROC_CTLS2_DESC_TABLE_EXIT;
    91209121        ASMBitSet(pDbgState->bmExitsToCheck, VMX_EXIT_XDTR_ACCESS);
    91219122    }
     
    91309131        || IS_EITHER_ENABLED(pVM, INSTR_LTR))
    91319132    {
    9132         pDbgState->fCpe2Extra |= VMX_VMCS_CTRL_PROC_EXEC2_DESCRIPTOR_TABLE_EXIT;
     9133        pDbgState->fCpe2Extra |= VMX_PROC_CTLS2_DESC_TABLE_EXIT;
    91339134        ASMBitSet(pDbgState->bmExitsToCheck, VMX_EXIT_TR_ACCESS);
    91349135    }
     
    91409141    SET_ONLY_XBM_IF_EITHER_EN(INSTR_VMX_INVEPT,         VMX_EXIT_INVEPT);           /* unconditional */
    91419142    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);
    91439144    SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDTSCP,             VMX_EXIT_RDTSCP);
    91449145    SET_ONLY_XBM_IF_EITHER_EN(INSTR_VMX_INVVPID,        VMX_EXIT_INVVPID);          /* unconditional */
    91459146    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);
    91479148    SET_ONLY_XBM_IF_EITHER_EN( EXIT_WBINVD,             VMX_EXIT_WBINVD);
    91489149    SET_ONLY_XBM_IF_EITHER_EN(INSTR_XSETBV,             VMX_EXIT_XSETBV);           /* unconditional */
    91499150    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);
    91519152    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);
    91539154    SET_ONLY_XBM_IF_EITHER_EN( EXIT_VMX_INVPCID,        VMX_EXIT_INVPCID);
    91549155    SET_ONLY_XBM_IF_EITHER_EN(INSTR_VMX_VMFUNC,         VMX_EXIT_VMFUNC);           /* unconditional for the current setup */
    91559156    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);
    91579158    SET_ONLY_XBM_IF_EITHER_EN( EXIT_RDSEED,             VMX_EXIT_RDSEED);
    91589159    SET_ONLY_XBM_IF_EITHER_EN(INSTR_XSAVES,             VMX_EXIT_XSAVES);           /* unconditional (enabled by host, guest cfg) */
     
    91729173    pDbgState->fCpe2Extra       &= pVM->hm.s.vmx.Msrs.ProcCtls2.n.allowed1;
    91739174    if (pDbgState->fCpe2Extra)
    9174         pDbgState->fCpe1Extra   |= VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL;
     9175        pDbgState->fCpe1Extra   |= VMX_PROC_CTLS_USE_SECONDARY_CTLS;
    91759176    pDbgState->fCpe1Extra       &= pVM->hm.s.vmx.Msrs.ProcCtls.n.allowed1;
    91769177    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))
    91789179    {
    91799180        pVCpu->hm.s.fDebugWantRdTscExit ^= true;
     
    1030610307        rc = VMXReadVmcs64(VMX_VMCS64_GUEST_DEBUGCTL_FULL, &u64Val);
    1030710308        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)
    1030910310            && (u64Val & 0xfffffe3c))                           /* Bits 31:9, bits 5:2 MBZ. */
    1031010311        {
     
    1031810319        Assert(u32Val == pVCpu->hm.s.vmx.u32EntryCtls);
    1031910320#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);
    1032110322
    1032210323        /*
     
    1038710388         *        51:32 beyond the processor's physical-address width are 0. */
    1038810389
    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)
    1039010391            && (pCtx->dr[7] & X86_DR7_MBZ_MASK))
    1039110392        {
     
    1040510406         * PERF_GLOBAL MSR.
    1040610407         */
    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)
    1040810409        {
    1040910410            rc = VMXReadVmcs64(VMX_VMCS64_GUEST_PERF_GLOBAL_CTRL_FULL, &u64Val);
     
    1041610417         * PAT MSR.
    1041710418         */
    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)
    1041910420        {
    1042010421            rc = VMXReadVmcs64(VMX_VMCS64_GUEST_PAT_FULL, &u64Val);
     
    1044010441         * EFER MSR.
    1044110442         */
    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)
    1044310444        {
    1044410445            Assert(pVM->hm.s.vmx.fSupportsVmcsEfer);
     
    1044810449                              VMX_IGS_EFER_MSR_RESERVED);               /* Bits 63:12, bit 9, bits 7:1 MBZ. */
    1044910450            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),
    1045110452                              VMX_IGS_EFER_LMA_GUEST_MODE_MISMATCH);
    1045210453            HMVMX_CHECK_BREAK(   fUnrestrictedGuest
     
    1069810699        AssertRCBreak(rc);
    1069910700        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)),
    1070110702                             VMX_IGS_ACTIVITY_STATE_INVALID);
    1070210703        HMVMX_CHECK_BREAK(   !(pCtx->ss.Attr.n.u2Dpl)
     
    1071410715         *        currently don't use activity states but ACTIVE. */
    1071510716
    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)
    1071710718                          || u32ActivityState != VMX_VMCS_GUEST_ACTIVITY_SIPI_WAIT, VMX_IGS_ACTIVITY_STATE_SIPI_WAIT_INVALID);
    1071810719
     
    1074410745        HMVMX_CHECK_BREAK(!(u32IntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_SMI),
    1074510746                          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)
    1074710748                          || (u32IntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_SMI),
    1074810749                             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)
    1075010751            && VMX_ENTRY_INT_INFO_IS_VALID(u32EntryInfo)
    1075110752            && VMX_ENTRY_INT_INFO_TYPE(u32EntryInfo) == VMX_EXIT_INT_INFO_TYPE_NMI)
     
    1086810869
    1086910870    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)
    1087110872           && uIntType != VMX_EXIT_INT_INFO_TYPE_EXT_INT);
    1087210873    Assert(VMX_EXIT_INT_INFO_IS_VALID(pVmxTransient->uExitIntInfo));
     
    1101311014{
    1101411015    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)))
    1101611017    {
    1101711018        AssertMsgFailed(("Unexpected NMI-window exit.\n"));
     
    1115111152        /* If we get a spurious VM-exit when offsetting is enabled,
    1115211153           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)
    1115411155            pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true;
    1115511156        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS
     
    1118011181        /* If we get a spurious VM-exit when offsetting is enabled,
    1118111182           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)
    1118311184            pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = true;
    1118411185        ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS
     
    1145311454{
    1145411455    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);
    1145611457
    1145711458    int rc = hmR0VmxAdvanceGuestRip(pVCpu, pVmxTransient);
     
    1163211633    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    1163311634
    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. */
    1163511636    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)
    1163711638        return VERR_EM_INTERPRETER;
    1163811639    AssertMsgFailed(("Unexpected XDTR access\n"));
     
    1164811649    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    1164911650
    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)
    1165211653        return VERR_EM_INTERPRETER;
    1165311654    AssertMsgFailed(("Unexpected RDRAND exit\n"));
     
    1167511676
    1167611677#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)
    1167811679    {
    1167911680        if (   hmR0VmxIsAutoLoadStoreGuestMsr(pVCpu, idMsr)
     
    1176511766
    1176611767        /* 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))
    1176811769        {
    1176911770            switch (idMsr)
     
    1186411865{
    1186511866    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);
    1186711868
    1186811869    /*
     
    1197411975                {
    1197511976                    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));
    1197711978                    ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged,
    1197811979                                     HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS | HM_CHANGED_GUEST_APIC_TPR);
     
    1199411995            /* CR8 reads only cause a VM-exit when the TPR shadow feature isn't enabled. */
    1199511996            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));
    1199711998
    1199811999            rcStrict = IEMExecDecodedMovCRxRead(pVCpu, pVmxTransient->cbInstr,
     
    1212712128            Log4(("CS:RIP=%04x:%08RX64 %#06x/%u %c str\n", pCtx->cs.Sel, pCtx->rip, uIOPort, cbValue, fIOWrite ? 'w' : 'r'));
    1212812129            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)
    1213012132            {
    1213112133                int rc2  = hmR0VmxReadExitInstrInfoVmcs(pVmxTransient);
     
    1236812370{
    1236912371    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;
    1237212374    int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls);
    1237312375    AssertRCReturn(rc, rc);
     
    1241712419        case VMX_APIC_ACCESS_TYPE_LINEAR_READ:
    1241812420        {
    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)
    1242012422                      || VMX_EXIT_QUAL_APIC_ACCESS_OFFSET(pVmxTransient->uExitQualification) != XAPIC_OFF_TPR,
    1242112423                      ("hmR0VmxExitApicAccess: can't access TPR offset while using TPR shadowing.\n"));
     
    1247812480
    1247912481        /* 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;
    1248112483        int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls);
    1248212484        AssertRCReturn(rc, rc);
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r73097 r73389  
    901901
    902902/**
     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 */
     909DECLCALLBACK(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 */
     992static 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/**
    9031194 * Initializes the CPUM.
    9041195 *
     
    10611352                                 &cpumR3InfoGuestInstr, DBGFINFO_FLAGS_ALL_EMTS);
    10621353    DBGFR3InfoRegisterInternal(  pVM, "cpuid",            "Displays the guest cpuid leaves.",         &cpumR3CpuIdInfo);
     1354    DBGFR3InfoRegisterInternal(  pVM, "cpumvmxfeat",      "Displays the host and guest VMX hwvirt. features.",
     1355                               &cpumR3InfoVmxFeatures);
    10631356
    10641357    rc = cpumR3DbgInit(pVM);
     
    30023295        }
    30033296
     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
    30043319        default:
    30053320            break;
  • trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp

    r73274 r73389  
    17381738        pFeatures->fPcid                = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_PCID);
    17391739        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(). */
    17421741
    17431742        /* Structured extended features. */
  • trunk/src/VBox/VMM/VMMR3/GIMHv.cpp

    r73340 r73389  
    555555    {
    556556        /* Hypervisor capabilities; features used by the hypervisor. */
    557         pHv->uHyperCaps  = HMIsNestedPagingActive(pVM)   ? GIM_HV_HOST_FEAT_NESTED_PAGING : 0;
    558         pHv->uHyperCaps |= HMAreMsrBitmapsAvailable(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;
    559559    }
    560560
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r73294 r73389  
    13341334
    13351335/**
    1336  * Returns the VMCS (and associated regions') memory type given the IA32_VMX_BASIC
    1337  * MSR.
     1336 * Returns a description of the VMCS (and associated regions') memory type given the
     1337 * IA32_VMX_BASIC MSR.
    13381338 *
    13391339 * @returns The descriptive memory type.
     
    13421342static const char *hmR3VmxGetMemTypeDesc(uint64_t uMsrVmxBasic)
    13431343{
    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);
    13451345    switch (uMemType)
    13461346    {
    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)";
    13491349    }
    13501350    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 */
     1361static 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];
    13511377}
    13521378
     
    13871413static void hmR3VmxReportBasicMsr(uint64_t uBasicMsr)
    13881414{
    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                                                                                                                 : "None"));
     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"));
    13941420    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)));
    13981424}
    13991425
     
    14091435    uint64_t const zap = pVmxMsr->n.disallowed0;
    14101436    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_INTR",   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);
    14161442}
    14171443
     
    14271453    uint64_t const zap = pVmxMsr->n.disallowed0;
    14281454    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);
    14501476}
    14511477
     
    14611487    uint64_t const zap = pVmxMsr->n.disallowed0;
    14621488    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, "DESCRIPTOR_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_INTR_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);
    14851511}
    14861512
     
    14961522    uint64_t const zap = pVmxMsr->n.disallowed0;
    14971523    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_DUALMON",  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);
    15051531}
    15061532
     
    15161542    uint64_t const zap = pVmxMsr->n.disallowed0;
    15171543    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);
    15271553}
    15281554
     
    15631589{
    15641590    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));
    15671594    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)));
    15821611}
    15831612
     
    15901619static void hmR3VmxReportVmcsEnumMsr(uint64_t uVmcsEnum)
    15911620{
    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)));
    15951623}
    15961624
     
    16011629 * @param   uVmFunc    The VMX VMFUNC MSR value.
    16021630 */
    1603 static void hmR3VmxReportVmfuncMsr(uint64_t uVmFunc)
     1631static void hmR3VmxReportVmFuncMsr(uint64_t uVmFunc)
    16041632{
    16051633    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));
    16071635}
    16081636
     
    16461674    hmR3VmxReportPinBasedCtlsMsr(&pVM->hm.s.vmx.Msrs.PinCtls);
    16471675    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)
    16491677        hmR3VmxReportProcBasedCtls2Msr(&pVM->hm.s.vmx.Msrs.ProcCtls2);
    16501678
     
    16521680    hmR3VmxReportExitCtlsMsr(&pVM->hm.s.vmx.Msrs.ExitCtls);
    16531681
    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}. */
    16581685        LogRel(("HM: MSR_IA32_VMX_TRUE_PINBASED_CTLS   = %#RX64\n", pVM->hm.s.vmx.Msrs.TruePinCtls));
    16591686        LogRel(("HM: MSR_IA32_VMX_TRUE_PROCBASED_CTLS  = %#RX64\n", pVM->hm.s.vmx.Msrs.TrueProcCtls));
     
    16661693    if (pVM->hm.s.vmx.Msrs.u64EptVpidCaps)
    16671694        hmR3VmxReportEptVpidCapsMsr(pVM->hm.s.vmx.Msrs.u64EptVpidCaps);
    1668     if (pVM->hm.s.vmx.Msrs.u64Vmfunc)
    1669         hmR3VmxReportVmfuncMsr(pVM->hm.s.vmx.Msrs.u64Vmfunc);
     1695    if (pVM->hm.s.vmx.Msrs.u64VmFunc)
     1696        hmR3VmxReportVmFuncMsr(pVM->hm.s.vmx.Msrs.u64VmFunc);
    16701697    hmR3VmxReportCrFixedMsrs(&pVM->hm.s.vmx.Msrs);
    16711698
     
    16811708     */
    16821709    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),
    16841711                       VERR_HM_IPE_1);
    16851712    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)
    16871714                           && pVM->hm.s.fNestedPaging),
    16881715                       VERR_HM_IPE_1);
     
    16911718     * Enable VPID if configured and supported.
    16921719     */
    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)
    16941721        pVM->hm.s.vmx.fVpid = pVM->hm.s.vmx.fAllowVpid;
    16951722
     
    16981725     * Enable APIC register virtualization and virtual-interrupt delivery if supported.
    16991726     */
    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))
    17021729        pVM->hm.s.fVirtApicRegs = true;
    17031730
     
    17071734    /** @todo Add and query IPRT API for host OS support for posted-interrupt IPI
    17081735     *        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))
    17111738        pVM->hm.s.fPostedIntrs = true;
    17121739#endif
     
    17171744     * in Nehalems and secondary VM exec. controls should be supported in all of them, but nonetheless it's Intel...
    17181745     */
    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)
    17201747        && CPUMR3GetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_RDTSCP))
    17211748    {
     
    34133440                    {
    34143441                        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   );
    34203447                    }
    34213448                    LogRel(("HM: CPU[%u] ProcCtls         %#RX32\n", i, pVCpu->hm.s.vmx.u32ProcCtls));
    34223449                    {
    34233450                        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);
    34453472                    }
    34463473                    LogRel(("HM: CPU[%u] ProcCtls2        %#RX32\n", i, pVCpu->hm.s.vmx.u32ProcCtls2));
    34473474                    {
    34483475                        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       );
    34713498                    }
    34723499                    LogRel(("HM: CPU[%u] EntryCtls        %#RX32\n", i, pVCpu->hm.s.vmx.u32EntryCtls));
    34733500                    {
    34743501                        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      );
    34823509                    }
    34833510                    LogRel(("HM: CPU[%u] ExitCtls         %#RX32\n", i, pVCpu->hm.s.vmx.u32ExitCtls));
    34843511                    {
    34853512                        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);
    34953522                    }
    34963523                    LogRel(("HM: CPU[%u] HCPhysMsrBitmap  %#RHp\n",  i, pVCpu->hm.s.vmx.HCPhysMsrBitmap));
  • trunk/src/VBox/VMM/include/CPUMInternal.h

    r72178 r73389  
    441441#ifndef VBOX_FOR_DTRACE_LIB
    442442AssertCompileMemberOffset(CPUM, HostFeatures, 64);
    443 AssertCompileMemberOffset(CPUM, GuestFeatures, 96);
     443AssertCompileMemberOffset(CPUM, GuestFeatures, 104);
    444444#endif
    445445/** Pointer to the CPUM instance data residing in the shared VM structure. */
  • trunk/src/VBox/VMM/include/CPUMInternal.mac

    r72643 r73389  
    9797
    9898    alignb 64
    99     .HostFeatures               resb    32
    100     .GuestFeatures              resb    32
     99    .HostFeatures               resb    40
     100    .GuestFeatures              resb    40
    101101    .GuestInfo                  resb    RTHCPTR_CB*4 + RTRCPTR_CB*2 + 4*12
    102102
  • trunk/src/VBox/VMM/include/HMInternal.h

    r73293 r73389  
    726726        uint32_t                    u32Alignment0;
    727727#endif
    728         /** Current VMX_VMCS32_CTRL_PIN_EXEC. */
     728        /** Current pin-based VM-execution controls. */
    729729        uint32_t                    u32PinCtls;
    730         /** Current VMX_VMCS32_CTRL_PROC_EXEC. */
     730        /** Current processor-based VM-execution controls. */
    731731        uint32_t                    u32ProcCtls;
    732         /** Current VMX_VMCS32_CTRL_PROC_EXEC2. */
     732        /** Current secondary processor-based VM-execution controls. */
    733733        uint32_t                    u32ProcCtls2;
    734         /** Current VMX_VMCS32_CTRL_EXIT. */
     734        /** Current VM-entry controls. */
     735        uint32_t                    u32EntryCtls;
     736        /** Current VM-exit controls. */
    735737        uint32_t                    u32ExitCtls;
    736         /** Current VMX_VMCS32_CTRL_ENTRY. */
    737         uint32_t                    u32EntryCtls;
    738738
    739739        /** Current CR0 mask. */
     
    823823            X86DESCATTR             AttrSS;
    824824            X86EFLAGS               Eflags;
    825             uint32_t                fRealOnV86Active;
     825            bool                    fRealOnV86Active;
    826826        } RealMode;
    827827
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette