Changeset 58331 in vbox for trunk/src/VBox
- Timestamp:
- Oct 20, 2015 11:25:21 AM (9 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/GIMAllHv.cpp
r58284 r58331 247 247 if (rcHv == GIM_HV_STATUS_SUCCESS) 248 248 { 249 if (!fFlags) 249 if (fFlags) 250 LogRelMax(1, ("GIM: HyperV: Resetting debug session via hypercall\n")); 251 else 250 252 rcHv = GIM_HV_STATUS_INVALID_PARAMETER; 251 else252 LogRelMax(1, ("GIM: HyperV: Resetting debug session via hypercall\n"));253 253 } 254 254 } … … 492 492 493 493 case MSR_GIM_HV_CRASH_CTL: 494 *puValue = pHv->uCrashCtl ;495 return VINF_SUCCESS; 496 497 case MSR_GIM_HV_CRASH_P0: *puValue = pHv->uCrashP0 ; return VINF_SUCCESS;498 case MSR_GIM_HV_CRASH_P1: *puValue = pHv->uCrashP1 ; return VINF_SUCCESS;499 case MSR_GIM_HV_CRASH_P2: *puValue = pHv->uCrashP2 ; return VINF_SUCCESS;500 case MSR_GIM_HV_CRASH_P3: *puValue = pHv->uCrashP3 ; return VINF_SUCCESS;501 case MSR_GIM_HV_CRASH_P4: *puValue = pHv->uCrashP4 ; return VINF_SUCCESS;494 *puValue = pHv->uCrashCtlMsr; 495 return VINF_SUCCESS; 496 497 case MSR_GIM_HV_CRASH_P0: *puValue = pHv->uCrashP0Msr; return VINF_SUCCESS; 498 case MSR_GIM_HV_CRASH_P1: *puValue = pHv->uCrashP1Msr; return VINF_SUCCESS; 499 case MSR_GIM_HV_CRASH_P2: *puValue = pHv->uCrashP2Msr; return VINF_SUCCESS; 500 case MSR_GIM_HV_CRASH_P3: *puValue = pHv->uCrashP3Msr; return VINF_SUCCESS; 501 case MSR_GIM_HV_CRASH_P4: *puValue = pHv->uCrashP4Msr; return VINF_SUCCESS; 502 502 503 503 case MSR_GIM_HV_DEBUG_OPTIONS_MSR: … … 716 716 { 717 717 LogRel(("GIM: HyperV: Guest indicates a fatal condition! P0=%#RX64 P1=%#RX64 P2=%#RX64 P3=%#RX64 P4=%#RX64\n", 718 pHv->uCrashP0 , pHv->uCrashP1, pHv->uCrashP2, pHv->uCrashP3, pHv->uCrashP4));718 pHv->uCrashP0Msr, pHv->uCrashP1Msr, pHv->uCrashP2Msr, pHv->uCrashP3Msr, pHv->uCrashP4Msr)); 719 719 } 720 720 return VINF_SUCCESS; … … 924 924 } 925 925 926 case MSR_GIM_HV_CRASH_P0: pHv->uCrashP0 = uRawValue; return VINF_SUCCESS;927 case MSR_GIM_HV_CRASH_P1: pHv->uCrashP1 = uRawValue; return VINF_SUCCESS;928 case MSR_GIM_HV_CRASH_P2: pHv->uCrashP2 = uRawValue; return VINF_SUCCESS;929 case MSR_GIM_HV_CRASH_P3: pHv->uCrashP3 = uRawValue; return VINF_SUCCESS;930 case MSR_GIM_HV_CRASH_P4: pHv->uCrashP4 = uRawValue; return VINF_SUCCESS;926 case MSR_GIM_HV_CRASH_P0: pHv->uCrashP0Msr = uRawValue; return VINF_SUCCESS; 927 case MSR_GIM_HV_CRASH_P1: pHv->uCrashP1Msr = uRawValue; return VINF_SUCCESS; 928 case MSR_GIM_HV_CRASH_P2: pHv->uCrashP2Msr = uRawValue; return VINF_SUCCESS; 929 case MSR_GIM_HV_CRASH_P3: pHv->uCrashP3Msr = uRawValue; return VINF_SUCCESS; 930 case MSR_GIM_HV_CRASH_P4: pHv->uCrashP4Msr = uRawValue; return VINF_SUCCESS; 931 931 932 932 case MSR_GIM_HV_TIME_REF_COUNT: /* Read-only MSRs. */ -
trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
r58316 r58331 45 45 * GIM Hyper-V saved-state version. 46 46 */ 47 #define GIM_HV_SAVED_STATE_VERSION UINT32_C(1) 47 #define GIM_HV_SAVED_STATE_VERSION UINT32_C(2) 48 /** Vanilla saved states, prior to any debug support. */ 49 #define GIM_HV_SAVED_STATE_VERSION_PRE_DEBUG UINT32_C(1) 48 50 49 51 #ifdef VBOX_WITH_STATISTICS … … 426 428 */ 427 429 if (pHv->uMiscFeat & GIM_HV_MISC_FEAT_GUEST_CRASH_MSRS) 428 pHv->uCrashCtl = MSR_GIM_HV_CRASH_CTL_NOTIFY_BIT;430 pHv->uCrashCtlMsr = MSR_GIM_HV_CRASH_CTL_NOTIFY_BIT; 429 431 for (VMCPUID i = 0; i < pVM->cCpus; i++) 430 432 pVM->aCpus[i].gim.s.u.HvCpu.uSint2Msr = MSR_GIM_HV_SINT_MASKED_BIT; … … 560 562 pHv->u64HypercallMsr = 0; 561 563 pHv->u64TscPageMsr = 0; 562 pHv->uCrashP0 563 pHv->uCrashP1 564 pHv->uCrashP2 565 pHv->uCrashP3 566 pHv->uCrashP4 564 pHv->uCrashP0Msr = 0; 565 pHv->uCrashP1Msr = 0; 566 pHv->uCrashP2Msr = 0; 567 pHv->uCrashP3Msr = 0; 568 pHv->uCrashP4Msr = 0; 567 569 pHv->uDebugStatusMsr = 0; 568 570 pHv->uDebugPendingBufferMsr = 0; … … 656 658 uTscSequence = pcRefTsc->u32TscSequence; 657 659 } 658 659 return SSMR3PutU32(pSSM, uTscSequence); 660 SSMR3PutU32(pSSM, uTscSequence); 661 662 /* 663 * Save debug support data. 664 */ 665 SSMR3PutU64(pSSM, pcHv->uDebugPendingBufferMsr); 666 SSMR3PutU64(pSSM, pcHv->uDebugSendBufferMsr); 667 SSMR3PutU64(pSSM, pcHv->uDebugRecvBufferMsr); 668 SSMR3PutU64(pSSM, pcHv->uDebugStatusMsr); 669 SSMR3PutU32(pSSM, pcHv->enmDebugReply); 670 SSMR3PutU32(pSSM, pcHv->uBootpXId); 671 SSMR3PutU32(pSSM, pcHv->DbgGuestIp4Addr.u); 672 673 for (VMCPUID i = 0; i < pVM->cCpus; i++) 674 { 675 PGIMHVCPU pHvCpu = &pVM->aCpus[i].gim.s.u.HvCpu; 676 SSMR3PutU64(pSSM, pHvCpu->uSimpMsr); 677 SSMR3PutU64(pSSM, pHvCpu->uSint2Msr); 678 } 679 680 return SSMR3PutU8(pSSM, UINT8_MAX);; 660 681 } 661 682 … … 677 698 int rc = SSMR3GetU32(pSSM, &uHvSavedStatVersion); 678 699 AssertRCReturn(rc, rc); 679 if (uHvSavedStatVersion != GIM_HV_SAVED_STATE_VERSION) 700 if ( uHvSavedStatVersion != GIM_HV_SAVED_STATE_VERSION 701 && uHvSavedStatVersion != GIM_HV_SAVED_STATE_VERSION_PRE_DEBUG) 680 702 return SSMR3SetLoadError(pSSM, VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION, RT_SRC_POS, 681 N_("Unsupported Hyper-V saved-state version %u ( expected %u)."), uHvSavedStatVersion,703 N_("Unsupported Hyper-V saved-state version %u (current %u)!"), uHvSavedStatVersion, 682 704 GIM_HV_SAVED_STATE_VERSION); 683 705 … … 765 787 } 766 788 767 return rc; 789 /* 790 * Load the debug support data. 791 */ 792 if (uHvSavedStatVersion > GIM_HV_SAVED_STATE_VERSION_PRE_DEBUG) 793 { 794 SSMR3GetU64(pSSM, &pHv->uDebugPendingBufferMsr); 795 SSMR3GetU64(pSSM, &pHv->uDebugSendBufferMsr); 796 SSMR3GetU64(pSSM, &pHv->uDebugRecvBufferMsr); 797 SSMR3GetU64(pSSM, &pHv->uDebugStatusMsr); 798 SSMR3GetU32(pSSM, (uint32_t *)&pHv->enmDebugReply); 799 SSMR3GetU32(pSSM, &pHv->uBootpXId); 800 rc = SSMR3GetU32(pSSM, &pHv->DbgGuestIp4Addr.u); 801 AssertRCReturn(rc, rc); 802 803 for (VMCPUID i = 0; i < pVM->cCpus; i++) 804 { 805 PGIMHVCPU pHvCpu = &pVM->aCpus[i].gim.s.u.HvCpu; 806 SSMR3GetU64(pSSM, &pHvCpu->uSimpMsr); 807 SSMR3GetU64(pSSM, &pHvCpu->uSint2Msr); 808 } 809 } 810 811 uint8_t bDelim; 812 return SSMR3GetU8(pSSM, &bDelim); 768 813 } 769 814 … … 1169 1214 pIpHdr->ip_sum = 0; 1170 1215 pIpHdr->ip_src.u = 0; 1171 pIpHdr->ip_dst.u = pHv->DbgGuest Addr.u;1216 pIpHdr->ip_dst.u = pHv->DbgGuestIp4Addr.u; 1172 1217 pIpHdr->ip_sum = RTNetIPv4HdrChecksum(pIpHdr); 1173 1218 /* UDP */ … … 1379 1424 pbData += cbFrameHdr; 1380 1425 cbWrite -= cbFrameHdr; 1381 pHv->DbgGuest Addr = pIp4Hdr->ip_src;1382 pHv->enmDebugReply = GIMHVDEBUGREPLY_UDP;1426 pHv->DbgGuestIp4Addr = pIp4Hdr->ip_src; 1427 pHv->enmDebugReply = GIMHVDEBUGREPLY_UDP; 1383 1428 } 1384 1429 else -
trunk/src/VBox/VMM/include/GIMHvInternal.h
r58313 r58331 944 944 /** 945 945 * Type of the next reply to be sent to the debug connection of the guest. 946 * 947 * @remarks This is saved as part of saved-state, so don't re-order or 948 * alter the size! 946 949 */ 947 950 typedef enum GIMHVDEBUGREPLY … … 964 967 GIMHVDEBUGREPLY_32BIT_HACK = 0x7fff0000 965 968 } GIMHVDEBUGREPLY; 966 AssertCompileSize(GIMHVDEBUGREPLY, 4);969 AssertCompileSize(GIMHVDEBUGREPLY, sizeof(uint32_t)); 967 970 968 971 /** … … 1002 1005 */ 1003 1006 /** Guest crash control MSR. */ 1004 uint64_t uCrashCtl ;1007 uint64_t uCrashCtlMsr; 1005 1008 /** Guest crash parameter 0 MSR. */ 1006 uint64_t uCrashP0 ;1009 uint64_t uCrashP0Msr; 1007 1010 /** Guest crash parameter 1 MSR. */ 1008 uint64_t uCrashP1 ;1011 uint64_t uCrashP1Msr; 1009 1012 /** Guest crash parameter 2 MSR. */ 1010 uint64_t uCrashP2 ;1013 uint64_t uCrashP2Msr; 1011 1014 /** Guest crash parameter 3 MSR. */ 1012 uint64_t uCrashP3 ;1015 uint64_t uCrashP3Msr; 1013 1016 /** Guest crash parameter 4 MSR. */ 1014 uint64_t uCrashP4 ;1017 uint64_t uCrashP4Msr; 1015 1018 /** @} */ 1016 1019 … … 1046 1049 bool afAlignment0[6]; 1047 1050 /** The auto IP address last chosen by the guest after failed ARP queries. */ 1048 RTNETADDRIPV4 DbgGuest Addr;1051 RTNETADDRIPV4 DbgGuestIp4Addr; 1049 1052 /** The action to take while sending replies. */ 1050 1053 GIMHVDEBUGREPLY enmDebugReply;
Note:
See TracChangeset
for help on using the changeset viewer.