Changeset 91360 in vbox for trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
- Timestamp:
- Sep 24, 2021 11:30:02 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r91323 r91360 6078 6078 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_Vpid); 6079 6079 6080 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX_EPT 6081 /* Extended Page Tables Pointer (EPTP). */ 6082 if (pVmcs->u32ProcCtls2 & VMX_PROC_CTLS2_EPT) 6083 { 6084 /* Reserved bits. */ 6085 uint8_t const cMaxPhysAddrWidth = IEM_GET_GUEST_CPU_FEATURES(pVCpu)->cMaxPhysAddrWidth; 6086 uint64_t const fValidMask = VMX_EPTP_VALID_MASK & ~(UINT64_MAX << cMaxPhysAddrWidth); 6087 if (pVmcs->u64EptpPtr.u & fValidMask) 6088 { /* likely */ } 6089 else 6090 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_EptpRsvd); 6091 6092 /* Memory Type. */ 6093 uint64_t const fCaps = pVCpu->cpum.GstCtx.hwvirt.vmx.Msrs.u64EptVpidCaps; 6094 uint8_t const fMemType = RT_BF_GET(pVmcs->u64EptpPtr.u, VMX_BF_EPTP_MEMTYPE); 6095 if ( ( fMemType == VMX_EPTP_MEMTYPE_WB 6096 && RT_BF_GET(fCaps, VMX_BF_EPT_VPID_CAP_MEMTYPE_WB)) 6097 || ( fMemType == VMX_EPTP_MEMTYPE_UC 6098 && RT_BF_GET(fCaps, VMX_BF_EPT_VPID_CAP_MEMTYPE_UC))) 6099 { /* likely */ } 6100 else 6101 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_EptpMemType); 6102 6103 /* 6104 * Page walk length (PML4). 6105 * Intel used to specify bit 7 of IA32_VMX_EPT_VPID_CAP as page walk length 6106 * of 5 but that seems to be removed from the latest specs. leaving only PML4 6107 * as the maximum supported page-walk level hence we hardcode it as 3 (1 less than 4) 6108 */ 6109 Assert(RT_BF_GET(fCaps, VMX_BF_EPT_VPID_CAP_PAGE_WALK_LENGTH_4)); 6110 if (RT_BF_GET(pVmcs->u64EptpPtr.u, VMX_BF_EPTP_PAGE_WALK_LENGTH) == 3) 6111 { /* likely */ } 6112 else 6113 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_EptpPageWalkLength); 6114 6115 /* Access and dirty bits support in EPT structures. */ 6116 if ( !RT_BF_GET(pVmcs->u64EptpPtr.u, VMX_BF_EPTP_ACCESS_DIRTY) 6117 || RT_BF_GET(fCaps, VMX_BF_EPT_VPID_CAP_ACCESS_DIRTY)) 6118 { /* likely */ } 6119 else 6120 IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_EptpAccessDirty); 6121 } 6122 #else 6123 Assert(!(pVmcs->u32ProcCtls2 & VMX_PROC_CTLS2_EPT)); /* We don't support EPT yet. */ 6124 #endif 6125 6080 6126 Assert(!(pVmcs->u32PinCtls & VMX_PIN_CTLS_POSTED_INT)); /* We don't support posted interrupts yet. */ 6081 Assert(!(pVmcs->u32ProcCtls2 & VMX_PROC_CTLS2_EPT)); /* We don't support EPT yet. */6082 6127 Assert(!(pVmcs->u32ProcCtls2 & VMX_PROC_CTLS2_PML)); /* We don't support PML yet. */ 6083 6128 Assert(!(pVmcs->u32ProcCtls2 & VMX_PROC_CTLS2_UNRESTRICTED_GUEST)); /* We don't support Unrestricted-guests yet. */
Note:
See TracChangeset
for help on using the changeset viewer.