VirtualBox

Changeset 74073 in vbox for trunk/include


Ignore:
Timestamp:
Sep 4, 2018 6:05:14 PM (6 years ago)
Author:
vboxsync
Message:

VMM/IEM, HM: Nested VMX: bugref:9180 vmlaunch/vmresume bits.

File:
1 edited

Legend:

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

    r74065 r74073  
    18291829/** @} */
    18301830
     1831/** @name VM-entry instruction length.
     1832 * @{ */
     1833/** The maximum valid value for VM-entry instruction length while injecting a
     1834 *  software interrupt, software exception or privileged software exception. */
     1835#define VMX_ENTRY_INSTR_LEN_MAX                                 15
     1836/** @} */
    18311837
    18321838/** @name Pin-based VM-execution controls.
     
    22542260/** @} */
    22552261
     2262/** @name VM-entry exception error code.
     2263 * @{ */
     2264/** Error code valid mask. */
     2265/** @todo r=ramshankar: Intel spec. 26.2.1.3 "VM-Entry Control Fields" states that
     2266 *        bits 31:15 MBZ. However, Intel spec. 6.13 "Error Code" states "To keep the
     2267 *        stack aligned for doubleword pushes, the upper half of the error code is
     2268 *        reserved" which implies bits 31:16 MBZ (and not 31:15) which is what we
     2269 *        use below. */
     2270#define VMX_ENTRY_INT_XCPT_ERR_CODE_VALID_MASK                   UINT32_C(0xffff)
     2271/** @} */
    22562272
    22572273/** @name VM-entry interruption information types.
     
    34593475    kVmxVInstrDiag_Vmentry_EntryCtlsAllowed1,
    34603476    kVmxVInstrDiag_Vmentry_EntryCtlsDisallowed0,
     3477    kVmxVInstrDiag_Vmentry_EntryInstrLen,
     3478    kVmxVInstrDiag_Vmentry_EntryInstrLenZero,
     3479    kVmxVInstrDiag_Vmentry_EntryIntInfoErrCodePe,
     3480    kVmxVInstrDiag_Vmentry_EntryIntInfoErrCodeVec,
     3481    kVmxVInstrDiag_Vmentry_EntryIntInfoTypeVecRsvd,
     3482    kVmxVInstrDiag_Vmentry_EntryXcptErrCodeRsvd,
    34613483    kVmxVInstrDiag_Vmentry_ExitCtlsAllowed1,
    34623484    kVmxVInstrDiag_Vmentry_ExitCtlsDisallowed0,
     
    35163538}
    35173539
    3518 
    35193540/**
    35203541 * Returns whether the given VMCS field is a read-only VMCS field or not.
     
    35303551    /* See Intel spec. B.4.2 "Natural-Width Read-Only Data Fields". */
    35313552    return (RT_BF_GET(uFieldEnc, VMX_BF_VMCS_ENC_TYPE) == VMXVMCSFIELDTYPE_VMEXIT_INFO);
     3553}
     3554
     3555/**
     3556 * Returns whether the given VM-entry interruption-information type is valid or not.
     3557 *
     3558 * @returns @c true if it's a valid type, @c false otherwise.
     3559 * @param   fSupportsMtf    Whether the monitor-trap flag CPU feature is supported.
     3560 * @param   uType           The VM-entry interruption-information type.
     3561 */
     3562DECLINLINE(bool) HMVmxIsEntryIntInfoTypeValid(bool fSupportsMtf, uint8_t uType)
     3563{
     3564    /* See Intel spec. 26.2.1.3 "VM-Entry Control Fields". */
     3565    switch (uType)
     3566    {
     3567        case VMX_ENTRY_INT_INFO_TYPE_EXT_INT:
     3568        case VMX_ENTRY_INT_INFO_TYPE_NMI:
     3569        case VMX_ENTRY_INT_INFO_TYPE_HW_XCPT:
     3570        case VMX_ENTRY_INT_INFO_TYPE_SW_INT:
     3571        case VMX_ENTRY_INT_INFO_TYPE_PRIV_SW_XCPT:
     3572        case VMX_ENTRY_INT_INFO_TYPE_SW_XCPT:           return true;
     3573        case VMX_ENTRY_INT_INFO_TYPE_OTHER_EVENT:       return fSupportsMtf;
     3574        default:
     3575            return false;
     3576    }
     3577}
     3578
     3579/**
     3580 * Returns whether the given VM-entry interruption-information vector and type
     3581 * combination is valid or not.
     3582 *
     3583 * @returns @c true if it's a valid vector/type combination, @c false otherwise.
     3584 * @param   uVector     The VM-entry interruption-information vector.
     3585 * @param   uType       The VM-entry interruption-information type.
     3586 *
     3587 * @remarks Warning! This function does not validate the type field individually.
     3588 *          Use it after verifying type is valid using HMVmxIsEntryIntInfoTypeValid.
     3589 */
     3590DECLINLINE(bool) HMVmxIsEntryIntInfoVectorValid(uint8_t uVector, uint8_t uType)
     3591{
     3592    /* See Intel spec. 26.2.1.3 "VM-Entry Control Fields". */
     3593    if (   uType == VMX_ENTRY_INT_INFO_TYPE_NMI
     3594        && uVector != X86_XCPT_NMI)
     3595        return false;
     3596    if (   uType == VMX_ENTRY_INT_INFO_TYPE_HW_XCPT
     3597        && uVector > X86_XCPT_LAST)
     3598        return false;
     3599    if (   uType == VMX_ENTRY_INT_INFO_TYPE_OTHER_EVENT
     3600        && uVector != 0)
     3601        return false;
     3602    return true;
    35323603}
    35333604/** @} */
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