Lines Matching defs:pVM

85  * @param   pVM         Pointer to the VM.
88 VMMR3_INT_DECL(int) gimR3HvInit(PVM pVM)
90 AssertReturn(pVM, VERR_INVALID_PARAMETER);
91 AssertReturn(pVM->gim.s.enmProviderId == GIMPROVIDERID_HYPERV, VERR_INTERNAL_ERROR_5);
94 PGIMHV pHv = &pVM->gim.s.u.Hv;
99 if (!pVM->gim.s.u32Version)
170 CPUMSetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_HVP);
182 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
190 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
201 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
209 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
217 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
225 rc = CPUMR3MsrRangesInsert(pVM, &g_aMsrRanges_HyperV[i]);
239 * @param pVM Pointer to the VM.
241 VMMR3_INT_DECL(int) gimR3HvInitCompleted(PVM pVM)
243 PGIMHV pHv = &pVM->gim.s.u.Hv;
248 if (!pVM->gim.s.u32Version)
251 pHv->uHyperCaps = HMIsNestedPagingActive(pVM) ? GIM_HV_HOST_FEAT_NESTED_PAGING : 0;
252 pHv->uHyperCaps |= HMAreMsrBitmapsAvailable(pVM) ? GIM_HV_HOST_FEAT_MSR_BITMAP : 0;
262 int rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
270 VMMR3_INT_DECL(int) gimR3HvInitFinalize(PVM pVM)
272 pVM->gim.s.pfnHypercallR3 = &GIMHvHypercall;
273 if (!HMIsEnabled(pVM))
275 rc = PDMR3LdrGetSymbolRC(pVM, NULL /* pszModule */, GIMHV_HYPERCALL, &pVM->gim.s.pfnHypercallRC);
278 rc = PDMR3LdrGetSymbolR0(pVM, NULL /* pszModule */, GIMHV_HYPERCALL, &pVM->gim.s.pfnHypercallR0);
288 * @param pVM Pointer to the VM.
290 VMMR3_INT_DECL(int) gimR3HvTerm(PVM pVM)
292 gimR3HvReset(pVM);
303 * @param pVM Pointer to the VM.
306 VMMR3_INT_DECL(void) gimR3HvRelocate(PVM pVM, RTGCINTPTR offDelta)
309 int rc = PDMR3LdrGetSymbolRC(pVM, NULL /* pszModule */, GIMHV_HYPERCALL, &pVM->gim.s.pfnHypercallRC);
321 * @param pVM Pointer to the VM.
324 VMMR3_INT_DECL(void) gimR3HvReset(PVM pVM)
326 VM_ASSERT_EMT0(pVM);
332 PGIMHV pHv = &pVM->gim.s.u.Hv;
336 GIMR3Mmio2Unmap(pVM, pRegion);
352 * @param pVM Pointer to the VM.
355 VMMR3_INT_DECL(PGIMMMIO2REGION) gimR3HvGetMmio2Regions(PVM pVM, uint32_t *pcRegions)
357 Assert(GIMIsEnabled(pVM));
358 PGIMHV pHv = &pVM->gim.s.u.Hv;
370 * @param pVM Pointer to the VM.
373 VMMR3_INT_DECL(int) gimR3HvSave(PVM pVM, PSSMHANDLE pSSM)
375 PCGIMHV pcHv = &pVM->gim.s.u.Hv;
435 * @param pVM Pointer to the VM.
439 VMMR3_INT_DECL(int) gimR3HvLoad(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion)
441 PGIMHV pHv = &pVM->gim.s.u.Hv;
486 rc = gimR3HvEnableHypercallPage(pVM, pRegion->GCPhysPage);
512 rc = gimR3HvEnableTscPage(pVM, pRegion->GCPhysPage, true /* fUseThisTscSeq */, uTscSequence);
529 * @param pVM Pointer to the VM.
536 VMMR3_INT_DECL(int) gimR3HvEnableTscPage(PVM pVM, RTGCPHYS GCPhysTscPage, bool fUseThisTscSeq, uint32_t uTscSeq)
538 PPDMDEVINSR3 pDevIns = pVM->gim.s.pDevInsR3;
539 PGIMMMIO2REGION pRegion = &pVM->gim.s.u.Hv.aMmio2Regions[GIM_HV_REF_TSC_PAGE_REGION_IDX];
554 rc = gimR3HvDisableTscPage(pVM);
562 rc = GIMR3Mmio2Map(pVM, pRegion, GCPhysTscPage);
577 uint64_t const u64TscKHz = TMCpuTicksPerSecond(pVM) / UINT64_C(1000);
589 TMR3CpuTickParavirtEnable(pVM);
603 * @param pVM Pointer to the VM.
605 VMMR3_INT_DECL(int) gimR3HvDisableTscPage(PVM pVM)
607 PGIMHV pHv = &pVM->gim.s.u.Hv;
611 GIMR3Mmio2Unmap(pVM, pRegion);
615 TMR3CpuTickParavirtDisable(pVM);
627 VMMR3_INT_DECL(int) gimR3HvDisableHypercallPage(PVM pVM)
629 PGIMHV pHv = &pVM->gim.s.u.Hv;
633 GIMR3Mmio2Unmap(pVM, pRegion);
635 for (VMCPUID i = 0; i < pVM->cCpus; i++)
636 VMMHypercallsDisable(&pVM->aCpus[i]);
648 * @param pVM Pointer to the VM.
651 VMMR3_INT_DECL(int) gimR3HvEnableHypercallPage(PVM pVM, RTGCPHYS GCPhysHypercallPage)
653 PPDMDEVINSR3 pDevIns = pVM->gim.s.pDevInsR3;
654 PGIMMMIO2REGION pRegion = &pVM->gim.s.u.Hv.aMmio2Regions[GIM_HV_HYPERCALL_PAGE_REGION_IDX];
668 int rc2 = gimR3HvDisableHypercallPage(pVM);
676 int rc = GIMR3Mmio2Map(pVM, pRegion, GCPhysHypercallPage);
685 rc = VMMPatchHypercall(pVM, pRegion->pvPageR3, PAGE_SIZE, &cbWritten);
695 for (VMCPUID i = 0; i < pVM->cCpus; i++)
696 VMMHypercallsEnable(&pVM->aCpus[i]);
708 GIMR3Mmio2Unmap(pVM, pRegion);