VirtualBox

Changeset 73628 in vbox


Ignore:
Timestamp:
Aug 13, 2018 7:45:01 AM (6 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:9180 Implement IA32_VMX_MISC MSR.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/hm_vmx.h

    r73606 r73628  
    12371237 *  instructions. */
    12381238#define VMX_MISC_ENTRY_INJECT_SOFT_INT                          RT_BIT(30)
    1239 /** Maximum number of MSRs in the VMCS, (n+1)*512. */
     1239/** Maximum number of MSRs in the auto-load/store MSR areas, (n+1) * 512. */
    12401240#define VMX_MISC_MAX_MSRS(a_MiscMsr)                            (512 * (RT_BF_GET((a_MiscMsr), VMX_BF_MISC_MAX_MSRS) + 1))
     1241/** Maximum CR3-target count supported by the CPU. */
     1242#define VMX_MISC_CR3_TARGET_COUNT(a_MiscMsr)                    (((a) >> 16) & 0xff)
    12411243/** Relationship between the preemption timer and tsc. */
    12421244#define VMX_BF_MISC_PREEMPT_TIMER_TSC_SHIFT                     0
     
    12861288/** @} */
    12871289
     1290/** Maximum number of CR3 target supported by VT-x */
     1291#define VMX_VMCS_CTRL_CR3_TARGET_COUNT_MAX                      4
    12881292
    12891293/** @name VMX MSR - VMCS enumeration.
     
    15741578#define VMX_VMCS_CTRL_CR3_TARGET_VAL1                           0x600a
    15751579#define VMX_VMCS_CTRL_CR3_TARGET_VAL2                           0x600c
    1576 #define VMX_VMCS_CTRL_CR3_TARGET_VAL31                          0x600e
     1580#define VMX_VMCS_CTRL_CR3_TARGET_VAL3                           0x600e
    15771581/** @} */
    15781582
     
    25232527#define VMX_V_VMCS_PHYSADDR_4G_LIMIT                            0
    25242528
     2529/** @name Virtual VMX MSR - Miscellaneous data.
     2530 * @{ */
     2531/** Number of CR3-target values supported. */
     2532#define VMX_V_CR3_TARGET_COUNT                                  4
     2533/** Activity states supported. */
     2534#define VMX_V_GUEST_ACTIVITY_STATE_MASK                         (VMX_VMCS_GUEST_ACTIVITY_HLT)
     2535/** VMX preemption-timer shift (Core i7-2600 taken as reference). */
     2536#define VMX_V_PREEMPT_TIMER_SHIFT                               5
     2537/** Maximum number of MSRs in the auto-load/store MSR areas, (n+1) * 512. */
     2538#define VMX_V_MAX_MSRS                                          0
     2539/** SMM MSEG revision ID. */
     2540#define VMX_V_MSEG_REV_ID                                       0
     2541/** @} */
     2542
    25252543/**
    25262544 * Virtual VMX-instruction diagnostics.
  • trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp

    r73606 r73628  
    14551455    if (pGuestFeatures->fVmx)
    14561456    {
    1457         /** @todo Think about this especially preemption timer TSC shifts.  */
    1458         *puValue = 0;
     1457        uint64_t uHostMsr;
     1458        int rc = HMVmxGetHostMsr(pVCpu->CTX_SUFF(pVM), idMsr, &uHostMsr);
     1459        AssertRCReturn(rc, rc);
     1460        uint8_t const cMaxMsrs = RT_MIN(RT_BF_GET(uHostMsr, VMX_BF_MISC_MAX_MSRS), VMX_V_MAX_MSRS);
     1461        *puValue = RT_BF_MAKE(VMX_BF_MISC_PREEMPT_TIMER_TSC,      VMX_V_PREEMPT_TIMER_SHIFT             )
     1462                 | RT_BF_MAKE(VMX_BF_MISC_EXIT_STORE_EFER_LMA,    pGuestFeatures->fVmxExitStoreEferLma  )
     1463                 | RT_BF_MAKE(VMX_BF_MISC_ACTIVITY_STATES,        VMX_V_GUEST_ACTIVITY_STATE_MASK       )
     1464                 | RT_BF_MAKE(VMX_BF_MISC_PT,                     0                                     )
     1465                 | RT_BF_MAKE(VMX_BF_MISC_SMM_READ_SMBASE_MSR,    0                                     )
     1466                 | RT_BF_MAKE(VMX_BF_MISC_CR3_TARGET,             VMX_V_CR3_TARGET_COUNT                )
     1467                 | RT_BF_MAKE(VMX_BF_MISC_MAX_MSRS,               cMaxMsrs                              )
     1468                 | RT_BF_MAKE(VMX_BF_MISC_VMXOFF_BLOCK_SMI,       0                                     )
     1469                 | RT_BF_MAKE(VMX_BF_MISC_VMWRITE_ALL,            pGuestFeatures->fVmxVmwriteAll        )
     1470                 | RT_BF_MAKE(VMX_BF_MISC_ENTRY_INJECT_SOFT_INT,  pGuestFeatures->fVmxEntryInjectSoftInt)
     1471                 | RT_BF_MAKE(VMX_BF_MISC_MSEG_ID,                VMX_V_MSEG_REV_ID                     );
    14591472    }
    14601473    else
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r73606 r73628  
    337337    Assert(!pVCpu->cpum.GstCtx.hwvirt.vmx.fInVmxNonRootMode);
    338338
    339     /** @todo NSTVMX: Unblock INIT. */
    340339    if (fSmmMonitorCtl & MSR_IA32_SMM_MONITOR_VMXOFF_UNBLOCK_SMI)
    341340    { /** @todo NSTVMX: Unblock SMI. */ }
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