Changeset 91360 in vbox
- Timestamp:
- Sep 24, 2021 11:30:02 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r91316 r91360 452 452 endif 453 453 endif 454 # Enables guest EPT support for VMX nested hardware virtualization. 455 VBOX_WITH_NESTED_HWVIRT_VMX_EPT = 1 454 456 endif 455 457 # Enable native NEM on windows. -
trunk/include/VBox/vmm/hm_vmx.h
r91358 r91360 1779 1779 #define VMX_BF_EPTP_RSVD_8_11_SHIFT 8 1780 1780 #define VMX_BF_EPTP_RSVD_8_11_MASK UINT64_C(0x0000000000000f00) 1781 #define VMX_BF_EPTP_PML4_ ADDR_SHIFT121782 #define VMX_BF_EPTP_PML4_ ADDR_MASKUINT64_C(0xfffffffffffff000)1781 #define VMX_BF_EPTP_PML4_TABLE_ADDR_SHIFT 12 1782 #define VMX_BF_EPTP_PML4_TABLE_ADDR_MASK UINT64_C(0xfffffffffffff000) 1783 1783 RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_EPTP_, UINT64_C(0), UINT64_MAX, 1784 (MEMTYPE, PAGE_WALK_LENGTH, ACCESS_DIRTY, SUPER_SHW_STACK, RSVD_8_11, PML4_ADDR)); 1784 (MEMTYPE, PAGE_WALK_LENGTH, ACCESS_DIRTY, SUPER_SHW_STACK, RSVD_8_11, PML4_TABLE_ADDR)); 1785 1786 /* Mask of valid EPTP bits sans physically non-addressable bits. */ 1787 #define VMX_EPTP_VALID_MASK ( VMX_BF_EPTP_MEMTYPE_MASK \ 1788 | VMX_BF_EPTP_PAGE_WALK_LENGTH_MASK \ 1789 | VMX_BF_EPTP_ACCESS_DIRTY_MASK \ 1790 | VMX_BF_EPTP_SUPER_SHW_STACK_MASK \ 1791 | VMX_BF_EPTP_PML4_TABLE_ADDR_MASK) 1785 1792 /** @} */ 1786 1793 … … 4148 4155 kVmxVDiag_Vmentry_EntryIntInfoTypeVecRsvd, 4149 4156 kVmxVDiag_Vmentry_EntryXcptErrCodeRsvd, 4157 kVmxVDiag_Vmentry_EptpAccessDirty, 4158 kVmxVDiag_Vmentry_EptpPageWalkLength, 4159 kVmxVDiag_Vmentry_EptpMemType, 4160 kVmxVDiag_Vmentry_EptpRsvd, 4150 4161 kVmxVDiag_Vmentry_ExitCtlsAllowed1, 4151 4162 kVmxVDiag_Vmentry_ExitCtlsDisallowed0, -
trunk/src/VBox/VMM/Config.kmk
r91014 r91360 35 35 ifdef VBOX_WITH_NESTED_HWVIRT_VMX 36 36 VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_VMX 37 endif 38 ifdef VBOX_WITH_NESTED_HWVIRT_VMX_EPT 39 VMM_COMMON_DEFS += VBOX_WITH_NESTED_HWVIRT_VMX_EPT 37 40 endif 38 41 ifdef VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM -
trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp
r91297 r91360 169 169 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_EntryIntInfoTypeVecRsvd , "EntryIntInfoTypeVecRsvd" ), 170 170 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_EntryXcptErrCodeRsvd , "EntryXcptErrCodeRsvd" ), 171 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_EptpAccessDirty , "EptpAccessDirty" ), 172 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_EptpPageWalkLength , "EptpPageWalkLength" ), 173 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_EptpMemType , "EptpMemType" ), 174 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_EptpRsvd , "EptpRsvd" ), 171 175 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_ExitCtlsAllowed1 , "ExitCtlsAllowed1" ), 172 176 VMXV_DIAG_DESC(kVmxVDiag_Vmentry_ExitCtlsDisallowed0 , "ExitCtlsDisallowed0" ), -
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.