Changeset 93681 in vbox for trunk/src/VBox
- Timestamp:
- Feb 10, 2022 1:48:35 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/NEMR3Native-darwin.cpp
r93680 r93681 49 49 #include <mach/mach_time.h> 50 50 #include <mach/kern_return.h> 51 51 52 52 53 /********************************************************************************************************************************* … … 1113 1114 READ_MSR(MSR_K8_SF_MASK, pVCpu->cpum.GstCtx.msrSFMASK); 1114 1115 } 1115 #if 01116 1116 if (fWhat & CPUMCTX_EXTRN_OTHER_MSRS) 1117 1117 { 1118 Assert(aenmNames[iReg] == WHvX64RegisterApicBase);1119 const uint64_t uOldBase = APICGetBaseMsrNoCheck(pVCpu);1120 if (aValues[iReg].Reg64 != uOldBase)1121 {1122 Log7(("NEM/%u: MSR APICBase changed %RX64 -> %RX64 (%RX64)\n",1123 pVCpu->idCpu, uOldBase, aValues[iReg].Reg64, aValues[iReg].Reg64 ^ uOldBase));1124 int rc2 = APICSetBaseMsr(pVCpu, aValues[iReg].Reg64);1125 AssertLogRelMsg(rc2 == VINF_SUCCESS, ("%Rrc %RX64\n", rc2, aValues[iReg].Reg64));1126 }1127 iReg++;1128 1129 GET_REG64_LOG7(pVCpu->cpum.GstCtx.msrPAT, WHvX64RegisterPat, "MSR PAT");1130 #if 0 /*def LOG_ENABLED*/ /** @todo something's wrong with HvX64RegisterMtrrCap? (AMD) */1131 GET_REG64_LOG7(pVCpu->cpum.GstCtx.msrPAT, WHvX64RegisterMsrMtrrCap);1132 #endif1133 1118 PCPUMCTXMSRS pCtxMsrs = CPUMQueryGuestCtxMsrsPtr(pVCpu); 1134 GET_REG64_LOG7(pCtxMsrs->msr.MtrrDefType, WHvX64RegisterMsrMtrrDefType, "MSR MTRR_DEF_TYPE"); 1135 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix64K_00000, WHvX64RegisterMsrMtrrFix64k00000, "MSR MTRR_FIX_64K_00000"); 1136 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix16K_80000, WHvX64RegisterMsrMtrrFix16k80000, "MSR MTRR_FIX_16K_80000"); 1137 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix16K_A0000, WHvX64RegisterMsrMtrrFix16kA0000, "MSR MTRR_FIX_16K_A0000"); 1138 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_C0000, WHvX64RegisterMsrMtrrFix4kC0000, "MSR MTRR_FIX_4K_C0000"); 1139 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_C8000, WHvX64RegisterMsrMtrrFix4kC8000, "MSR MTRR_FIX_4K_C8000"); 1140 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_D0000, WHvX64RegisterMsrMtrrFix4kD0000, "MSR MTRR_FIX_4K_D0000"); 1141 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_D8000, WHvX64RegisterMsrMtrrFix4kD8000, "MSR MTRR_FIX_4K_D8000"); 1142 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_E0000, WHvX64RegisterMsrMtrrFix4kE0000, "MSR MTRR_FIX_4K_E0000"); 1143 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_E8000, WHvX64RegisterMsrMtrrFix4kE8000, "MSR MTRR_FIX_4K_E8000"); 1144 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_F0000, WHvX64RegisterMsrMtrrFix4kF0000, "MSR MTRR_FIX_4K_F0000"); 1145 GET_REG64_LOG7(pCtxMsrs->msr.MtrrFix4K_F8000, WHvX64RegisterMsrMtrrFix4kF8000, "MSR MTRR_FIX_4K_F8000"); 1146 GET_REG64_LOG7(pCtxMsrs->msr.TscAux, WHvX64RegisterTscAux, "MSR TSC_AUX"); 1147 /** @todo look for HvX64RegisterIa32MiscEnable and HvX64RegisterIa32FeatureControl? */ 1148 } 1149 #endif 1119 READ_MSR(MSR_K8_TSC_AUX, pCtxMsrs->msr.TscAux); 1120 } 1150 1121 1151 1122 /* Almost done, just update extrn flags and maybe change PGM mode. */ … … 1727 1698 if (fWhat & CPUMCTX_EXTRN_OTHER_MSRS) 1728 1699 { 1729 #if 0 1730 hv_return_t hrc = hv_vmx_vcpu_set_apic_address(pVCpu->nem.s.hVCpuId, APICGetBaseMsrNoCheck(pVCpu) & PAGE_BASE_GC_MASK); 1731 if (RT_UNLIKELY(hrc != HV_SUCCESS)) 1732 return nemR3DarwinHvSts2Rc(hrc); 1733 #endif 1734 1700 PCPUMCTXMSRS pCtxMsrs = CPUMQueryGuestCtxMsrsPtr(pVCpu); 1701 1702 WRITE_MSR(MSR_K8_TSC_AUX, pCtxMsrs->msr.TscAux); 1735 1703 ASMAtomicUoAndU64(&pVCpu->nem.s.fCtxChanged, ~HM_CHANGED_GUEST_OTHER_MSRS); 1736 1737 #if 01738 ADD_REG64(WHvX64RegisterPat, pVCpu->cpum.GstCtx.msrPAT);1739 #if 0 /** @todo check if WHvX64RegisterMsrMtrrCap works here... */1740 ADD_REG64(WHvX64RegisterMsrMtrrCap, CPUMGetGuestIa32MtrrCap(pVCpu));1741 #endif1742 PCPUMCTXMSRS pCtxMsrs = CPUMQueryGuestCtxMsrsPtr(pVCpu);1743 ADD_REG64(WHvX64RegisterMsrMtrrDefType, pCtxMsrs->msr.MtrrDefType);1744 ADD_REG64(WHvX64RegisterMsrMtrrFix64k00000, pCtxMsrs->msr.MtrrFix64K_00000);1745 ADD_REG64(WHvX64RegisterMsrMtrrFix16k80000, pCtxMsrs->msr.MtrrFix16K_80000);1746 ADD_REG64(WHvX64RegisterMsrMtrrFix16kA0000, pCtxMsrs->msr.MtrrFix16K_A0000);1747 ADD_REG64(WHvX64RegisterMsrMtrrFix4kC0000, pCtxMsrs->msr.MtrrFix4K_C0000);1748 ADD_REG64(WHvX64RegisterMsrMtrrFix4kC8000, pCtxMsrs->msr.MtrrFix4K_C8000);1749 ADD_REG64(WHvX64RegisterMsrMtrrFix4kD0000, pCtxMsrs->msr.MtrrFix4K_D0000);1750 ADD_REG64(WHvX64RegisterMsrMtrrFix4kD8000, pCtxMsrs->msr.MtrrFix4K_D8000);1751 ADD_REG64(WHvX64RegisterMsrMtrrFix4kE0000, pCtxMsrs->msr.MtrrFix4K_E0000);1752 ADD_REG64(WHvX64RegisterMsrMtrrFix4kE8000, pCtxMsrs->msr.MtrrFix4K_E8000);1753 ADD_REG64(WHvX64RegisterMsrMtrrFix4kF0000, pCtxMsrs->msr.MtrrFix4K_F0000);1754 ADD_REG64(WHvX64RegisterMsrMtrrFix4kF8000, pCtxMsrs->msr.MtrrFix4K_F8000);1755 ADD_REG64(WHvX64RegisterTscAux, pCtxMsrs->msr.TscAux);1756 #if 0 /** @todo these registers aren't available? Might explain something.. .*/1757 const CPUMCPUVENDOR enmCpuVendor = CPUMGetHostCpuVendor(pVM);1758 if (enmCpuVendor != CPUMCPUVENDOR_AMD)1759 {1760 ADD_REG64(HvX64RegisterIa32MiscEnable, pCtxMsrs->msr.MiscEnable);1761 ADD_REG64(HvX64RegisterIa32FeatureControl, CPUMGetGuestIa32FeatureControl(pVCpu));1762 }1763 #endif1764 #endif1765 1704 } 1766 1705 … … 1773 1712 1774 1713 /* Clear any bits that may be set but exported unconditionally or unused/reserved bits. */ 1775 ASMAtomicUoAndU64(&pVCpu->nem.s.fCtxChanged, ~( 1776 HM_CHANGED_GUEST_TSC_AUX 1777 | HM_CHANGED_GUEST_HWVIRT 1714 ASMAtomicUoAndU64(&pVCpu->nem.s.fCtxChanged, ~( HM_CHANGED_GUEST_HWVIRT 1778 1715 | HM_CHANGED_VMX_GUEST_AUTO_MSRS 1779 1716 | HM_CHANGED_VMX_GUEST_LAZY_MSRS … … 3415 3352 if (pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_TSC_AUX) 3416 3353 { 3417 /** @todo Why the heck is puAux a uint32_t?. */3418 3354 uint64_t u64Aux; 3419 3355 rc = nemR3DarwinMsrRead(pVCpu, MSR_K8_TSC_AUX, &u64Aux);
Note:
See TracChangeset
for help on using the changeset viewer.