Changeset 87542 in vbox
- Timestamp:
- Feb 2, 2021 4:51:25 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r85748 r87542 110 110 /** @} */ 111 111 112 /** 113 * An VT-x control MSR. 114 * @sa VMXCTLSMSR. 115 */ 116 typedef union SUPVMXCTLSMSR 117 { 118 uint64_t u; 119 struct 120 { 121 /** Bits set here _must_ be set in the corresponding VM-execution controls. */ 122 uint32_t allowed0; 123 /** Bits cleared here _must_ be cleared in the corresponding VM-execution controls. */ 124 uint32_t allowed1; 125 } n; 126 } SUPVMXCTLSMSR; 127 AssertCompileSize(SUPVMXCTLSMSR, sizeof(uint64_t)); 112 128 113 129 /** … … 118 134 union 119 135 { 136 /** @sa VMXMSRS */ 120 137 struct 121 138 { 122 139 uint64_t u64FeatCtrl; 123 140 uint64_t u64Basic; 124 uint64_t u64PinCtls; 125 uint64_t u64ProcCtls; 126 uint64_t u64ProcCtls2; 127 uint64_t u64ExitCtls; 128 uint64_t u64EntryCtls; 129 uint64_t u64TruePinCtls; 130 uint64_t u64TrueProcCtls; 131 uint64_t u64TrueEntryCtls; 132 uint64_t u64TrueExitCtls; 141 /** Pin-based VM-execution controls. */ 142 SUPVMXCTLSMSR PinCtls; 143 /** Processor-based VM-execution controls. */ 144 SUPVMXCTLSMSR ProcCtls; 145 /** Secondary processor-based VM-execution controls. */ 146 SUPVMXCTLSMSR ProcCtls2; 147 /** VM-exit controls. */ 148 SUPVMXCTLSMSR ExitCtls; 149 /** VM-entry controls. */ 150 SUPVMXCTLSMSR EntryCtls; 151 /** True pin-based VM-execution controls. */ 152 SUPVMXCTLSMSR TruePinCtls; 153 /** True processor-based VM-execution controls. */ 154 SUPVMXCTLSMSR TrueProcCtls; 155 /** True VM-entry controls. */ 156 SUPVMXCTLSMSR TrueEntryCtls; 157 /** True VM-exit controls. */ 158 SUPVMXCTLSMSR TrueExitCtls; 133 159 uint64_t u64Misc; 134 160 uint64_t u64Cr0Fixed0; … … 139 165 uint64_t u64VmFunc; 140 166 uint64_t u64EptVpidCaps; 141 uint64_t a _u64Reserved[9];167 uint64_t au64Reserved[9]; 142 168 } vmx; 143 169 struct -
trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
r87534 r87542 4641 4641 Msrs.u.vmx.u64FeatCtrl = ASMRdMsr(MSR_IA32_FEATURE_CONTROL); 4642 4642 Msrs.u.vmx.u64Basic = ASMRdMsr(MSR_IA32_VMX_BASIC); 4643 Msrs.u.vmx. u64PinCtls= ASMRdMsr(MSR_IA32_VMX_PINBASED_CTLS);4644 Msrs.u.vmx. u64ProcCtls= ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS);4645 Msrs.u.vmx. u64ExitCtls= ASMRdMsr(MSR_IA32_VMX_EXIT_CTLS);4646 Msrs.u.vmx. u64EntryCtls= ASMRdMsr(MSR_IA32_VMX_ENTRY_CTLS);4643 Msrs.u.vmx.PinCtls.u = ASMRdMsr(MSR_IA32_VMX_PINBASED_CTLS); 4644 Msrs.u.vmx.ProcCtls.u = ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS); 4645 Msrs.u.vmx.ExitCtls.u = ASMRdMsr(MSR_IA32_VMX_EXIT_CTLS); 4646 Msrs.u.vmx.EntryCtls.u = ASMRdMsr(MSR_IA32_VMX_ENTRY_CTLS); 4647 4647 Msrs.u.vmx.u64Misc = ASMRdMsr(MSR_IA32_VMX_MISC); 4648 4648 Msrs.u.vmx.u64Cr0Fixed0 = ASMRdMsr(MSR_IA32_VMX_CR0_FIXED0); … … 4654 4654 if (RT_BF_GET(Msrs.u.vmx.u64Basic, VMX_BF_BASIC_TRUE_CTLS)) 4655 4655 { 4656 Msrs.u.vmx.u64TruePinCtls = ASMRdMsr(MSR_IA32_VMX_TRUE_PINBASED_CTLS); 4657 Msrs.u.vmx.u64TrueProcCtls = ASMRdMsr(MSR_IA32_VMX_TRUE_PROCBASED_CTLS); 4658 Msrs.u.vmx.u64TrueEntryCtls = ASMRdMsr(MSR_IA32_VMX_TRUE_ENTRY_CTLS); 4659 Msrs.u.vmx.u64TrueExitCtls = ASMRdMsr(MSR_IA32_VMX_TRUE_EXIT_CTLS); 4660 } 4661 4662 uint32_t const fProcCtlsAllowed1 = RT_HI_U32(Msrs.u.vmx.u64ProcCtls); 4663 if (fProcCtlsAllowed1 & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 4664 { 4665 Msrs.u.vmx.u64ProcCtls2 = ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS2); 4666 4667 uint32_t const fProcCtls2Allowed1 = RT_HI_U32(Msrs.u.vmx.u64ProcCtls2); 4668 if (fProcCtls2Allowed1 & (VMX_PROC_CTLS2_EPT | VMX_PROC_CTLS2_VPID)) 4656 Msrs.u.vmx.TruePinCtls.u = ASMRdMsr(MSR_IA32_VMX_TRUE_PINBASED_CTLS); 4657 Msrs.u.vmx.TrueProcCtls.u = ASMRdMsr(MSR_IA32_VMX_TRUE_PROCBASED_CTLS); 4658 Msrs.u.vmx.TrueEntryCtls.u = ASMRdMsr(MSR_IA32_VMX_TRUE_ENTRY_CTLS); 4659 Msrs.u.vmx.TrueExitCtls.u = ASMRdMsr(MSR_IA32_VMX_TRUE_EXIT_CTLS); 4660 } 4661 4662 if (Msrs.u.vmx.ProcCtls.n.allowed1 & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 4663 { 4664 Msrs.u.vmx.ProcCtls2.u = ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS2); 4665 4666 if (Msrs.u.vmx.ProcCtls2.n.allowed1 & (VMX_PROC_CTLS2_EPT | VMX_PROC_CTLS2_VPID)) 4669 4667 Msrs.u.vmx.u64EptVpidCaps = ASMRdMsr(MSR_IA32_VMX_EPT_VPID_CAP); 4670 4668 4671 if ( fProcCtls2Allowed1 & VMX_PROC_CTLS2_VMFUNC)4669 if (Msrs.u.vmx.ProcCtls2.n.allowed1 & VMX_PROC_CTLS2_VMFUNC) 4672 4670 Msrs.u.vmx.u64VmFunc = ASMRdMsr(MSR_IA32_VMX_VMFUNC); 4673 4671 } -
trunk/src/VBox/VMM/VMMAll/HMAll.cpp
r87518 r87542 834 834 pVmxMsrs->u64FeatCtrl = pHwvirtMsrs->u.vmx.u64FeatCtrl; 835 835 pVmxMsrs->u64Basic = pHwvirtMsrs->u.vmx.u64Basic; 836 pVmxMsrs->PinCtls.u = pHwvirtMsrs->u.vmx. u64PinCtls;837 pVmxMsrs->ProcCtls.u = pHwvirtMsrs->u.vmx. u64ProcCtls;838 pVmxMsrs->ProcCtls2.u = pHwvirtMsrs->u.vmx. u64ProcCtls2;839 pVmxMsrs->ExitCtls.u = pHwvirtMsrs->u.vmx. u64ExitCtls;840 pVmxMsrs->EntryCtls.u = pHwvirtMsrs->u.vmx. u64EntryCtls;841 pVmxMsrs->TruePinCtls.u = pHwvirtMsrs->u.vmx. u64TruePinCtls;842 pVmxMsrs->TrueProcCtls.u = pHwvirtMsrs->u.vmx. u64TrueProcCtls;843 pVmxMsrs->TrueEntryCtls.u = pHwvirtMsrs->u.vmx. u64TrueEntryCtls;844 pVmxMsrs->TrueExitCtls.u = pHwvirtMsrs->u.vmx. u64TrueExitCtls;836 pVmxMsrs->PinCtls.u = pHwvirtMsrs->u.vmx.PinCtls.u; 837 pVmxMsrs->ProcCtls.u = pHwvirtMsrs->u.vmx.ProcCtls.u; 838 pVmxMsrs->ProcCtls2.u = pHwvirtMsrs->u.vmx.ProcCtls2.u; 839 pVmxMsrs->ExitCtls.u = pHwvirtMsrs->u.vmx.ExitCtls.u; 840 pVmxMsrs->EntryCtls.u = pHwvirtMsrs->u.vmx.EntryCtls.u; 841 pVmxMsrs->TruePinCtls.u = pHwvirtMsrs->u.vmx.TruePinCtls.u; 842 pVmxMsrs->TrueProcCtls.u = pHwvirtMsrs->u.vmx.TrueProcCtls.u; 843 pVmxMsrs->TrueEntryCtls.u = pHwvirtMsrs->u.vmx.TrueEntryCtls.u; 844 pVmxMsrs->TrueExitCtls.u = pHwvirtMsrs->u.vmx.TrueExitCtls.u; 845 845 pVmxMsrs->u64Misc = pHwvirtMsrs->u.vmx.u64Misc; 846 846 pVmxMsrs->u64Cr0Fixed0 = pHwvirtMsrs->u.vmx.u64Cr0Fixed0; -
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r87539 r87542 480 480 * Timer Does Not Count Down at the Rate Specified" CPU erratum. 481 481 */ 482 VMXCTLSMSR PinCtls; 483 PinCtls.u = g_HmMsrs.u.vmx.u64PinCtls; 484 if (PinCtls.n.allowed1 & VMX_PIN_CTLS_PREEMPT_TIMER) 482 if (g_HmMsrs.u.vmx.PinCtls.n.allowed1 & VMX_PIN_CTLS_PREEMPT_TIMER) 485 483 { 486 uint64_t const uVmxMiscMsr = g_HmMsrs.u.vmx.u64Misc;487 484 g_fHmVmxUsePreemptTimer = true; 488 g_cHmVmxPreemptTimerShift = RT_BF_GET( uVmxMiscMsr, VMX_BF_MISC_PREEMPT_TIMER_TSC);485 g_cHmVmxPreemptTimerShift = RT_BF_GET(g_HmMsrs.u.vmx.u64Misc, VMX_BF_MISC_PREEMPT_TIMER_TSC); 489 486 if (HMIsSubjectToVmxPreemptTimerErratum()) 490 487 g_cHmVmxPreemptTimerShift = 0; /* This is about right most of the time here. */
Note:
See TracChangeset
for help on using the changeset viewer.