Changeset 74073 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Sep 4, 2018 6:05:14 PM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp
r74065 r74073 142 142 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_EntryCtlsAllowed1 , "EntryCtlsAllowed1" ), 143 143 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_EntryCtlsDisallowed0 , "EntryCtlsDisallowed0" ), 144 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_EntryInstrLen , "EntryInstrLen" ), 145 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_EntryInstrLenZero , "EntryInstrLenZero" ), 146 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_EntryIntInfoErrCodePe , "EntryIntInfoErrCodePe" ), 147 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_EntryIntInfoErrCodeVec , "EntryIntInfoErrCodeVec" ), 148 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_EntryIntInfoTypeVecRsvd , "EntryIntInfoTypeVecRsvd" ), 149 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_EntryXcptErrCodeRsvd , "EntryXcptErrCodeRsvd" ), 144 150 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_ExitCtlsAllowed1 , "ExitCtlsAllowed1" ), 145 151 VMX_INSTR_DIAG_DESC(kVmxVInstrDiag_Vmentry_ExitCtlsDisallowed0 , "ExitCtlsDisallowed0" ), -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r74065 r74073 1985 1985 } 1986 1986 1987 /** @todo NSTVMX: rest of entry ctls. */ 1987 /* Event injection. */ 1988 uint32_t const uIntInfo = pVmcs->u32EntryIntInfo; 1989 if (RT_BF_GET(uIntInfo, VMX_BF_ENTRY_INT_INFO_VALID)) 1990 { 1991 /* Type and vector. */ 1992 uint8_t const uType = RT_BF_GET(uIntInfo, VMX_BF_ENTRY_INT_INFO_TYPE); 1993 uint8_t const uVector = RT_BF_GET(uIntInfo, VMX_BF_ENTRY_INT_INFO_VECTOR); 1994 uint8_t const uRsvd = RT_BF_GET(uIntInfo, VMX_BF_ENTRY_INT_INFO_RSVD_12_30); 1995 if ( uRsvd == 0 1996 && HMVmxIsEntryIntInfoTypeValid(IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fVmxMonitorTrapFlag, uType) 1997 && HMVmxIsEntryIntInfoVectorValid(uVector, uType)) 1998 { /* likely */ } 1999 else 2000 { 2001 Log(("%s: VM-entry interruption info (%#RX32) invalid (rsvd/type/vector) -> VMFail\n", pszInstr, uIntInfo)); 2002 pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_EntryIntInfoTypeVecRsvd; 2003 return VERR_VMX_VMENTRY_FAILED; 2004 } 2005 2006 /* Error code. */ 2007 if (RT_BF_GET(uIntInfo, VMX_BF_ENTRY_INT_INFO_ERR_CODE_VALID)) 2008 { 2009 /* Delivery possible only in Unrestricted-guest mode when CR0.PE is set. */ 2010 if ( !(pVmcs->u32ProcCtls2 & VMX_PROC_CTLS2_UNRESTRICTED_GUEST) 2011 || (pVmcs->u64GuestCr0.s.Lo & X86_CR0_PE)) 2012 { /* likely */ } 2013 else 2014 { 2015 Log(("%s: VM-entry interruption (%#RX32) invalid error-code (paging-mode) -> VMFail\n", pszInstr, uIntInfo)); 2016 pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_EntryIntInfoErrCodePe; 2017 return VERR_VMX_VMENTRY_FAILED; 2018 } 2019 2020 if ( uType == VMX_ENTRY_INT_INFO_TYPE_HW_XCPT 2021 && ( uVector == X86_XCPT_DF 2022 || uVector == X86_XCPT_TS 2023 || uVector == X86_XCPT_NP 2024 || uVector == X86_XCPT_SS 2025 || uVector == X86_XCPT_GP 2026 || uVector == X86_XCPT_PF 2027 || uVector == X86_XCPT_AC)) 2028 { /* likely */ } 2029 else 2030 { 2031 Log(("%s: VM-entry interruption (%#RX32) invalid error-code (vector) -> VMFail\n", pszInstr, uIntInfo)); 2032 pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_EntryIntInfoErrCodeVec; 2033 return VERR_VMX_VMENTRY_FAILED; 2034 } 2035 2036 /* Exception error-code reserved bits. */ 2037 if (pVmcs->u32EntryXcptErrCode & ~VMX_ENTRY_INT_XCPT_ERR_CODE_VALID_MASK) 2038 { 2039 Log(("%s: VM-entry exception error-code (%#RX32) invalid -> VMFail\n", pszInstr, uIntInfo)); 2040 pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_EntryXcptErrCodeRsvd; 2041 return VERR_VMX_VMENTRY_FAILED; 2042 } 2043 2044 /* Injecting a software interrupt, software exception or privileged software exception. */ 2045 if ( uType == VMX_ENTRY_INT_INFO_TYPE_SW_INT 2046 || uType == VMX_ENTRY_INT_INFO_TYPE_SW_XCPT 2047 || uType == VMX_ENTRY_INT_INFO_TYPE_PRIV_SW_XCPT) 2048 { 2049 /* Instruction length must be in the range 0-15. */ 2050 if (pVmcs->u32EntryInstrLen > VMX_ENTRY_INSTR_LEN_MAX) 2051 { 2052 Log(("%s: VM-entry instruction length (%#RX32) invalid -> VMFail\n", pszInstr, pVmcs->u32EntryInstrLen)); 2053 pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_EntryInstrLen; 2054 return VERR_VMX_VMENTRY_FAILED; 2055 } 2056 2057 /* Zero instruction length is only allowed when the CPU supports it explicitly. */ 2058 if ( pVmcs->u32EntryInstrLen == 0 2059 && !IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fVmxEntryInjectSoftInt) 2060 { 2061 Log(("%s: VM-entry instruction length zero invalid (swint/xcpt/priv) -> VMFail\n", pszInstr)); 2062 pVCpu->cpum.GstCtx.hwvirt.vmx.enmInstrDiag = kVmxVInstrDiag_Vmentry_EntryInstrLenZero; 2063 return VERR_VMX_VMENTRY_FAILED; 2064 } 2065 } 2066 } 2067 } 1988 2068 1989 2069 /* VM-entry MSR-load count and VM-entry MSR-load area address. */ -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r74061 r74073 8024 8024 8025 8025 /* Validate. */ 8026 Assert(VMX_EXIT_INT_INFO_IS_VALID(u32IntInfo)); /* Bit 31 (Valid bit) must be set by caller. */ 8027 Assert(!VMX_EXIT_INT_INFO_IS_NMI_UNBLOCK_IRET(u32IntInfo)); /* Bit 12 MBZ. */ 8028 Assert(!(u32IntInfo & 0x7ffff000)); /* Bits 30:12 MBZ. */ 8026 Assert(VMX_ENTRY_INT_INFO_IS_VALID(u32IntInfo)); /* Bit 31 (Valid bit) must be set by caller. */ 8027 Assert(!(u32IntInfo & VMX_BF_ENTRY_INT_INFO_RSVD_12_30_MASK)); /* Bits 30:12 MBZ. */ 8029 8028 8030 8029 /* Inject. */
Note:
See TracChangeset
for help on using the changeset viewer.