Changeset 92338 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Nov 10, 2021 6:53:45 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148188
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/NEMR3Native-darwin.cpp
r92316 r92338 411 411 } 412 412 413 #if 0 /* unused */414 413 DECLINLINE(int) nemR3DarwinMsrRead(PVMCPUCC pVCpu, uint32_t idMsr, uint64_t *pu64Val) 415 414 { … … 421 420 } 422 421 423 422 #if 0 /*unused*/ 424 423 DECLINLINE(int) nemR3DarwinMsrWrite(PVMCPUCC pVCpu, uint32_t idMsr, uint64_t u64Val) 425 424 { … … 431 430 } 432 431 #endif 433 434 432 435 433 static int nemR3DarwinCopyStateFromHv(PVMCC pVM, PVMCPUCC pVCpu, uint64_t fWhat) … … 1278 1276 if (fWhat & CPUMCTX_EXTRN_OTHER_MSRS) 1279 1277 { 1280 #if 0 1281 hv_return_t hrc = hv_vmx_vcpu_set_apic_address(pVCpu->nem.s.hVCpuId, APICGetBaseMsrNoCheck(pVCpu)); 1278 hv_return_t hrc = hv_vmx_vcpu_set_apic_address(pVCpu->nem.s.hVCpuId, APICGetBaseMsrNoCheck(pVCpu) & PAGE_BASE_GC_MASK); 1282 1279 if (RT_UNLIKELY(hrc != HV_SUCCESS)) 1283 1280 return nemR3DarwinHvSts2Rc(hrc); 1284 #endif1285 1281 1286 1282 #if 0 … … 1692 1688 static int nemR3DarwinVmxSetupVmcsProcCtls(PVMCPUCC pVCpu, PVMXVMCSINFO pVmcsInfo) 1693 1689 { 1694 //PVMCC pVM = pVCpu->CTX_SUFF(pVM);1690 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 1695 1691 uint32_t fVal = g_HmMsrs.u.vmx.ProcCtls.n.allowed0; /* Bits set here must be set in the VMCS. */ 1696 1692 uint32_t const fZap = g_HmMsrs.u.vmx.ProcCtls.n.allowed1; /* Bits cleared here must be cleared in the VMCS. */ … … 1712 1708 } 1713 1709 1714 #if 0 /** @todo */1715 1710 /* Use TPR shadowing if supported by the CPU. */ 1716 1711 if ( PDMHasApic(pVM) … … 1721 1716 Assert(!(fVal & VMX_PROC_CTLS_CR8_STORE_EXIT)); 1722 1717 Assert(!(fVal & VMX_PROC_CTLS_CR8_LOAD_EXIT)); 1723 hmR0VmxSetupVmcsVirtApicAddr(pVmcsInfo);1724 1718 } 1725 1719 else 1726 #endif1727 1720 { 1728 1721 fVal |= VMX_PROC_CTLS_CR8_STORE_EXIT /* CR8 reads cause a VM-exit. */ … … 2195 2188 } 2196 2189 2197 /** @todo Only copy the state selectively. */ 2198 { 2199 int rc = nemR3DarwinCopyStateToHv(pVM, pVCpu, &VmxTransient); 2200 AssertRCReturn(rc, rc); 2201 } 2190 int rc = nemR3DarwinExportGuestState(pVM, pVCpu, &VmxTransient); 2191 AssertRCReturn(rc, rc); 2202 2192 2203 2193 /* … … 2712 2702 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatQueryCpuTick); 2713 2703 2714 RT_NOREF(pVCpu, pcTicks, puAux); 2715 return VINF_SUCCESS; 2704 int rc = nemR3DarwinMsrRead(pVCpu, MSR_IA32_TSC, pcTicks); 2705 if ( RT_SUCCESS(rc) 2706 && puAux) 2707 { 2708 if (pVCpu->cpum.GstCtx.fExtrn & CPUMCTX_EXTRN_TSC_AUX) 2709 { 2710 /** @todo Why the heck is puAux a uint32_t?. */ 2711 uint64_t u64Aux; 2712 rc = nemR3DarwinMsrRead(pVCpu, MSR_K8_TSC_AUX, &u64Aux); 2713 if (RT_SUCCESS(rc)) 2714 *puAux = (uint32_t)u64Aux; 2715 } 2716 else 2717 *puAux = CPUMGetGuestTscAux(pVCpu); 2718 } 2719 2720 return rc; 2716 2721 } 2717 2722 … … 2733 2738 AssertReturn(VM_IS_NEM_ENABLED(pVM), VERR_NEM_IPE_9); 2734 2739 2735 RT_NOREF(uPausedTscValue); 2736 return VINF_SUCCESS; 2740 hv_return_t hrc = hv_vm_sync_tsc(uPausedTscValue); 2741 if (RT_LIKELY(hrc == HV_SUCCESS)) 2742 return VINF_SUCCESS; 2743 2744 return nemR3DarwinHvSts2Rc(hrc); 2737 2745 } 2738 2746
Note:
See TracChangeset
for help on using the changeset viewer.