Changeset 23779 in vbox for trunk/src/VBox/VMM/PATM
- Timestamp:
- Oct 14, 2009 9:59:34 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53517
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PATM/PATMSSM.cpp
r22793 r23779 54 54 #include <VBox/disopcode.h> 55 55 56 /******************************************************************************* 57 * Defined Constants And Macros * 58 *******************************************************************************/ 56 59 #define PATM_SUBTRACT_PTR(a, b) *(uintptr_t *)&(a) = (uintptr_t)(a) - (uintptr_t)(b) 57 60 #define PATM_ADD_PTR(a, b) *(uintptr_t *)&(a) = (uintptr_t)(a) + (uintptr_t)(b) 58 61 62 /******************************************************************************* 63 * Internal Functions * 64 *******************************************************************************/ 59 65 static void patmCorrectFixup(PVM pVM, unsigned ulSSMVersion, PATM &patmInfo, PPATCHINFO pPatch, PRELOCREC pRec, int32_t offset, RTRCPTR *pFixup); 66 67 /******************************************************************************* 68 * Global Variables * 69 *******************************************************************************/ 70 static SSMFIELD const g_aPatmFields[] = 71 { 72 /** @todo there are a bunch more fields here which can be marked as ignored. */ 73 SSMFIELD_ENTRY_IGNORE( PATM, offVM), 74 SSMFIELD_ENTRY_RCPTR( PATM, pPatchMemGC), 75 SSMFIELD_ENTRY_IGN_HCPTR( PATM, pPatchMemHC), 76 SSMFIELD_ENTRY( PATM, cbPatchMem), 77 SSMFIELD_ENTRY( PATM, offPatchMem), 78 SSMFIELD_ENTRY( PATM, fOutOfMemory), 79 SSMFIELD_ENTRY_PAD_HC_AUTO( 3, 3), 80 SSMFIELD_ENTRY( PATM, deltaReloc), 81 SSMFIELD_ENTRY_IGN_HCPTR( PATM, pGCStateHC), 82 SSMFIELD_ENTRY_RCPTR( PATM, pGCStateGC), 83 SSMFIELD_ENTRY_RCPTR( PATM, pGCStackGC), 84 SSMFIELD_ENTRY_IGN_HCPTR( PATM, pGCStackHC), 85 SSMFIELD_ENTRY_RCPTR( PATM, pCPUMCtxGC), 86 SSMFIELD_ENTRY_RCPTR( PATM, pStatsGC), 87 SSMFIELD_ENTRY_IGN_HCPTR( PATM, pStatsHC), 88 SSMFIELD_ENTRY( PATM, uCurrentPatchIdx), 89 SSMFIELD_ENTRY( PATM, ulCallDepth), 90 SSMFIELD_ENTRY( PATM, cPageRecords), 91 SSMFIELD_ENTRY_RCPTR( PATM, pPatchedInstrGCLowest), 92 SSMFIELD_ENTRY_RCPTR( PATM, pPatchedInstrGCHighest), 93 SSMFIELD_ENTRY_RCPTR( PATM, PatchLookupTreeGC), 94 SSMFIELD_ENTRY_IGN_HCPTR( PATM, PatchLookupTreeHC), 95 SSMFIELD_ENTRY_RCPTR( PATM, pfnHelperCallGC), 96 SSMFIELD_ENTRY_RCPTR( PATM, pfnHelperRetGC), 97 SSMFIELD_ENTRY_RCPTR( PATM, pfnHelperJumpGC), 98 SSMFIELD_ENTRY_RCPTR( PATM, pfnHelperIretGC), 99 SSMFIELD_ENTRY_IGN_HCPTR( PATM, pGlobalPatchRec), 100 SSMFIELD_ENTRY_RCPTR( PATM, pfnSysEnterGC), 101 SSMFIELD_ENTRY_RCPTR( PATM, pfnSysEnterPatchGC), 102 SSMFIELD_ENTRY( PATM, uSysEnterPatchIdx), 103 SSMFIELD_ENTRY_RCPTR( PATM, pvFaultMonitor), 104 SSMFIELD_ENTRY_GCPHYS( PATM, mmio.GCPhys), 105 SSMFIELD_ENTRY_RCPTR( PATM, mmio.pCachedData), 106 SSMFIELD_ENTRY_IGN_RCPTR( PATM, mmio.Alignment0), 107 SSMFIELD_ENTRY_IGN_HCPTR( PATM, savedstate.pSSM), 108 SSMFIELD_ENTRY( PATM, savedstate.cPatches), 109 SSMFIELD_ENTRY_IGNORE( PATM, StatNrOpcodeRead), 110 SSMFIELD_ENTRY_IGNORE( PATM, StatDisabled), 111 SSMFIELD_ENTRY_IGNORE( PATM, StatUnusable), 112 SSMFIELD_ENTRY_IGNORE( PATM, StatEnabled), 113 SSMFIELD_ENTRY_IGNORE( PATM, StatInstalled), 114 SSMFIELD_ENTRY_IGNORE( PATM, StatInstalledFunctionPatches), 115 SSMFIELD_ENTRY_IGNORE( PATM, StatInstalledTrampoline), 116 SSMFIELD_ENTRY_IGNORE( PATM, StatInstalledJump), 117 SSMFIELD_ENTRY_IGNORE( PATM, StatInt3Callable), 118 SSMFIELD_ENTRY_IGNORE( PATM, StatInt3BlockRun), 119 SSMFIELD_ENTRY_IGNORE( PATM, StatOverwritten), 120 SSMFIELD_ENTRY_IGNORE( PATM, StatFixedConflicts), 121 SSMFIELD_ENTRY_IGNORE( PATM, StatFlushed), 122 SSMFIELD_ENTRY_IGNORE( PATM, StatPageBoundaryCrossed), 123 SSMFIELD_ENTRY_IGNORE( PATM, StatMonitored), 124 SSMFIELD_ENTRY_IGNORE( PATM, StatHandleTrap), 125 SSMFIELD_ENTRY_IGNORE( PATM, StatSwitchBack), 126 SSMFIELD_ENTRY_IGNORE( PATM, StatSwitchBackFail), 127 SSMFIELD_ENTRY_IGNORE( PATM, StatPATMMemoryUsed), 128 SSMFIELD_ENTRY_IGNORE( PATM, StatDuplicateREQSuccess), 129 SSMFIELD_ENTRY_IGNORE( PATM, StatDuplicateREQFailed), 130 SSMFIELD_ENTRY_IGNORE( PATM, StatDuplicateUseExisting), 131 SSMFIELD_ENTRY_IGNORE( PATM, StatFunctionFound), 132 SSMFIELD_ENTRY_IGNORE( PATM, StatFunctionNotFound), 133 SSMFIELD_ENTRY_IGNORE( PATM, StatPatchWrite), 134 SSMFIELD_ENTRY_IGNORE( PATM, StatPatchWriteDetect), 135 SSMFIELD_ENTRY_IGNORE( PATM, StatDirty), 136 SSMFIELD_ENTRY_IGNORE( PATM, StatPushTrap), 137 SSMFIELD_ENTRY_IGNORE( PATM, StatPatchWriteInterpreted), 138 SSMFIELD_ENTRY_IGNORE( PATM, StatPatchWriteInterpretedFailed), 139 SSMFIELD_ENTRY_IGNORE( PATM, StatSysEnter), 140 SSMFIELD_ENTRY_IGNORE( PATM, StatSysExit), 141 SSMFIELD_ENTRY_IGNORE( PATM, StatEmulIret), 142 SSMFIELD_ENTRY_IGNORE( PATM, StatEmulIretFailed), 143 SSMFIELD_ENTRY_IGNORE( PATM, StatInstrDirty), 144 SSMFIELD_ENTRY_IGNORE( PATM, StatInstrDirtyGood), 145 SSMFIELD_ENTRY_IGNORE( PATM, StatInstrDirtyBad), 146 SSMFIELD_ENTRY_IGNORE( PATM, StatPatchPageInserted), 147 SSMFIELD_ENTRY_IGNORE( PATM, StatPatchPageRemoved), 148 SSMFIELD_ENTRY_IGNORE( PATM, StatPatchRefreshSuccess), 149 SSMFIELD_ENTRY_IGNORE( PATM, StatPatchRefreshFailed), 150 SSMFIELD_ENTRY_IGNORE( PATM, StatGenRet), 151 SSMFIELD_ENTRY_IGNORE( PATM, StatGenRetReused), 152 SSMFIELD_ENTRY_IGNORE( PATM, StatGenJump), 153 SSMFIELD_ENTRY_IGNORE( PATM, StatGenCall), 154 SSMFIELD_ENTRY_IGNORE( PATM, StatGenPopf), 155 SSMFIELD_ENTRY_IGNORE( PATM, StatCheckPendingIRQ), 156 SSMFIELD_ENTRY_IGNORE( PATM, StatFunctionLookupReplace), 157 SSMFIELD_ENTRY_IGNORE( PATM, StatFunctionLookupInsert), 158 SSMFIELD_ENTRY_IGNORE( PATM, StatU32FunctionMaxSlotsUsed), 159 SSMFIELD_ENTRY_IGNORE( PATM, Alignment0), 160 SSMFIELD_ENTRY_TERM() 161 }; 162 60 163 61 164 #ifdef VBOX_STRICT … … 330 433 { 331 434 #endif 435 #if 0 332 436 rc = SSMR3GetMem(pSSM, &patmInfo, sizeof(patmInfo)); 333 AssertRCReturn(rc, rc); 437 #else 438 rc = SSMR3GetStructEx(pSSM, &patmInfo, sizeof(patmInfo), SSMSTRUCT_FLAGS_MEM_BAND_AID, &g_aPatmFields[0], NULL); 439 #endif 440 AssertRCReturn(rc, rc); 441 334 442 #ifdef PATM_WITH_NEW_SSM 335 443 } … … 483 591 { 484 592 #endif 593 #if 1 /** @todo LiveMigration / later? */ 485 594 rc = SSMR3GetMem(pSSM, pVM->patm.s.pGCStateHC, sizeof(PATMGCSTATE)); 595 #else 596 rc = SSMR3GetStructEx(pSSM, pVM->patm.s.pGCStateHC, sizeof(PATMGCSTATE), SSMSTRUCT_FLAGS_MEM_BAND_AID, &g_aPatmGCStateFields[0], NULL); 597 #endif 486 598 AssertRCReturn(rc, rc); 487 599 #ifdef PATM_WITH_NEW_SSM … … 572 684 PATMPATCHREC patch, *pPatchRec; 573 685 686 #if 1 /** @todo LiveMigration */ 574 687 rc = SSMR3GetMem(pSSM, &patch, sizeof(patch)); 688 #else 689 rc = SSMR3GetStructEx(pSSM, &patch, sizeof(patch), SSMSTRUCT_FLAGS_MEM_BAND_AID, &g_aPatmPatchRecFields[0], NULL); 690 #endif 575 691 AssertRCReturn(rc, rc); 576 692 … … 621 737 RTRCPTR *pFixup; 622 738 739 #if 1 /** @todo LiveMigration */ 623 740 rc = SSMR3GetMem(pSSM, &rec, sizeof(rec)); 741 #else 742 rc = SSMR3GetStructEx(pSSM, &rec, sizeof(rec), SSMSTRUCT_FLAGS_MEM_BAND_AID, &g_aPatmRelocRec[0], NULL); 743 #endif 624 744 AssertRCReturn(rc, rc); 625 745 … … 666 786 for (uint32_t i=0;i<nrPatch2GuestRecs;i++) 667 787 { 788 #if 1 /** @todo LiveMigration */ 668 789 rc = SSMR3GetMem(pSSM, &rec, sizeof(rec)); 790 #else 791 rc = SSMR3GetStructEx(pSSM, &rec, sizeof(rec), SSMSTRUCT_FLAGS_MEM_BAND_AID, &g_aPatmRecPatchToGuest[0], NULL); 792 #endif 793 669 794 AssertRCReturn(rc, rc); 670 795
Note:
See TracChangeset
for help on using the changeset viewer.