- Timestamp:
- Oct 13, 2021 11:05:26 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r91635 r91710 1309 1309 /** VMX: Supports EPT-violations \#VE. */ 1310 1310 uint32_t fVmxEptXcptVe : 1; 1311 /** VMX: Supports conceal VMX from PT. */ 1312 uint32_t fVmxConcealVmxFromPt : 1; 1311 1313 /** VMX: Supports XSAVES/XRSTORS. */ 1312 1314 uint32_t fVmxXsavesXrstors : 1; 1315 /** VMX: Supports mode-based execute control for EPT. */ 1316 uint32_t fVmxModeBasedExecuteEpt : 1; 1317 /** VMX: Supports sub-page write permissions for EPT. */ 1318 uint32_t fVmxSppEpt : 1; 1319 /** VMX: Supports Intel PT to output guest-physical addresses for EPT. */ 1320 uint32_t fVmxPtEpt : 1; 1313 1321 /** VMX: Supports TSC scaling. */ 1314 1322 uint32_t fVmxUseTscScaling : 1; 1323 /** VMX: Supports TPAUSE, UMONITOR, or UMWAIT. */ 1324 uint32_t fVmxUserWaitPause : 1; 1325 /** VMX: Supports enclave (ENCLV) exiting. */ 1326 uint32_t fVmxEnclvExit : 1; 1315 1327 /** @} */ 1316 1328 … … 1358 1370 uint32_t fVmxExitSaveEferLma : 1; 1359 1371 /** VMX: Whether Intel PT (Processor Trace) is supported in VMX mode or not. */ 1360 uint32_t fVmx IntelPt : 1;1372 uint32_t fVmxPt : 1; 1361 1373 /** VMX: Supports VMWRITE to any valid VMCS field incl. read-only fields, otherwise 1362 1374 * VMWRITE cannot modify read-only VM-exit information fields. */ … … 1368 1380 1369 1381 /** VMX: Padding / reserved for future features. */ 1370 uint32_t fVmxPadding1 : 31;1382 uint32_t fVmxPadding1 : 25; 1371 1383 } CPUMFEATURES; 1372 1384 #ifndef VBOX_FOR_DTRACE_LIB … … 1584 1596 VMM_INT_DECL(int) CPUMStopGuestVmxPremptTimer(PVMCPUCC pVCpu); 1585 1597 VMM_INT_DECL(uint32_t) CPUMGetVmxMsrPermission(void const *pvMsrBitmap, uint32_t idMsr); 1598 VMM_INT_DECL(bool) CPUMIsGuestVmxEptPagingEnabled(PCVMCPUCC pVCpu); 1586 1599 /** @} */ 1587 1600 -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r91580 r91710 3033 3033 } 3034 3034 3035 3036 /** 3037 * Checks whether the guest is in VMX non-root mode and using EPT paging. 3038 * 3039 * @returns @c true if in VMX non-root operation with EPT, @c false otherwise. 3040 * @param pVCpu The cross context virtual CPU structure. 3041 */ 3042 VMM_INT_DECL(bool) CPUMIsGuestVmxEptPagingEnabled(PCVMCPUCC pVCpu) 3043 { 3044 return CPUMIsGuestInVmxNonRootMode(&pVCpu->cpum.s.Guest) 3045 && CPUMIsGuestVmxProcCtls2Set(&pVCpu->cpum.s.Guest, VMX_PROC_CTLS2_EPT); 3046 } 3047 -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r91358 r91710 1153 1153 /* Basic. */ 1154 1154 VMXFEATDUMP("InsOutInfo - INS/OUTS instruction info. ", fVmxInsOutInfo); 1155 1155 1156 /* Pin-based controls. */ 1156 1157 VMXFEATDUMP("ExtIntExit - External interrupt exiting ", fVmxExtIntExit); … … 1159 1160 VMXFEATDUMP("PreemptTimer - VMX preemption timer ", fVmxPreemptTimer); 1160 1161 VMXFEATDUMP("PostedInt - Posted interrupts ", fVmxPostedInt); 1162 1161 1163 /* Processor-based controls. */ 1162 1164 VMXFEATDUMP("IntWindowExit - Interrupt-window exiting ", fVmxIntWindowExit); … … 1169 1171 VMXFEATDUMP("Cr3LoadExit - CR3-load exiting ", fVmxCr3LoadExit); 1170 1172 VMXFEATDUMP("Cr3StoreExit - CR3-store exiting ", fVmxCr3StoreExit); 1173 VMXFEATDUMP("TertiaryExecCtls - Activate tertiary controls ", fVmxTertiaryExecCtls); 1171 1174 VMXFEATDUMP("Cr8LoadExit - CR8-load exiting ", fVmxCr8LoadExit); 1172 1175 VMXFEATDUMP("Cr8StoreExit - CR8-store exiting ", fVmxCr8StoreExit); … … 1181 1184 VMXFEATDUMP("PauseExit - PAUSE exiting ", fVmxPauseExit); 1182 1185 VMXFEATDUMP("SecondaryExecCtl - Activate secondary controls ", fVmxSecondaryExecCtls); 1186 1183 1187 /* Secondary processor-based controls. */ 1184 1188 VMXFEATDUMP("VirtApic - Virtualize-APIC accesses ", fVmxVirtApicAccess); … … 1200 1204 VMXFEATDUMP("PML - Page-Modification Log (PML) ", fVmxPml); 1201 1205 VMXFEATDUMP("EptVe - EPT violations can cause #VE ", fVmxEptXcptVe); 1206 VMXFEATDUMP("ConcealVmxFromPt - Conceal VMX from Processor Trace ", fVmxConcealVmxFromPt); 1202 1207 VMXFEATDUMP("XsavesXRstors - Enable XSAVES/XRSTORS ", fVmxXsavesXrstors); 1208 VMXFEATDUMP("ModeBasedExecuteEpt - Mode-based execute permissions ", fVmxModeBasedExecuteEpt); 1209 VMXFEATDUMP("SppEpt - Sub-page page write permissions for EPT ", fVmxSppEpt); 1210 VMXFEATDUMP("PtEpt - Processor Trace address' translatable by EPT ", fVmxPtEpt); 1211 VMXFEATDUMP("UseTscScaling - Use TSC scaling ", fVmxUseTscScaling); 1212 VMXFEATDUMP("UserWaitPause - Enable TPAUSE, UMONITOR and UMWAIT ", fVmxUserWaitPause); 1213 VMXFEATDUMP("EnclvExit - ENCLV exiting ", fVmxEnclvExit); 1214 1215 /* Tertiary processor-based controls. */ 1216 VMXFEATDUMP("LoadIwKeyExit - LOADIWKEY exiting ", fVmxLoadIwKeyExit); 1217 1203 1218 /* VM-entry controls. */ 1204 1219 VMXFEATDUMP("EntryLoadDebugCtls - Load debug controls on VM-entry ", fVmxEntryLoadDebugCtls); … … 1206 1221 VMXFEATDUMP("EntryLoadEferMsr - Load IA32_EFER MSR on VM-entry ", fVmxEntryLoadEferMsr); 1207 1222 VMXFEATDUMP("EntryLoadPatMsr - Load IA32_PAT MSR on VM-entry ", fVmxEntryLoadPatMsr); 1223 1208 1224 /* VM-exit controls. */ 1209 1225 VMXFEATDUMP("ExitSaveDebugCtls - Save debug controls on VM-exit ", fVmxExitSaveDebugCtls); … … 1215 1231 VMXFEATDUMP("ExitLoadEferMsr - Load IA32_EFER MSR on VM-exit ", fVmxExitLoadEferMsr); 1216 1232 VMXFEATDUMP("SavePreemptTimer - Save VMX-preemption timer ", fVmxSavePreemptTimer); 1233 1217 1234 /* Miscellaneous data. */ 1218 1235 VMXFEATDUMP("ExitSaveEferLma - Save IA32_EFER.LMA on VM-exit ", fVmxExitSaveEferLma); 1219 VMXFEATDUMP("IntelPt - Intel PT (Processor Trace) in VMX operation ", fVmx IntelPt);1236 VMXFEATDUMP("IntelPt - Intel PT (Processor Trace) in VMX operation ", fVmxPt); 1220 1237 VMXFEATDUMP("VmwriteAll - VMWRITE to any supported VMCS field ", fVmxVmwriteAll); 1221 1238 VMXFEATDUMP("EntryInjectSoftInt - Inject softint. with 0-len instr. ", fVmxEntryInjectSoftInt); … … 1337 1354 if (pGuestFeatures->fVmxSecondaryExecCtls) 1338 1355 { 1339 uint32_t const fFeatures = (pGuestFeatures->fVmxVirtApicAccess << VMX_BF_PROC_CTLS2_VIRT_APIC_ACCESS_SHIFT ) 1340 | (pGuestFeatures->fVmxEpt << VMX_BF_PROC_CTLS2_EPT_SHIFT ) 1341 | (pGuestFeatures->fVmxDescTableExit << VMX_BF_PROC_CTLS2_DESC_TABLE_EXIT_SHIFT ) 1342 | (pGuestFeatures->fVmxRdtscp << VMX_BF_PROC_CTLS2_RDTSCP_SHIFT ) 1343 | (pGuestFeatures->fVmxVirtX2ApicMode << VMX_BF_PROC_CTLS2_VIRT_X2APIC_MODE_SHIFT ) 1344 | (pGuestFeatures->fVmxVpid << VMX_BF_PROC_CTLS2_VPID_SHIFT ) 1345 | (pGuestFeatures->fVmxWbinvdExit << VMX_BF_PROC_CTLS2_WBINVD_EXIT_SHIFT ) 1346 | (pGuestFeatures->fVmxUnrestrictedGuest << VMX_BF_PROC_CTLS2_UNRESTRICTED_GUEST_SHIFT) 1347 | (pGuestFeatures->fVmxApicRegVirt << VMX_BF_PROC_CTLS2_APIC_REG_VIRT_SHIFT ) 1348 | (pGuestFeatures->fVmxVirtIntDelivery << VMX_BF_PROC_CTLS2_VIRT_INT_DELIVERY_SHIFT ) 1349 | (pGuestFeatures->fVmxPauseLoopExit << VMX_BF_PROC_CTLS2_PAUSE_LOOP_EXIT_SHIFT ) 1350 | (pGuestFeatures->fVmxRdrandExit << VMX_BF_PROC_CTLS2_RDRAND_EXIT_SHIFT ) 1351 | (pGuestFeatures->fVmxInvpcid << VMX_BF_PROC_CTLS2_INVPCID_SHIFT ) 1352 | (pGuestFeatures->fVmxVmFunc << VMX_BF_PROC_CTLS2_VMFUNC_SHIFT ) 1353 | (pGuestFeatures->fVmxVmcsShadowing << VMX_BF_PROC_CTLS2_VMCS_SHADOWING_SHIFT ) 1354 | (pGuestFeatures->fVmxRdseedExit << VMX_BF_PROC_CTLS2_RDSEED_EXIT_SHIFT ) 1355 | (pGuestFeatures->fVmxPml << VMX_BF_PROC_CTLS2_PML_SHIFT ) 1356 | (pGuestFeatures->fVmxEptXcptVe << VMX_BF_PROC_CTLS2_EPT_VE_SHIFT ) 1357 | (pGuestFeatures->fVmxXsavesXrstors << VMX_BF_PROC_CTLS2_XSAVES_XRSTORS_SHIFT ) 1358 | (pGuestFeatures->fVmxUseTscScaling << VMX_BF_PROC_CTLS2_TSC_SCALING_SHIFT ); 1356 uint32_t const fFeatures = (pGuestFeatures->fVmxVirtApicAccess << VMX_BF_PROC_CTLS2_VIRT_APIC_ACCESS_SHIFT ) 1357 | (pGuestFeatures->fVmxEpt << VMX_BF_PROC_CTLS2_EPT_SHIFT ) 1358 | (pGuestFeatures->fVmxDescTableExit << VMX_BF_PROC_CTLS2_DESC_TABLE_EXIT_SHIFT ) 1359 | (pGuestFeatures->fVmxRdtscp << VMX_BF_PROC_CTLS2_RDTSCP_SHIFT ) 1360 | (pGuestFeatures->fVmxVirtX2ApicMode << VMX_BF_PROC_CTLS2_VIRT_X2APIC_MODE_SHIFT ) 1361 | (pGuestFeatures->fVmxVpid << VMX_BF_PROC_CTLS2_VPID_SHIFT ) 1362 | (pGuestFeatures->fVmxWbinvdExit << VMX_BF_PROC_CTLS2_WBINVD_EXIT_SHIFT ) 1363 | (pGuestFeatures->fVmxUnrestrictedGuest << VMX_BF_PROC_CTLS2_UNRESTRICTED_GUEST_SHIFT ) 1364 | (pGuestFeatures->fVmxApicRegVirt << VMX_BF_PROC_CTLS2_APIC_REG_VIRT_SHIFT ) 1365 | (pGuestFeatures->fVmxVirtIntDelivery << VMX_BF_PROC_CTLS2_VIRT_INT_DELIVERY_SHIFT ) 1366 | (pGuestFeatures->fVmxPauseLoopExit << VMX_BF_PROC_CTLS2_PAUSE_LOOP_EXIT_SHIFT ) 1367 | (pGuestFeatures->fVmxRdrandExit << VMX_BF_PROC_CTLS2_RDRAND_EXIT_SHIFT ) 1368 | (pGuestFeatures->fVmxInvpcid << VMX_BF_PROC_CTLS2_INVPCID_SHIFT ) 1369 | (pGuestFeatures->fVmxVmFunc << VMX_BF_PROC_CTLS2_VMFUNC_SHIFT ) 1370 | (pGuestFeatures->fVmxVmcsShadowing << VMX_BF_PROC_CTLS2_VMCS_SHADOWING_SHIFT ) 1371 | (pGuestFeatures->fVmxRdseedExit << VMX_BF_PROC_CTLS2_RDSEED_EXIT_SHIFT ) 1372 | (pGuestFeatures->fVmxPml << VMX_BF_PROC_CTLS2_PML_SHIFT ) 1373 | (pGuestFeatures->fVmxEptXcptVe << VMX_BF_PROC_CTLS2_EPT_VE_SHIFT ) 1374 | (pGuestFeatures->fVmxConcealVmxFromPt << VMX_BF_PROC_CTLS2_CONCEAL_VMX_FROM_PT_SHIFT) 1375 | (pGuestFeatures->fVmxXsavesXrstors << VMX_BF_PROC_CTLS2_XSAVES_XRSTORS_SHIFT ) 1376 | (pGuestFeatures->fVmxModeBasedExecuteEpt << VMX_BF_PROC_CTLS2_MODE_BASED_EPT_PERM_SHIFT) 1377 | (pGuestFeatures->fVmxSppEpt << VMX_BF_PROC_CTLS2_SPP_EPT_SHIFT ) 1378 | (pGuestFeatures->fVmxPtEpt << VMX_BF_PROC_CTLS2_PT_EPT_SHIFT ) 1379 | (pGuestFeatures->fVmxUseTscScaling << VMX_BF_PROC_CTLS2_TSC_SCALING_SHIFT ) 1380 | (pGuestFeatures->fVmxUserWaitPause << VMX_BF_PROC_CTLS2_USER_WAIT_PAUSE_SHIFT ) 1381 | (pGuestFeatures->fVmxEnclvExit << VMX_BF_PROC_CTLS2_ENCLV_EXIT_SHIFT ); 1359 1382 uint32_t const fAllowed0 = 0; 1360 1383 uint32_t const fAllowed1 = fFeatures; … … 1408 1431 | RT_BF_MAKE(VMX_BF_MISC_EXIT_SAVE_EFER_LMA, pGuestFeatures->fVmxExitSaveEferLma ) 1409 1432 | RT_BF_MAKE(VMX_BF_MISC_ACTIVITY_STATES, fActivityState ) 1410 | RT_BF_MAKE(VMX_BF_MISC_INTEL_PT, pGuestFeatures->fVmx IntelPt)1433 | RT_BF_MAKE(VMX_BF_MISC_INTEL_PT, pGuestFeatures->fVmxPt ) 1411 1434 | RT_BF_MAKE(VMX_BF_MISC_SMM_READ_SMBASE_MSR, 0 ) 1412 1435 | RT_BF_MAKE(VMX_BF_MISC_CR3_TARGET, VMX_V_CR3_TARGET_COUNT ) … … 1515 1538 return false; 1516 1539 1540 #define CPUM_VMX_FEAT_SHIFT(a_pFeat, a_FeatName, a_cShift) ((uint64_t)(a_pFeat->a_FeatName) << (a_cShift)) 1541 #define CPUM_VMX_MAKE_FEATURES_1(a_pFeat) ( CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxInsOutInfo , 0) \ 1542 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxExtIntExit , 1) \ 1543 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxNmiExit , 2) \ 1544 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxVirtNmi , 3) \ 1545 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxPreemptTimer , 4) \ 1546 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxPostedInt , 5) \ 1547 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxIntWindowExit , 6) \ 1548 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxTscOffsetting , 7) \ 1549 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxHltExit , 8) \ 1550 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxInvlpgExit , 9) \ 1551 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxMwaitExit , 10) \ 1552 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxRdpmcExit , 12) \ 1553 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxRdtscExit , 13) \ 1554 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxCr3LoadExit , 14) \ 1555 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxCr3StoreExit , 15) \ 1556 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxTertiaryExecCtls , 16) \ 1557 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxCr8LoadExit , 17) \ 1558 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxCr8StoreExit , 18) \ 1559 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxUseTprShadow , 19) \ 1560 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxNmiWindowExit , 20) \ 1561 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxMovDRxExit , 21) \ 1562 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxUncondIoExit , 22) \ 1563 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxUseIoBitmaps , 23) \ 1564 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxMonitorTrapFlag , 24) \ 1565 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxUseMsrBitmaps , 25) \ 1566 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxMonitorExit , 26) \ 1567 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxPauseExit , 27) \ 1568 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxSecondaryExecCtls , 28) \ 1569 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxVirtApicAccess , 29) \ 1570 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxEpt , 30) \ 1571 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxDescTableExit , 31) \ 1572 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxRdtscp , 32) \ 1573 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxVirtX2ApicMode , 33) \ 1574 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxVpid , 34) \ 1575 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxWbinvdExit , 35) \ 1576 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxUnrestrictedGuest , 36) \ 1577 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxApicRegVirt , 37) \ 1578 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxVirtIntDelivery , 38) \ 1579 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxPauseLoopExit , 39) \ 1580 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxRdrandExit , 40) \ 1581 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxInvpcid , 41) \ 1582 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxVmFunc , 42) \ 1583 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxVmcsShadowing , 43) \ 1584 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxRdseedExit , 44) \ 1585 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxPml , 45) \ 1586 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxEptXcptVe , 46) \ 1587 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxConcealVmxFromPt , 47) \ 1588 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxXsavesXrstors , 48) \ 1589 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxModeBasedExecuteEpt, 49) \ 1590 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxSppEpt , 50) \ 1591 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxPtEpt , 51) \ 1592 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxUseTscScaling , 52) \ 1593 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxUserWaitPause , 53) \ 1594 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxEnclvExit , 54) \ 1595 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxLoadIwKeyExit , 55) \ 1596 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxEntryLoadDebugCtls , 56) \ 1597 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxIa32eModeGuest , 57) \ 1598 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxEntryLoadEferMsr , 58) \ 1599 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxEntryLoadPatMsr , 59) \ 1600 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxExitSaveDebugCtls , 60) \ 1601 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxHostAddrSpaceSize , 61) \ 1602 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxExitAckExtInt , 62) \ 1603 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxExitSavePatMsr , 63)) 1604 1605 #define CPUM_VMX_MAKE_FEATURES_2(a_pFeat) ( CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxExitLoadPatMsr , 0) \ 1606 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxExitSaveEferMsr , 1) \ 1607 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxExitLoadEferMsr , 2) \ 1608 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxSavePreemptTimer , 3) \ 1609 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxExitSaveEferLma , 4) \ 1610 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxPt , 5) \ 1611 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxVmwriteAll , 6) \ 1612 | CPUM_VMX_FEAT_SHIFT(a_pFeat, fVmxEntryInjectSoftInt , 7)) 1613 1517 1614 /* Check first set of feature bits. */ 1518 1615 { 1519 uint64_t const fBase = ((uint64_t)pBase->fVmxInsOutInfo << 0) | ((uint64_t)pBase->fVmxExtIntExit << 1) 1520 | ((uint64_t)pBase->fVmxNmiExit << 2) | ((uint64_t)pBase->fVmxVirtNmi << 3) 1521 | ((uint64_t)pBase->fVmxPreemptTimer << 4) | ((uint64_t)pBase->fVmxPostedInt << 5) 1522 | ((uint64_t)pBase->fVmxIntWindowExit << 6) | ((uint64_t)pBase->fVmxTscOffsetting << 7) 1523 | ((uint64_t)pBase->fVmxHltExit << 8) | ((uint64_t)pBase->fVmxInvlpgExit << 9) 1524 | ((uint64_t)pBase->fVmxMwaitExit << 10) | ((uint64_t)pBase->fVmxRdpmcExit << 11) 1525 | ((uint64_t)pBase->fVmxRdtscExit << 12) | ((uint64_t)pBase->fVmxCr3LoadExit << 13) 1526 | ((uint64_t)pBase->fVmxCr3StoreExit << 14) | ((uint64_t)pBase->fVmxCr8LoadExit << 15) 1527 | ((uint64_t)pBase->fVmxCr8StoreExit << 16) | ((uint64_t)pBase->fVmxUseTprShadow << 17) 1528 | ((uint64_t)pBase->fVmxNmiWindowExit << 18) | ((uint64_t)pBase->fVmxMovDRxExit << 19) 1529 | ((uint64_t)pBase->fVmxUncondIoExit << 20) | ((uint64_t)pBase->fVmxUseIoBitmaps << 21) 1530 | ((uint64_t)pBase->fVmxMonitorTrapFlag << 22) | ((uint64_t)pBase->fVmxUseMsrBitmaps << 23) 1531 | ((uint64_t)pBase->fVmxMonitorExit << 24) | ((uint64_t)pBase->fVmxPauseExit << 25) 1532 | ((uint64_t)pBase->fVmxSecondaryExecCtls << 26) | ((uint64_t)pBase->fVmxVirtApicAccess << 27) 1533 | ((uint64_t)pBase->fVmxEpt << 28) | ((uint64_t)pBase->fVmxDescTableExit << 29) 1534 | ((uint64_t)pBase->fVmxRdtscp << 30) | ((uint64_t)pBase->fVmxVirtX2ApicMode << 31) 1535 | ((uint64_t)pBase->fVmxVpid << 32) | ((uint64_t)pBase->fVmxWbinvdExit << 33) 1536 | ((uint64_t)pBase->fVmxUnrestrictedGuest << 34) | ((uint64_t)pBase->fVmxApicRegVirt << 35) 1537 | ((uint64_t)pBase->fVmxVirtIntDelivery << 36) | ((uint64_t)pBase->fVmxPauseLoopExit << 37) 1538 | ((uint64_t)pBase->fVmxRdrandExit << 38) | ((uint64_t)pBase->fVmxInvpcid << 39) 1539 | ((uint64_t)pBase->fVmxVmFunc << 40) | ((uint64_t)pBase->fVmxVmcsShadowing << 41) 1540 | ((uint64_t)pBase->fVmxRdseedExit << 42) | ((uint64_t)pBase->fVmxPml << 43) 1541 | ((uint64_t)pBase->fVmxEptXcptVe << 44) | ((uint64_t)pBase->fVmxXsavesXrstors << 45) 1542 | ((uint64_t)pBase->fVmxUseTscScaling << 46) | ((uint64_t)pBase->fVmxEntryLoadDebugCtls << 47) 1543 | ((uint64_t)pBase->fVmxIa32eModeGuest << 48) | ((uint64_t)pBase->fVmxEntryLoadEferMsr << 49) 1544 | ((uint64_t)pBase->fVmxEntryLoadPatMsr << 50) | ((uint64_t)pBase->fVmxExitSaveDebugCtls << 51) 1545 | ((uint64_t)pBase->fVmxHostAddrSpaceSize << 52) | ((uint64_t)pBase->fVmxExitAckExtInt << 53) 1546 | ((uint64_t)pBase->fVmxExitSavePatMsr << 54) | ((uint64_t)pBase->fVmxExitLoadPatMsr << 55) 1547 | ((uint64_t)pBase->fVmxExitSaveEferMsr << 56) | ((uint64_t)pBase->fVmxExitLoadEferMsr << 57) 1548 | ((uint64_t)pBase->fVmxSavePreemptTimer << 58) | ((uint64_t)pBase->fVmxExitSaveEferLma << 59) 1549 | ((uint64_t)pBase->fVmxIntelPt << 60) | ((uint64_t)pBase->fVmxVmwriteAll << 61) 1550 | ((uint64_t)pBase->fVmxEntryInjectSoftInt << 62); 1551 1552 uint64_t const fGst = ((uint64_t)pGst->fVmxInsOutInfo << 0) | ((uint64_t)pGst->fVmxExtIntExit << 1) 1553 | ((uint64_t)pGst->fVmxNmiExit << 2) | ((uint64_t)pGst->fVmxVirtNmi << 3) 1554 | ((uint64_t)pGst->fVmxPreemptTimer << 4) | ((uint64_t)pGst->fVmxPostedInt << 5) 1555 | ((uint64_t)pGst->fVmxIntWindowExit << 6) | ((uint64_t)pGst->fVmxTscOffsetting << 7) 1556 | ((uint64_t)pGst->fVmxHltExit << 8) | ((uint64_t)pGst->fVmxInvlpgExit << 9) 1557 | ((uint64_t)pGst->fVmxMwaitExit << 10) | ((uint64_t)pGst->fVmxRdpmcExit << 11) 1558 | ((uint64_t)pGst->fVmxRdtscExit << 12) | ((uint64_t)pGst->fVmxCr3LoadExit << 13) 1559 | ((uint64_t)pGst->fVmxCr3StoreExit << 14) | ((uint64_t)pGst->fVmxCr8LoadExit << 15) 1560 | ((uint64_t)pGst->fVmxCr8StoreExit << 16) | ((uint64_t)pGst->fVmxUseTprShadow << 17) 1561 | ((uint64_t)pGst->fVmxNmiWindowExit << 18) | ((uint64_t)pGst->fVmxMovDRxExit << 19) 1562 | ((uint64_t)pGst->fVmxUncondIoExit << 20) | ((uint64_t)pGst->fVmxUseIoBitmaps << 21) 1563 | ((uint64_t)pGst->fVmxMonitorTrapFlag << 22) | ((uint64_t)pGst->fVmxUseMsrBitmaps << 23) 1564 | ((uint64_t)pGst->fVmxMonitorExit << 24) | ((uint64_t)pGst->fVmxPauseExit << 25) 1565 | ((uint64_t)pGst->fVmxSecondaryExecCtls << 26) | ((uint64_t)pGst->fVmxVirtApicAccess << 27) 1566 | ((uint64_t)pGst->fVmxEpt << 28) | ((uint64_t)pGst->fVmxDescTableExit << 29) 1567 | ((uint64_t)pGst->fVmxRdtscp << 30) | ((uint64_t)pGst->fVmxVirtX2ApicMode << 31) 1568 | ((uint64_t)pGst->fVmxVpid << 32) | ((uint64_t)pGst->fVmxWbinvdExit << 33) 1569 | ((uint64_t)pGst->fVmxUnrestrictedGuest << 34) | ((uint64_t)pGst->fVmxApicRegVirt << 35) 1570 | ((uint64_t)pGst->fVmxVirtIntDelivery << 36) | ((uint64_t)pGst->fVmxPauseLoopExit << 37) 1571 | ((uint64_t)pGst->fVmxRdrandExit << 38) | ((uint64_t)pGst->fVmxInvpcid << 39) 1572 | ((uint64_t)pGst->fVmxVmFunc << 40) | ((uint64_t)pGst->fVmxVmcsShadowing << 41) 1573 | ((uint64_t)pGst->fVmxRdseedExit << 42) | ((uint64_t)pGst->fVmxPml << 43) 1574 | ((uint64_t)pGst->fVmxEptXcptVe << 44) | ((uint64_t)pGst->fVmxXsavesXrstors << 45) 1575 | ((uint64_t)pGst->fVmxUseTscScaling << 46) | ((uint64_t)pGst->fVmxEntryLoadDebugCtls << 47) 1576 | ((uint64_t)pGst->fVmxIa32eModeGuest << 48) | ((uint64_t)pGst->fVmxEntryLoadEferMsr << 49) 1577 | ((uint64_t)pGst->fVmxEntryLoadPatMsr << 50) | ((uint64_t)pGst->fVmxExitSaveDebugCtls << 51) 1578 | ((uint64_t)pGst->fVmxHostAddrSpaceSize << 52) | ((uint64_t)pGst->fVmxExitAckExtInt << 53) 1579 | ((uint64_t)pGst->fVmxExitSavePatMsr << 54) | ((uint64_t)pGst->fVmxExitLoadPatMsr << 55) 1580 | ((uint64_t)pGst->fVmxExitSaveEferMsr << 56) | ((uint64_t)pGst->fVmxExitLoadEferMsr << 57) 1581 | ((uint64_t)pGst->fVmxSavePreemptTimer << 58) | ((uint64_t)pGst->fVmxExitSaveEferLma << 59) 1582 | ((uint64_t)pGst->fVmxIntelPt << 60) | ((uint64_t)pGst->fVmxVmwriteAll << 61) 1583 | ((uint64_t)pGst->fVmxEntryInjectSoftInt << 62); 1584 1616 uint64_t const fBase = CPUM_VMX_MAKE_FEATURES_1(pBase); 1617 uint64_t const fGst = CPUM_VMX_MAKE_FEATURES_1(pGst); 1585 1618 if ((fBase | fGst) != fBase) 1586 1619 { … … 1594 1627 /* Check second set of feature bits. */ 1595 1628 { 1596 uint64_t const fBase = ((uint64_t)pBase->fVmxTertiaryExecCtls << 0) | ((uint64_t)pBase->fVmxLoadIwKeyExit << 1);1597 uint64_t const fGst = ((uint64_t)pGst->fVmxTertiaryExecCtls << 0) | ((uint64_t)pGst->fVmxLoadIwKeyExit << 1);1629 uint64_t const fBase = CPUM_VMX_MAKE_FEATURES_2(pBase); 1630 uint64_t const fGst = CPUM_VMX_MAKE_FEATURES_2(pGst); 1598 1631 if ((fBase | fGst) != fBase) 1599 1632 { … … 1604 1637 } 1605 1638 } 1639 #undef CPUM_VMX_FEAT_SHIFT 1640 #undef CPUM_VMX_MAKE_FEATURES_1 1641 #undef CPUM_VMX_MAKE_FEATURES_2 1606 1642 1607 1643 return true; … … 1690 1726 EmuFeat.fVmxPml = 0; 1691 1727 EmuFeat.fVmxEptXcptVe = 0; 1728 EmuFeat.fVmxConcealVmxFromPt = 0; 1692 1729 EmuFeat.fVmxXsavesXrstors = 0; 1730 EmuFeat.fVmxModeBasedExecuteEpt = 0; 1731 EmuFeat.fVmxSppEpt = 0; 1732 EmuFeat.fVmxPtEpt = 0; 1693 1733 EmuFeat.fVmxUseTscScaling = 0; 1734 EmuFeat.fVmxUserWaitPause = 0; 1735 EmuFeat.fVmxEnclvExit = 0; 1694 1736 EmuFeat.fVmxLoadIwKeyExit = 0; 1695 1737 EmuFeat.fVmxEntryLoadDebugCtls = 1; … … 1706 1748 EmuFeat.fVmxSavePreemptTimer = 0; /* Cannot be enabled if VMX-preemption timer is disabled. */ 1707 1749 EmuFeat.fVmxExitSaveEferLma = 1; /* Cannot be disabled if unrestricted guest is enabled. */ 1708 EmuFeat.fVmx IntelPt= 0;1750 EmuFeat.fVmxPt = 0; 1709 1751 EmuFeat.fVmxVmwriteAll = 0; /** @todo NSTVMX: enable this when nested VMCS shadowing is enabled. */ 1710 1752 EmuFeat.fVmxEntryInjectSoftInt = 1; … … 1765 1807 pGuestFeat->fVmxPml = (pBaseFeat->fVmxPml & EmuFeat.fVmxPml ); 1766 1808 pGuestFeat->fVmxEptXcptVe = (pBaseFeat->fVmxEptXcptVe & EmuFeat.fVmxEptXcptVe ); 1809 pGuestFeat->fVmxConcealVmxFromPt = (pBaseFeat->fVmxConcealVmxFromPt & EmuFeat.fVmxConcealVmxFromPt ); 1767 1810 pGuestFeat->fVmxXsavesXrstors = (pBaseFeat->fVmxXsavesXrstors & EmuFeat.fVmxXsavesXrstors ); 1811 pGuestFeat->fVmxModeBasedExecuteEpt = (pBaseFeat->fVmxModeBasedExecuteEpt & EmuFeat.fVmxModeBasedExecuteEpt ); 1812 pGuestFeat->fVmxSppEpt = (pBaseFeat->fVmxSppEpt & EmuFeat.fVmxSppEpt ); 1813 pGuestFeat->fVmxPtEpt = (pBaseFeat->fVmxPtEpt & EmuFeat.fVmxPtEpt ); 1768 1814 pGuestFeat->fVmxUseTscScaling = (pBaseFeat->fVmxUseTscScaling & EmuFeat.fVmxUseTscScaling ); 1815 pGuestFeat->fVmxUserWaitPause = (pBaseFeat->fVmxUserWaitPause & EmuFeat.fVmxUserWaitPause ); 1816 pGuestFeat->fVmxEnclvExit = (pBaseFeat->fVmxEnclvExit & EmuFeat.fVmxEnclvExit ); 1769 1817 pGuestFeat->fVmxLoadIwKeyExit = (pBaseFeat->fVmxLoadIwKeyExit & EmuFeat.fVmxLoadIwKeyExit ); 1770 1818 pGuestFeat->fVmxEntryLoadDebugCtls = (pBaseFeat->fVmxEntryLoadDebugCtls & EmuFeat.fVmxEntryLoadDebugCtls ); … … 1781 1829 pGuestFeat->fVmxSavePreemptTimer = (pBaseFeat->fVmxSavePreemptTimer & EmuFeat.fVmxSavePreemptTimer ); 1782 1830 pGuestFeat->fVmxExitSaveEferLma = (pBaseFeat->fVmxExitSaveEferLma & EmuFeat.fVmxExitSaveEferLma ); 1783 pGuestFeat->fVmx IntelPt = (pBaseFeat->fVmxIntelPt & EmuFeat.fVmxIntelPt);1831 pGuestFeat->fVmxPt = (pBaseFeat->fVmxPt & EmuFeat.fVmxPt ); 1784 1832 pGuestFeat->fVmxVmwriteAll = (pBaseFeat->fVmxVmwriteAll & EmuFeat.fVmxVmwriteAll ); 1785 1833 pGuestFeat->fVmxEntryInjectSoftInt = (pBaseFeat->fVmxEntryInjectSoftInt & EmuFeat.fVmxEntryInjectSoftInt ); … … 1815 1863 Assert(!pGuestFeat->fVmxPml); 1816 1864 Assert(!pGuestFeat->fVmxEptXcptVe); 1865 Assert(!pGuestFeat->fVmxConcealVmxFromPt); 1817 1866 Assert(!pGuestFeat->fVmxXsavesXrstors); 1867 Assert(!pGuestFeat->fVmxModeBasedExecuteEpt); 1868 Assert(!pGuestFeat->fVmxSppEpt); 1869 Assert(!pGuestFeat->fVmxPtEpt); 1818 1870 Assert(!pGuestFeat->fVmxUseTscScaling); 1871 Assert(!pGuestFeat->fVmxUserWaitPause); 1872 Assert(!pGuestFeat->fVmxEnclvExit); 1819 1873 } 1820 1874 else if (pGuestFeat->fVmxUnrestrictedGuest) -
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r91604 r91710 1807 1807 pFeatures->fVmxPml = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_PML); 1808 1808 pFeatures->fVmxEptXcptVe = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_EPT_XCPT_VE); 1809 pFeatures->fVmxConcealVmxFromPt = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_CONCEAL_VMX_FROM_PT); 1809 1810 pFeatures->fVmxXsavesXrstors = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_XSAVES_XRSTORS); 1811 pFeatures->fVmxModeBasedExecuteEpt = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_MODE_BASED_EPT_PERM); 1812 pFeatures->fVmxSppEpt = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_SPP_EPT); 1813 pFeatures->fVmxPtEpt = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_PT_EPT); 1810 1814 pFeatures->fVmxUseTscScaling = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_TSC_SCALING); 1815 pFeatures->fVmxUserWaitPause = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_USER_WAIT_PAUSE); 1816 pFeatures->fVmxEnclvExit = RT_BOOL(fProcCtls2 & VMX_PROC_CTLS2_ENCLV_EXIT); 1811 1817 } 1812 1818 … … 1843 1849 uint32_t const fMiscData = pVmxMsrs->u64Misc; 1844 1850 pFeatures->fVmxExitSaveEferLma = RT_BOOL(fMiscData & VMX_MISC_EXIT_SAVE_EFER_LMA); 1845 pFeatures->fVmx IntelPt= RT_BOOL(fMiscData & VMX_MISC_INTEL_PT);1851 pFeatures->fVmxPt = RT_BOOL(fMiscData & VMX_MISC_INTEL_PT); 1846 1852 pFeatures->fVmxVmwriteAll = RT_BOOL(fMiscData & VMX_MISC_VMWRITE_ALL); 1847 1853 pFeatures->fVmxEntryInjectSoftInt = RT_BOOL(fMiscData & VMX_MISC_ENTRY_INJECT_SOFT_INT);
Note:
See TracChangeset
for help on using the changeset viewer.