Changeset 62641 in vbox for trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
- Timestamp:
- Jul 28, 2016 9:11:13 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r62478 r62641 180 180 static void gimR3HvTermHypercallSupport(PVM pVM); 181 181 static int gimR3HvInitDebugSupport(PVM pVM); 182 #if 0 /** @todo currently unused, which is probably very wrong */ 182 183 static void gimR3HvTermDebugSupport(PVM pVM); 184 #endif 183 185 184 186 … … 319 321 Assert((pHv->uBaseFeat & (GIM_HV_BASE_FEAT_HYPERCALL_MSRS | GIM_HV_BASE_FEAT_VP_ID_MSR)) 320 322 == (GIM_HV_BASE_FEAT_HYPERCALL_MSRS | GIM_HV_BASE_FEAT_VP_ID_MSR)); 323 #ifdef VBOX_STRICT 321 324 for (unsigned i = 0; i < RT_ELEMENTS(pHv->aMmio2Regions); i++) 322 325 { 323 PCGIMMMIO2REGION pcCur = &pHv->aMmio2Regions[i]; 324 Assert(!pcCur->fRCMapping); 325 Assert(!pcCur->fMapped); 326 Assert(pcCur->GCPhysPage == NIL_RTGCPHYS); 327 } 326 PCGIMMMIO2REGION pCur = &pHv->aMmio2Regions[i]; 327 Assert(!pCur->fRCMapping); 328 Assert(!pCur->fMapped); 329 Assert(pCur->GCPhysPage == NIL_RTGCPHYS); 330 } 331 #endif 328 332 329 333 /* … … 660 664 * @returns VBox status code. 661 665 * @param pVM The cross context VM structure. 662 * @param pSSM Pointer to the SSMhandle.666 * @param pSSM The saved state handle. 663 667 */ 664 668 VMMR3_INT_DECL(int) gimR3HvSave(PVM pVM, PSSMHANDLE pSSM) 665 669 { 666 PCGIMHV p cHv = &pVM->gim.s.u.Hv;670 PCGIMHV pHv = &pVM->gim.s.u.Hv; 667 671 668 672 /* … … 674 678 * Save per-VM MSRs. 675 679 */ 676 SSMR3PutU64(pSSM, p cHv->u64GuestOsIdMsr);677 SSMR3PutU64(pSSM, p cHv->u64HypercallMsr);678 SSMR3PutU64(pSSM, p cHv->u64TscPageMsr);680 SSMR3PutU64(pSSM, pHv->u64GuestOsIdMsr); 681 SSMR3PutU64(pSSM, pHv->u64HypercallMsr); 682 SSMR3PutU64(pSSM, pHv->u64TscPageMsr); 679 683 680 684 /* 681 685 * Save Hyper-V features / capabilities. 682 686 */ 683 SSMR3PutU32(pSSM, p cHv->uBaseFeat);684 SSMR3PutU32(pSSM, p cHv->uPartFlags);685 SSMR3PutU32(pSSM, p cHv->uPowMgmtFeat);686 SSMR3PutU32(pSSM, p cHv->uMiscFeat);687 SSMR3PutU32(pSSM, p cHv->uHyperHints);688 SSMR3PutU32(pSSM, p cHv->uHyperCaps);687 SSMR3PutU32(pSSM, pHv->uBaseFeat); 688 SSMR3PutU32(pSSM, pHv->uPartFlags); 689 SSMR3PutU32(pSSM, pHv->uPowMgmtFeat); 690 SSMR3PutU32(pSSM, pHv->uMiscFeat); 691 SSMR3PutU32(pSSM, pHv->uHyperHints); 692 SSMR3PutU32(pSSM, pHv->uHyperCaps); 689 693 690 694 /* 691 695 * Save the Hypercall region. 692 696 */ 693 PCGIMMMIO2REGION p cRegion = &pcHv->aMmio2Regions[GIM_HV_HYPERCALL_PAGE_REGION_IDX];694 SSMR3PutU8(pSSM, p cRegion->iRegion);695 SSMR3PutBool(pSSM, p cRegion->fRCMapping);696 SSMR3PutU32(pSSM, p cRegion->cbRegion);697 SSMR3PutGCPhys(pSSM, p cRegion->GCPhysPage);698 SSMR3PutStrZ(pSSM, p cRegion->szDescription);697 PCGIMMMIO2REGION pRegion = &pHv->aMmio2Regions[GIM_HV_HYPERCALL_PAGE_REGION_IDX]; 698 SSMR3PutU8(pSSM, pRegion->iRegion); 699 SSMR3PutBool(pSSM, pRegion->fRCMapping); 700 SSMR3PutU32(pSSM, pRegion->cbRegion); 701 SSMR3PutGCPhys(pSSM, pRegion->GCPhysPage); 702 SSMR3PutStrZ(pSSM, pRegion->szDescription); 699 703 700 704 /* 701 705 * Save the reference TSC region. 702 706 */ 703 p cRegion = &pcHv->aMmio2Regions[GIM_HV_REF_TSC_PAGE_REGION_IDX];704 SSMR3PutU8(pSSM, p cRegion->iRegion);705 SSMR3PutBool(pSSM, p cRegion->fRCMapping);706 SSMR3PutU32(pSSM, p cRegion->cbRegion);707 SSMR3PutGCPhys(pSSM, p cRegion->GCPhysPage);708 SSMR3PutStrZ(pSSM, p cRegion->szDescription);707 pRegion = &pHv->aMmio2Regions[GIM_HV_REF_TSC_PAGE_REGION_IDX]; 708 SSMR3PutU8(pSSM, pRegion->iRegion); 709 SSMR3PutBool(pSSM, pRegion->fRCMapping); 710 SSMR3PutU32(pSSM, pRegion->cbRegion); 711 SSMR3PutGCPhys(pSSM, pRegion->GCPhysPage); 712 SSMR3PutStrZ(pSSM, pRegion->szDescription); 709 713 /* Save the TSC sequence so we can bump it on restore (as the CPU frequency/offset may change). */ 710 714 uint32_t uTscSequence = 0; 711 if ( p cRegion->fMapped712 && MSR_GIM_HV_REF_TSC_IS_ENABLED(p cHv->u64TscPageMsr))713 { 714 PCGIMHVREFTSC p cRefTsc = (PCGIMHVREFTSC)pcRegion->pvPageR3;715 uTscSequence = p cRefTsc->u32TscSequence;715 if ( pRegion->fMapped 716 && MSR_GIM_HV_REF_TSC_IS_ENABLED(pHv->u64TscPageMsr)) 717 { 718 PCGIMHVREFTSC pRefTsc = (PCGIMHVREFTSC)pRegion->pvPageR3; 719 uTscSequence = pRefTsc->u32TscSequence; 716 720 } 717 721 SSMR3PutU32(pSSM, uTscSequence); … … 720 724 * Save debug support data. 721 725 */ 722 SSMR3PutU64(pSSM, p cHv->uDbgPendingBufferMsr);723 SSMR3PutU64(pSSM, p cHv->uDbgSendBufferMsr);724 SSMR3PutU64(pSSM, p cHv->uDbgRecvBufferMsr);725 SSMR3PutU64(pSSM, p cHv->uDbgStatusMsr);726 SSMR3PutU32(pSSM, p cHv->enmDbgReply);727 SSMR3PutU32(pSSM, p cHv->uDbgBootpXId);728 SSMR3PutU32(pSSM, p cHv->DbgGuestIp4Addr.u);726 SSMR3PutU64(pSSM, pHv->uDbgPendingBufferMsr); 727 SSMR3PutU64(pSSM, pHv->uDbgSendBufferMsr); 728 SSMR3PutU64(pSSM, pHv->uDbgRecvBufferMsr); 729 SSMR3PutU64(pSSM, pHv->uDbgStatusMsr); 730 SSMR3PutU32(pSSM, pHv->enmDbgReply); 731 SSMR3PutU32(pSSM, pHv->uDbgBootpXId); 732 SSMR3PutU32(pSSM, pHv->DbgGuestIp4Addr.u); 729 733 730 734 for (VMCPUID i = 0; i < pVM->cCpus; i++) … … 735 739 } 736 740 737 return SSMR3PutU8(pSSM, UINT8_MAX); ;741 return SSMR3PutU8(pSSM, UINT8_MAX); 738 742 } 739 743 … … 744 748 * @returns VBox status code. 745 749 * @param pVM The cross context VM structure. 746 * @param pSSM Pointer to the SSM handle. 747 * @param uSSMVersion The GIM saved-state version. 748 */ 749 VMMR3_INT_DECL(int) gimR3HvLoad(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion) 750 * @param pSSM The saved state handle. 751 */ 752 VMMR3_INT_DECL(int) gimR3HvLoad(PVM pVM, PSSMHANDLE pSSM) 750 753 { 751 754 /* … … 758 761 && uHvSavedStatVersion != GIM_HV_SAVED_STATE_VERSION_PRE_DEBUG) 759 762 return SSMR3SetLoadError(pSSM, VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION, RT_SRC_POS, 760 N_("Unsupported Hyper-V saved-state version %u (current %u)!"), uHvSavedStatVersion,761 GIM_HV_SAVED_STATE_VERSION);763 N_("Unsupported Hyper-V saved-state version %u (current %u)!"), 764 uHvSavedStatVersion, GIM_HV_SAVED_STATE_VERSION); 762 765 763 766 /* … … 1342 1345 static int gimR3HvInitHypercallSupport(PVM pVM) 1343 1346 { 1344 int rc = VINF_SUCCESS;1345 1347 PGIMHV pHv = &pVM->gim.s.u.Hv; 1346 1348 pHv->pbHypercallIn = (uint8_t *)RTMemAllocZ(GIM_HV_PAGE_SIZE); … … 1393 1395 1394 1396 1397 #if 0 /** @todo currently unused, which is probably very wrong */ 1395 1398 /** 1396 1399 * Terminates Hyper-V guest debug support. … … 1407 1410 } 1408 1411 } 1412 #endif 1409 1413 1410 1414 … … 1864 1868 if (fFlags & ~GIM_HV_DEBUG_POST_OPTIONS_MASK)) 1865 1869 rcHv = GIM_HV_STATUS_INVALID_PARAMETER; 1870 #else 1871 RT_NOREF1(fFlags); 1866 1872 #endif 1867 1873 if (cbWrite > GIM_HV_DEBUG_MAX_DATA_SIZE)
Note:
See TracChangeset
for help on using the changeset viewer.