- Timestamp:
- Sep 2, 2008 11:06:07 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM/PATM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PATM/PATMInternal.h
r11925 r11967 43 43 # define PATM_SSM_VERSION_GETPUTMEM 53 44 44 #else 45 # define PATM_SSM_VERSION 53 45 # define PATM_SSM_VERSION 54 46 # define PATM_SSM_VERSION_VER16 53 46 47 #endif 47 48 -
trunk/src/VBox/VMM/PATM/PATMSSM.cpp
r11941 r11967 56 56 #define PATM_ADD_PTR(a, b) *(uintptr_t *)&(a) = (uintptr_t)(a) + (uintptr_t)(b) 57 57 58 static void patmCorrectFixup(PVM pVM, PATM &patmInfo, PPATCHINFO pPatch, PRELOCREC pRec, int32_t offset, RTRCPTR *pFixup);58 static void patmCorrectFixup(PVM pVM, unsigned ulSSMVersion, PATM &patmInfo, PPATCHINFO pPatch, PRELOCREC pRec, int32_t offset, RTRCPTR *pFixup); 59 59 60 60 #ifdef VBOX_STRICT … … 285 285 286 286 if ( u32Version != PATM_SSM_VERSION 287 && u32Version != PATM_SSM_VERSION_VER16 287 288 #ifdef PATM_WITH_NEW_SSM 288 289 && u32Version != PATM_SSM_VERSION_GETPUTMEM) … … 611 612 } 612 613 613 patmCorrectFixup(pVM, patmInfo, &pPatchRec->patch, &rec, offset, pFixup);614 patmCorrectFixup(pVM, u32Version, patmInfo, &pPatchRec->patch, &rec, offset, pFixup); 614 615 } 615 616 … … 686 687 687 688 /* Correct fixups that refer to PATM structures in the hypervisor region (their addresses might have changed). */ 688 patmCorrectFixup(pVM, patmInfo, &pVM->patm.s.pGlobalPatchRec->patch, pRec, offset, pFixup);689 patmCorrectFixup(pVM, u32Version, patmInfo, &pVM->patm.s.pGlobalPatchRec->patch, pRec, offset, pFixup); 689 690 } 690 691 … … 706 707 * @returns VBox status code. 707 708 * @param pVM VM Handle. 709 * @param ulSSMVersion SSM version 708 710 * @param patmInfo Saved PATM structure 709 711 * @param pPatch Patch record … … 712 714 * @param pFixup Fixup address 713 715 */ 714 static void patmCorrectFixup(PVM pVM, PATM &patmInfo, PPATCHINFO pPatch, PRELOCREC pRec, int32_t offset, RTRCPTR *pFixup)716 static void patmCorrectFixup(PVM pVM, unsigned ulSSMVersion, PATM &patmInfo, PPATCHINFO pPatch, PRELOCREC pRec, int32_t offset, RTRCPTR *pFixup) 715 717 { 716 718 int32_t delta = pVM->patm.s.pPatchMemGC - patmInfo.pPatchMemGC; … … 734 736 { 735 737 LogFlow(("Changing absolute CPUMCTX from %VRv (%VRv) to %VRv\n", patmInfo.pPatchMemGC + offset, *pFixup, (*pFixup - patmInfo.pCPUMCtxGC) + pVM->patm.s.pCPUMCtxGC)); 736 *pFixup = (*pFixup - patmInfo.pCPUMCtxGC) + pVM->patm.s.pCPUMCtxGC; 738 739 /* The CPUMCTX structure has completely changed, so correct the offsets too. */ 740 if (ulSSMVersion == PATM_SSM_VERSION_VER16) 741 { 742 unsigned uCPUMOffset = *pFixup - patmInfo.pCPUMCtxGC; 743 744 switch(uCPUMOffset) 745 { 746 case RT_OFFSETOF(CPUMCTX_VER1_6, dr0): 747 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, dr0); 748 break; 749 case RT_OFFSETOF(CPUMCTX_VER1_6, dr1): 750 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, dr1); 751 break; 752 case RT_OFFSETOF(CPUMCTX_VER1_6, dr2): 753 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, dr2); 754 break; 755 case RT_OFFSETOF(CPUMCTX_VER1_6, dr3): 756 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, dr3); 757 break; 758 case RT_OFFSETOF(CPUMCTX_VER1_6, dr4): 759 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, dr4); 760 break; 761 case RT_OFFSETOF(CPUMCTX_VER1_6, dr5): 762 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, dr5); 763 break; 764 case RT_OFFSETOF(CPUMCTX_VER1_6, dr6): 765 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, dr6); 766 break; 767 case RT_OFFSETOF(CPUMCTX_VER1_6, dr7): 768 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, dr7); 769 break; 770 case RT_OFFSETOF(CPUMCTX_VER1_6, cr0): 771 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, cr0); 772 break; 773 case RT_OFFSETOF(CPUMCTX_VER1_6, cr2): 774 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, cr2); 775 break; 776 case RT_OFFSETOF(CPUMCTX_VER1_6, cr3): 777 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, cr3); 778 break; 779 case RT_OFFSETOF(CPUMCTX_VER1_6, cr4): 780 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, cr4); 781 break; 782 case RT_OFFSETOF(CPUMCTX_VER1_6, tr): 783 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, tr); 784 break; 785 case RT_OFFSETOF(CPUMCTX_VER1_6, ldtr): 786 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, ldtr); 787 break; 788 case RT_OFFSETOF(CPUMCTX_VER1_6, gdtr.pGdt): 789 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, gdtr.pGdt); 790 break; 791 case RT_OFFSETOF(CPUMCTX_VER1_6, gdtr.cbGdt): 792 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, gdtr.cbGdt); 793 break; 794 case RT_OFFSETOF(CPUMCTX_VER1_6, idtr.pIdt): 795 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, idtr.pIdt); 796 break; 797 case RT_OFFSETOF(CPUMCTX_VER1_6, idtr.cbIdt): 798 *pFixup = pVM->patm.s.pCPUMCtxGC + RT_OFFSETOF(CPUMCTX, idtr.cbIdt); 799 break; 800 default: 801 AssertFailed(); 802 break; 803 } 804 } 805 else 806 *pFixup = (*pFixup - patmInfo.pCPUMCtxGC) + pVM->patm.s.pCPUMCtxGC; 737 807 } 738 808 else
Note:
See TracChangeset
for help on using the changeset viewer.