Changeset 74073 in vbox for trunk/include
- Timestamp:
- Sep 4, 2018 6:05:14 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/hm_vmx.h
r74065 r74073 1829 1829 /** @} */ 1830 1830 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 /** @} */ 1831 1837 1832 1838 /** @name Pin-based VM-execution controls. … … 2254 2260 /** @} */ 2255 2261 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 /** @} */ 2256 2272 2257 2273 /** @name VM-entry interruption information types. … … 3459 3475 kVmxVInstrDiag_Vmentry_EntryCtlsAllowed1, 3460 3476 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, 3461 3483 kVmxVInstrDiag_Vmentry_ExitCtlsAllowed1, 3462 3484 kVmxVInstrDiag_Vmentry_ExitCtlsDisallowed0, … … 3516 3538 } 3517 3539 3518 3519 3540 /** 3520 3541 * Returns whether the given VMCS field is a read-only VMCS field or not. … … 3530 3551 /* See Intel spec. B.4.2 "Natural-Width Read-Only Data Fields". */ 3531 3552 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 */ 3562 DECLINLINE(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 */ 3590 DECLINLINE(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; 3532 3603 } 3533 3604 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.