Changeset 76468 in vbox
- Timestamp:
- Dec 25, 2018 5:00:01 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r76461 r76468 29 29 #include <VBox/cdefs.h> 30 30 #include <VBox/types.h> 31 #include <VBox/vmm/hm_vmx.h>32 #include <VBox/vmm/hm_svm.h>33 31 #include <iprt/assert.h> 34 32 #include <iprt/stdarg.h> … … 117 115 union 118 116 { 119 VMXMSRS vmx; 120 SVMMSRS svm; 121 } u ; 117 struct 118 { 119 uint64_t u64FeatCtrl; 120 uint64_t u64Basic; 121 uint64_t u64PinCtls; 122 uint64_t u64ProcCtls; 123 uint64_t u64ProcCtls2; 124 uint64_t u64ExitCtls; 125 uint64_t u64EntryCtls; 126 uint64_t u64TruePinCtls; 127 uint64_t u64TrueProcCtls; 128 uint64_t u64TrueEntryCtls; 129 uint64_t u64TrueExitCtls; 130 uint64_t u64Misc; 131 uint64_t u64Cr0Fixed0; 132 uint64_t u64Cr0Fixed1; 133 uint64_t u64Cr4Fixed0; 134 uint64_t u64Cr4Fixed1; 135 uint64_t u64VmcsEnum; 136 uint64_t u64VmFunc; 137 uint64_t u64EptVpidCaps; 138 uint64_t a_u64Reserved[9]; 139 } vmx; 140 struct 141 { 142 uint64_t u64MsrHwcr; 143 uint64_t u64Padding[27]; 144 }svm; 145 } u; 122 146 } SUPHWVIRTMSRS; 123 147 AssertCompileSize(SUPHWVIRTMSRS, 224); -
trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
r76461 r76468 4625 4625 g_HwvirtMsrs.u.vmx.u64FeatCtrl = ASMRdMsr(MSR_IA32_FEATURE_CONTROL); 4626 4626 g_HwvirtMsrs.u.vmx.u64Basic = ASMRdMsr(MSR_IA32_VMX_BASIC); 4627 g_HwvirtMsrs.u.vmx. PinCtls.u= ASMRdMsr(MSR_IA32_VMX_PINBASED_CTLS);4628 g_HwvirtMsrs.u.vmx. ProcCtls.u= ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS);4629 g_HwvirtMsrs.u.vmx. ExitCtls.u= ASMRdMsr(MSR_IA32_VMX_EXIT_CTLS);4630 g_HwvirtMsrs.u.vmx. EntryCtls.u= ASMRdMsr(MSR_IA32_VMX_ENTRY_CTLS);4627 g_HwvirtMsrs.u.vmx.u64PinCtls = ASMRdMsr(MSR_IA32_VMX_PINBASED_CTLS); 4628 g_HwvirtMsrs.u.vmx.u64ProcCtls = ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS); 4629 g_HwvirtMsrs.u.vmx.u64ExitCtls = ASMRdMsr(MSR_IA32_VMX_EXIT_CTLS); 4630 g_HwvirtMsrs.u.vmx.u64EntryCtls = ASMRdMsr(MSR_IA32_VMX_ENTRY_CTLS); 4631 4631 g_HwvirtMsrs.u.vmx.u64Misc = ASMRdMsr(MSR_IA32_VMX_MISC); 4632 4632 g_HwvirtMsrs.u.vmx.u64Cr0Fixed0 = ASMRdMsr(MSR_IA32_VMX_CR0_FIXED0); … … 4638 4638 if (RT_BF_GET(g_HwvirtMsrs.u.vmx.u64Basic, VMX_BF_BASIC_TRUE_CTLS)) 4639 4639 { 4640 g_HwvirtMsrs.u.vmx. TruePinCtls.u= ASMRdMsr(MSR_IA32_VMX_TRUE_PINBASED_CTLS);4641 g_HwvirtMsrs.u.vmx. TrueProcCtls.u= ASMRdMsr(MSR_IA32_VMX_TRUE_PROCBASED_CTLS);4642 g_HwvirtMsrs.u.vmx. TrueEntryCtls.u= ASMRdMsr(MSR_IA32_VMX_TRUE_ENTRY_CTLS);4643 g_HwvirtMsrs.u.vmx. TrueExitCtls.u= ASMRdMsr(MSR_IA32_VMX_TRUE_EXIT_CTLS);4644 } 4645 4646 uint32_t const fProcCtlsAllowed1 = g_HwvirtMsrs.u.vmx.ProcCtls.n.allowed1;4640 g_HwvirtMsrs.u.vmx.u64TruePinCtls = ASMRdMsr(MSR_IA32_VMX_TRUE_PINBASED_CTLS); 4641 g_HwvirtMsrs.u.vmx.u64TrueProcCtls = ASMRdMsr(MSR_IA32_VMX_TRUE_PROCBASED_CTLS); 4642 g_HwvirtMsrs.u.vmx.u64TrueEntryCtls = ASMRdMsr(MSR_IA32_VMX_TRUE_ENTRY_CTLS); 4643 g_HwvirtMsrs.u.vmx.u64TrueExitCtls = ASMRdMsr(MSR_IA32_VMX_TRUE_EXIT_CTLS); 4644 } 4645 4646 uint32_t const fProcCtlsAllowed1 = RT_HI_U32(g_HwvirtMsrs.u.vmx.u64ProcCtls); 4647 4647 if (fProcCtlsAllowed1 & VMX_PROC_CTLS_USE_SECONDARY_CTLS) 4648 4648 { 4649 g_HwvirtMsrs.u.vmx. ProcCtls2.u= ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS2);4650 4651 uint32_t const fProcCtls2Allowed1 = g_HwvirtMsrs.u.vmx.ProcCtls2.n.allowed1;4649 g_HwvirtMsrs.u.vmx.u64ProcCtls2 = ASMRdMsr(MSR_IA32_VMX_PROCBASED_CTLS2); 4650 4651 uint32_t const fProcCtls2Allowed1 = RT_HI_U32(g_HwvirtMsrs.u.vmx.u64ProcCtls2); 4652 4652 if (fProcCtls2Allowed1 & (VMX_PROC_CTLS2_EPT | VMX_PROC_CTLS2_VPID)) 4653 4653 g_HwvirtMsrs.u.vmx.u64EptVpidCaps = ASMRdMsr(MSR_IA32_VMX_EPT_VPID_CAP); -
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r76464 r76468 478 478 * Timer Does Not Count Down at the Rate Specified" CPU erratum. 479 479 */ 480 uint32_t const fPinCtls = g_HmR0.hwvirt.Msrs.u.vmx.PinCtls.n.allowed1;480 uint32_t const fPinCtls = RT_HI_U32(g_HmR0.hwvirt.Msrs.u.vmx.u64PinCtls); 481 481 if (fPinCtls & VMX_PIN_CTLS_PREEMPT_TIMER) 482 482 { … … 1176 1176 pVM->hm.s.vmx.u64HostEfer = g_HmR0.hwvirt.u.vmx.u64HostEfer; 1177 1177 pVM->hm.s.vmx.u64HostSmmMonitorCtl = g_HmR0.hwvirt.u.vmx.u64HostSmmMonitorCtl; 1178 pVM->hm.s.vmx.Msrs = g_HmR0.hwvirt.Msrs.u.vmx; 1178 1179 pVM->hm.s.vmx.Msrs.u64FeatCtrl = g_HmR0.hwvirt.Msrs.u.vmx.u64FeatCtrl; 1180 pVM->hm.s.vmx.Msrs.u64Basic = g_HmR0.hwvirt.Msrs.u.vmx.u64Basic; 1181 pVM->hm.s.vmx.Msrs.PinCtls.u = g_HmR0.hwvirt.Msrs.u.vmx.u64PinCtls; 1182 pVM->hm.s.vmx.Msrs.ProcCtls.u = g_HmR0.hwvirt.Msrs.u.vmx.u64ProcCtls; 1183 pVM->hm.s.vmx.Msrs.ProcCtls2.u = g_HmR0.hwvirt.Msrs.u.vmx.u64ProcCtls2; 1184 pVM->hm.s.vmx.Msrs.ExitCtls.u = g_HmR0.hwvirt.Msrs.u.vmx.u64ExitCtls; 1185 pVM->hm.s.vmx.Msrs.EntryCtls.u = g_HmR0.hwvirt.Msrs.u.vmx.u64EntryCtls; 1186 pVM->hm.s.vmx.Msrs.TruePinCtls.u = g_HmR0.hwvirt.Msrs.u.vmx.u64TruePinCtls; 1187 pVM->hm.s.vmx.Msrs.TrueProcCtls.u = g_HmR0.hwvirt.Msrs.u.vmx.u64TrueProcCtls; 1188 pVM->hm.s.vmx.Msrs.TrueEntryCtls.u = g_HmR0.hwvirt.Msrs.u.vmx.u64TrueEntryCtls; 1189 pVM->hm.s.vmx.Msrs.TrueExitCtls.u = g_HmR0.hwvirt.Msrs.u.vmx.u64TrueExitCtls; 1190 pVM->hm.s.vmx.Msrs.u64Misc = g_HmR0.hwvirt.Msrs.u.vmx.u64Misc; 1191 pVM->hm.s.vmx.Msrs.u64Cr0Fixed0 = g_HmR0.hwvirt.Msrs.u.vmx.u64Cr0Fixed0; 1192 pVM->hm.s.vmx.Msrs.u64Cr0Fixed1 = g_HmR0.hwvirt.Msrs.u.vmx.u64Cr0Fixed1; 1193 pVM->hm.s.vmx.Msrs.u64Cr4Fixed0 = g_HmR0.hwvirt.Msrs.u.vmx.u64Cr4Fixed0; 1194 pVM->hm.s.vmx.Msrs.u64Cr4Fixed1 = g_HmR0.hwvirt.Msrs.u.vmx.u64Cr4Fixed1; 1195 pVM->hm.s.vmx.Msrs.u64VmcsEnum = g_HmR0.hwvirt.Msrs.u.vmx.u64VmcsEnum; 1196 pVM->hm.s.vmx.Msrs.u64VmFunc = g_HmR0.hwvirt.Msrs.u.vmx.u64VmFunc; 1197 pVM->hm.s.vmx.Msrs.u64EptVpidCaps = g_HmR0.hwvirt.Msrs.u.vmx.u64EptVpidCaps; 1179 1198 } 1180 1199 else if (pVM->hm.s.svm.fSupported) -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r76464 r76468 1150 1150 * invalidated when flushing by VPID. 1151 1151 */ 1152 PCVMXMSRS pMsrs = &pHwvirtMsrs->u.vmx; 1153 if (pMsrs->u64EptVpidCaps & MSR_IA32_VMX_EPT_VPID_CAP_INVEPT_ALL_CONTEXTS) 1152 if (pHwvirtMsrs->u.vmx.u64EptVpidCaps & MSR_IA32_VMX_EPT_VPID_CAP_INVEPT_ALL_CONTEXTS) 1154 1153 { 1155 1154 hmR0VmxFlushEpt(NULL /* pVCpu */, VMXTLBFLUSHEPT_ALL_CONTEXTS); -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r76467 r76468 1750 1750 { 1751 1751 if (fCaps & SUPVTCAPS_VT_X) 1752 pMsrs->hwvirt.vmx = HwvirtMsrs.u.vmx; 1752 { 1753 pMsrs->hwvirt.vmx.u64FeatCtrl = HwvirtMsrs.u.vmx.u64FeatCtrl; 1754 pMsrs->hwvirt.vmx.u64Basic = HwvirtMsrs.u.vmx.u64Basic; 1755 pMsrs->hwvirt.vmx.PinCtls.u = HwvirtMsrs.u.vmx.u64PinCtls; 1756 pMsrs->hwvirt.vmx.ProcCtls.u = HwvirtMsrs.u.vmx.u64ProcCtls; 1757 pMsrs->hwvirt.vmx.ProcCtls2.u = HwvirtMsrs.u.vmx.u64ProcCtls2; 1758 pMsrs->hwvirt.vmx.ExitCtls.u = HwvirtMsrs.u.vmx.u64ExitCtls; 1759 pMsrs->hwvirt.vmx.EntryCtls.u = HwvirtMsrs.u.vmx.u64EntryCtls; 1760 pMsrs->hwvirt.vmx.TruePinCtls.u = HwvirtMsrs.u.vmx.u64TruePinCtls; 1761 pMsrs->hwvirt.vmx.TrueProcCtls.u = HwvirtMsrs.u.vmx.u64TrueProcCtls; 1762 pMsrs->hwvirt.vmx.TrueEntryCtls.u = HwvirtMsrs.u.vmx.u64TrueEntryCtls; 1763 pMsrs->hwvirt.vmx.TrueExitCtls.u = HwvirtMsrs.u.vmx.u64TrueExitCtls; 1764 pMsrs->hwvirt.vmx.u64Misc = HwvirtMsrs.u.vmx.u64Misc; 1765 pMsrs->hwvirt.vmx.u64Cr0Fixed0 = HwvirtMsrs.u.vmx.u64Cr0Fixed0; 1766 pMsrs->hwvirt.vmx.u64Cr0Fixed1 = HwvirtMsrs.u.vmx.u64Cr0Fixed1; 1767 pMsrs->hwvirt.vmx.u64Cr4Fixed0 = HwvirtMsrs.u.vmx.u64Cr4Fixed0; 1768 pMsrs->hwvirt.vmx.u64Cr4Fixed1 = HwvirtMsrs.u.vmx.u64Cr4Fixed1; 1769 pMsrs->hwvirt.vmx.u64VmcsEnum = HwvirtMsrs.u.vmx.u64VmcsEnum; 1770 pMsrs->hwvirt.vmx.u64VmFunc = HwvirtMsrs.u.vmx.u64VmFunc; 1771 pMsrs->hwvirt.vmx.u64EptVpidCaps = HwvirtMsrs.u.vmx.u64EptVpidCaps; 1772 } 1753 1773 else 1754 pMsrs->hwvirt.svm = HwvirtMsrs.u.svm;1774 pMsrs->hwvirt.svm.u64MsrHwcr = HwvirtMsrs.u.svm.u64MsrHwcr; 1755 1775 return VINF_SUCCESS; 1756 1776 }
Note:
See TracChangeset
for help on using the changeset viewer.