- Timestamp:
- Oct 7, 2018 6:20:55 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r74632 r74648 1268 1268 /** @name VMX Miscellaneous data. 1269 1269 * @{ */ 1270 /** VMX: Supports storing EFER.LMA on VM-exits into IA32e-mode guest field. */ 1271 uint32_t fVmxExitStoreEferLma : 1; 1270 /** VMX: Supports storing EFER.LMA into IA32e-mode guest field on VM-exit. */ 1271 uint32_t fVmxExitSaveEferLma : 1; 1272 /** VMX: Whether Intel PT (Processor Trace) is supported in VMX mode or not. */ 1273 uint32_t fVmxIntelPt : 1; 1272 1274 /** VMX: Supports VMWRITE to any valid VMCS field incl. read-only fields, otherwise 1273 1275 * VMWRITE cannot modify read-only VM-exit information fields. */ … … 1279 1281 1280 1282 /** VMX: Padding / reserved for future features. */ 1281 uint32_t fVmxPadding1 : 2;1283 uint32_t fVmxPadding1 : 1; 1282 1284 uint32_t fVmxPadding2; 1283 1285 } CPUMFEATURES; -
trunk/include/VBox/vmm/hm_vmx.h
r74604 r74648 1457 1457 */ 1458 1458 /** Whether VM-exit stores EFER.LMA into the "IA32e mode guest" field. */ 1459 #define VMX_MISC_EXIT_STORE_EFER_LMA RT_BIT(5) 1459 #define VMX_MISC_EXIT_SAVE_EFER_LMA RT_BIT(5) 1460 /** Whether Intel PT is supported in VMX operation. */ 1461 #define VMX_MISC_INTEL_PT RT_BIT(14) 1460 1462 /** Whether VMWRITE to any valid VMCS field incl. read-only fields, otherwise 1461 1463 * VMWRITE cannot modify read-only VM-exit information fields. */ … … 1472 1474 #define VMX_BF_MISC_PREEMPT_TIMER_TSC_MASK UINT64_C(0x000000000000001f) 1473 1475 /** Whether VM-exit stores EFER.LMA into the "IA32e mode guest" field. */ 1474 #define VMX_BF_MISC_EXIT_S TORE_EFER_LMA_SHIFT51475 #define VMX_BF_MISC_EXIT_S TORE_EFER_LMA_MASKUINT64_C(0x0000000000000020)1476 #define VMX_BF_MISC_EXIT_SAVE_EFER_LMA_SHIFT 5 1477 #define VMX_BF_MISC_EXIT_SAVE_EFER_LMA_MASK UINT64_C(0x0000000000000020) 1476 1478 /** Activity states supported by the implementation. */ 1477 1479 #define VMX_BF_MISC_ACTIVITY_STATES_SHIFT 6 … … 1481 1483 #define VMX_BF_MISC_RSVD_9_13_MASK UINT64_C(0x0000000000003e00) 1482 1484 /** Whether Intel PT (Processor Trace) can be used in VMX operation. */ 1483 #define VMX_BF_MISC_ PT_SHIFT141484 #define VMX_BF_MISC_ PT_MASKUINT64_C(0x0000000000004000)1485 #define VMX_BF_MISC_INTEL_PT_SHIFT 14 1486 #define VMX_BF_MISC_INTEL_PT_MASK UINT64_C(0x0000000000004000) 1485 1487 /** Whether RDMSR can be used to read IA32_SMBASE MSR in SMM. */ 1486 1488 #define VMX_BF_MISC_SMM_READ_SMBASE_MSR_SHIFT 15 … … 1511 1513 #define VMX_BF_MISC_MSEG_ID_MASK UINT64_C(0xffffffff00000000) 1512 1514 RT_BF_ASSERT_COMPILE_CHECKS(VMX_BF_MISC_, UINT64_C(0), UINT64_MAX, 1513 (PREEMPT_TIMER_TSC, EXIT_S TORE_EFER_LMA, ACTIVITY_STATES, RSVD_9_13,PT, SMM_READ_SMBASE_MSR,1515 (PREEMPT_TIMER_TSC, EXIT_SAVE_EFER_LMA, ACTIVITY_STATES, RSVD_9_13, INTEL_PT, SMM_READ_SMBASE_MSR, 1514 1516 CR3_TARGET, MAX_MSRS, VMXOFF_BLOCK_SMI, VMWRITE_ALL, ENTRY_INJECT_SOFT_INT, RSVD_31, MSEG_ID)); 1515 1517 /** @} */ -
trunk/include/iprt/x86.h
r74388 r74648 1449 1449 #define MSR_IA32_VMX_VMFUNC 0x491 1450 1450 1451 /** Intel PT - Enable and control for trace packet generation. */ 1452 #define MSR_IA32_RTIT_CTL 0x570 1451 1453 1452 1454 /** DS Save Area (R/W). */ -
trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp
r74392 r74648 1521 1521 uint8_t const cMaxMsrs = RT_MIN(RT_BF_GET(uHostMsr, VMX_BF_MISC_MAX_MSRS), VMX_V_AUTOMSR_COUNT_MAX); 1522 1522 uint8_t const fActivityState = RT_BF_GET(uHostMsr, VMX_BF_MISC_ACTIVITY_STATES) & VMX_V_GUEST_ACTIVITY_STATE_MASK; 1523 uVmxMsr = RT_BF_MAKE(VMX_BF_MISC_PREEMPT_TIMER_TSC, VMX_V_PREEMPT_TIMER_SHIFT)1524 | RT_BF_MAKE(VMX_BF_MISC_EXIT_S TORE_EFER_LMA, pGuestFeatures->fVmxExitStoreEferLma)1523 uVmxMsr = RT_BF_MAKE(VMX_BF_MISC_PREEMPT_TIMER_TSC, VMX_V_PREEMPT_TIMER_SHIFT ) 1524 | RT_BF_MAKE(VMX_BF_MISC_EXIT_SAVE_EFER_LMA, pGuestFeatures->fVmxExitSaveEferLma ) 1525 1525 | RT_BF_MAKE(VMX_BF_MISC_ACTIVITY_STATES, fActivityState ) 1526 | RT_BF_MAKE(VMX_BF_MISC_ PT, 0)1526 | RT_BF_MAKE(VMX_BF_MISC_INTEL_PT, pGuestFeatures->fVmxIntelPt ) 1527 1527 | RT_BF_MAKE(VMX_BF_MISC_SMM_READ_SMBASE_MSR, 0 ) 1528 1528 | RT_BF_MAKE(VMX_BF_MISC_CR3_TARGET, VMX_V_CR3_TARGET_COUNT ) -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r74633 r74648 6482 6482 */ 6483 6483 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX 6484 if ( IEM_VMX_IS_NON_ROOT_MODE(pVCpu) 6485 && iemVmxIsRdmsrWrmsrInterceptSet(pVCpu, VMX_EXIT_RDMSR, pVCpu->cpum.GstCtx.ecx)) 6486 IEM_VMX_VMEXIT_INSTR_RET(pVCpu, VMX_EXIT_RDMSR, cbInstr); 6484 if (IEM_VMX_IS_NON_ROOT_MODE(pVCpu)) 6485 { 6486 if (iemVmxIsRdmsrWrmsrInterceptSet(pVCpu, VMX_EXIT_RDMSR, pVCpu->cpum.GstCtx.ecx)) 6487 IEM_VMX_VMEXIT_INSTR_RET(pVCpu, VMX_EXIT_RDMSR, cbInstr); 6488 } 6487 6489 #endif 6488 6490 … … 6554 6556 return iemRaiseGeneralProtectionFault0(pVCpu); 6555 6557 6558 RTUINT64U uValue; 6559 uValue.s.Lo = pVCpu->cpum.GstCtx.eax; 6560 uValue.s.Hi = pVCpu->cpum.GstCtx.edx; 6561 6562 /** @todo make CPUMAllMsrs.cpp import the necessary MSR state. */ 6563 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_ALL_MSRS); 6564 6556 6565 /* 6557 6566 * Check nested-guest intercepts. 6558 6567 */ 6559 6568 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX 6560 if ( IEM_VMX_IS_NON_ROOT_MODE(pVCpu) 6561 && iemVmxIsRdmsrWrmsrInterceptSet(pVCpu, VMX_EXIT_WRMSR, pVCpu->cpum.GstCtx.ecx)) 6562 IEM_VMX_VMEXIT_INSTR_RET(pVCpu, VMX_EXIT_WRMSR, cbInstr); 6569 if (IEM_VMX_IS_NON_ROOT_MODE(pVCpu)) 6570 { 6571 if (iemVmxIsRdmsrWrmsrInterceptSet(pVCpu, VMX_EXIT_WRMSR, pVCpu->cpum.GstCtx.ecx)) 6572 IEM_VMX_VMEXIT_INSTR_RET(pVCpu, VMX_EXIT_WRMSR, cbInstr); 6573 6574 /* Check x2APIC MSRs first. */ 6575 if (IEM_VMX_IS_PROCCTLS2_SET(pVCpu, VMX_PROC_CTLS2_VIRT_X2APIC_MODE)) 6576 { 6577 switch (pVCpu->cpum.GstCtx.ecx) 6578 { 6579 case MSR_IA32_X2APIC_TPR: 6580 { 6581 if ( !uValue.s.Hi 6582 && !(uValue.s.Lo & UINT32_C(0xffffff00))) 6583 { 6584 uint32_t const uVTpr = (uValue.s.Lo & 0xf) << 4; 6585 iemVmxVirtApicWriteRaw32(pVCpu, uVTpr, XAPIC_OFF_TPR); 6586 VBOXSTRICTRC rcStrict = iemVmxVmexitTprVirtualization(pVCpu, cbInstr); 6587 if (rcStrict != VINF_VMX_INTERCEPT_NOT_ACTIVE) 6588 return rcStrict; 6589 return VINF_SUCCESS; 6590 } 6591 Log(("IEM: Invalid TPR MSR write -> #GP(0)\n", pVCpu->cpum.GstCtx.ecx, uValue.s.Hi, uValue.s.Lo)); 6592 return iemRaiseGeneralProtectionFault0(pVCpu); 6593 } 6594 6595 case MSR_IA32_X2APIC_EOI: 6596 case MSR_IA32_X2APIC_SELF_IPI: 6597 { 6598 /** @todo NSTVMX: EOI and Self-IPI virtualization. */ 6599 break; 6600 } 6601 } 6602 } 6603 else if (pVCpu->cpum.GstCtx.ecx == MSR_IA32_BIOS_UPDT_TRIG) 6604 { 6605 /** @todo NSTVMX: We must not allow any microcode updates in VMX non-root mode. 6606 * Since we don't implement this MSR anyway it's currently not a problem. 6607 * If we do, we should probably move this check to the MSR handler. */ 6608 } 6609 else if (pVCpu->cpum.GstCtx.ecx == MSR_IA32_RTIT_CTL) 6610 { 6611 /** @todo NSTVMX: We don't support Intel PT yet. When we do, this MSR must #GP 6612 * when IntelPT is not supported in VMX. */ 6613 } 6614 } 6563 6615 #endif 6564 6616 … … 6580 6632 * Do the job. 6581 6633 */ 6582 RTUINT64U uValue;6583 uValue.s.Lo = pVCpu->cpum.GstCtx.eax;6584 uValue.s.Hi = pVCpu->cpum.GstCtx.edx;6585 6586 /** @todo make CPUMAllMsrs.cpp import the necessary MSR state. */6587 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_ALL_MSRS);6588 6589 6634 VBOXSTRICTRC rcStrict = CPUMSetGuestMsr(pVCpu, pVCpu->cpum.GstCtx.ecx, uValue.u); 6590 6635 if (rcStrict == VINF_SUCCESS) -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r74542 r74648 1184 1184 VMXFEATDUMP("ExitLoadEferMsr - Load IA32_EFER on VM-exit ", fVmxExitLoadEferMsr); 1185 1185 VMXFEATDUMP("SavePreemptTimer - Save VMX-preemption timer ", fVmxSavePreemptTimer); 1186 VMXFEATDUMP("ExitStoreEferLma - Store EFER.LMA on VM-exit ", fVmxExitStoreEferLma);1187 VMXFEATDUMP("VmwriteAll - VMWRITE to any VMCS field ", fVmxVmwriteAll);1188 VMXFEATDUMP("EntryInjectSoftInt - Inject softint. with 0-len instr. ", fVmxEntryInjectSoftInt);1189 1186 /* Miscellaneous data. */ 1190 VMXFEATDUMP("ExitStoreEferLma - Inject softint. with 0-len instr. ", fVmxExitStoreEferLma); 1187 VMXFEATDUMP("ExitSaveEferLma - Save EFER.LMA on VM-exit ", fVmxExitSaveEferLma); 1188 VMXFEATDUMP("IntelPt - Intel PT (Processor Trace) in VMX operation ", fVmxIntelPt); 1191 1189 VMXFEATDUMP("VmwriteAll - Inject softint. with 0-len instr. ", fVmxVmwriteAll); 1192 1190 VMXFEATDUMP("EntryInjectSoftInt - Inject softint. with 0-len instr. ", fVmxEntryInjectSoftInt); … … 1297 1295 /* Miscellaneous data. */ 1298 1296 uint32_t const fMiscData = VmxMsrs.u64Misc; 1299 pHostFeat->fVmxExitStoreEferLma = RT_BOOL(fMiscData & VMX_MISC_EXIT_STORE_EFER_LMA); 1297 pHostFeat->fVmxExitSaveEferLma = RT_BOOL(fMiscData & VMX_MISC_EXIT_SAVE_EFER_LMA); 1298 pHostFeat->fVmxIntelPt = RT_BOOL(fMiscData & VMX_MISC_INTEL_PT); 1300 1299 pHostFeat->fVmxVmwriteAll = RT_BOOL(fMiscData & VMX_MISC_VMWRITE_ALL); 1301 1300 pHostFeat->fVmxEntryInjectSoftInt = RT_BOOL(fMiscData & VMX_MISC_ENTRY_INJECT_SOFT_INT); … … 1369 1368 EmuFeat.fVmxExitLoadEferMsr = 1; 1370 1369 EmuFeat.fVmxSavePreemptTimer = 0; 1371 EmuFeat.fVmxExitStoreEferLma = 1; 1370 EmuFeat.fVmxExitSaveEferLma = 1; 1371 EmuFeat.fVmxIntelPt = 0; 1372 1372 EmuFeat.fVmxVmwriteAll = 0; 1373 1373 EmuFeat.fVmxEntryInjectSoftInt = 0; … … 1443 1443 pGuestFeat->fVmxExitLoadEferMsr = (pBaseFeat->fVmxExitLoadEferMsr & EmuFeat.fVmxExitLoadEferMsr ); 1444 1444 pGuestFeat->fVmxSavePreemptTimer = (pBaseFeat->fVmxSavePreemptTimer & EmuFeat.fVmxSavePreemptTimer ); 1445 pGuestFeat->fVmxExitStoreEferLma = (pBaseFeat->fVmxExitStoreEferLma & EmuFeat.fVmxExitStoreEferLma ); 1445 pGuestFeat->fVmxExitSaveEferLma = (pBaseFeat->fVmxExitSaveEferLma & EmuFeat.fVmxExitSaveEferLma ); 1446 pGuestFeat->fVmxIntelPt = (pBaseFeat->fVmxIntelPt & EmuFeat.fVmxIntelPt ); 1446 1447 pGuestFeat->fVmxVmwriteAll = (pBaseFeat->fVmxVmwriteAll & EmuFeat.fVmxVmwriteAll ); 1447 1448 pGuestFeat->fVmxEntryInjectSoftInt = (pBaseFeat->fVmxEntryInjectSoftInt & EmuFeat.fVmxEntryInjectSoftInt ); -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r74457 r74648 1598 1598 pVM->hm.s.vmx.cPreemptTimerShift)); 1599 1599 } 1600 LogRel(("HM: EXIT_S TORE_EFER_LMA = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_EXIT_STORE_EFER_LMA)));1600 LogRel(("HM: EXIT_SAVE_EFER_LMA = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_EXIT_SAVE_EFER_LMA))); 1601 1601 LogRel(("HM: ACTIVITY_STATES = %#x%s\n", RT_BF_GET(fMisc, VMX_BF_MISC_ACTIVITY_STATES), 1602 1602 hmR3VmxGetActivityStateAllDesc(fMisc))); 1603 LogRel(("HM: PT = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_PT)));1603 LogRel(("HM: INTEL_PT = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_INTEL_PT))); 1604 1604 LogRel(("HM: SMM_READ_SMBASE_MSR = %RTbool\n", RT_BF_GET(fMisc, VMX_BF_MISC_SMM_READ_SMBASE_MSR))); 1605 1605 LogRel(("HM: CR3_TARGET = %#x\n", RT_BF_GET(fMisc, VMX_BF_MISC_CR3_TARGET)));
Note:
See TracChangeset
for help on using the changeset viewer.