Lines Matching refs:patmInfo
145 static int patmCorrectFixup(PVM pVM, unsigned ulSSMVersion, PATM &patmInfo, PPATCHINFO pPatch, PRELOCREC pRec,
733 PATM patmInfo = pVM->patm.s;
741 patmInfo.pPatchMemHC = NULL;
742 patmInfo.pGCStateHC = 0;
743 patmInfo.pvFaultMonitor = 0;
745 Assert(patmInfo.ulCallDepth == 0);
750 patmInfo.savedstate.cPatches = 0;
751 RTAvloU32DoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, patmCountPatch, &patmInfo.savedstate.cPatches);
756 rc = SSMR3PutStructEx(pSSM, &patmInfo, sizeof(patmInfo), 0 /*fFlags*/, &g_aPatmFields[0], NULL);
801 PATM patmInfo;
821 RT_ZERO(patmInfo);
825 rc = SSMR3GetStructEx(pSSM, &patmInfo, sizeof(patmInfo), SSMSTRUCT_FLAGS_MEM_BAND_AID_RELAXED,
828 rc = SSMR3GetStructEx(pSSM, &patmInfo, sizeof(patmInfo), fStructRestoreFlags, &g_aPatmFields[0], NULL);
833 AssertLogRelReturn((pVM->patm.s.pfnHelperCallGC - pVM->patm.s.pPatchMemGC) == (patmInfo.pfnHelperCallGC - patmInfo.pPatchMemGC),
835 AssertLogRelReturn((pVM->patm.s.pfnHelperRetGC - pVM->patm.s.pPatchMemGC) == (patmInfo.pfnHelperRetGC - patmInfo.pPatchMemGC),
837 AssertLogRelReturn((pVM->patm.s.pfnHelperJumpGC - pVM->patm.s.pPatchMemGC) == (patmInfo.pfnHelperJumpGC - patmInfo.pPatchMemGC),
839 AssertLogRelReturn((pVM->patm.s.pfnHelperIretGC - pVM->patm.s.pPatchMemGC) == (patmInfo.pfnHelperIretGC - patmInfo.pPatchMemGC),
841 AssertLogRelReturn(pVM->patm.s.cbPatchMem == patmInfo.cbPatchMem, VERR_SSM_DATA_UNIT_FORMAT_CHANGED);
843 pVM->patm.s.offPatchMem = patmInfo.offPatchMem;
844 pVM->patm.s.deltaReloc = patmInfo.deltaReloc;
845 pVM->patm.s.uCurrentPatchIdx = patmInfo.uCurrentPatchIdx;
846 pVM->patm.s.fOutOfMemory = patmInfo.fOutOfMemory;
849 pVM->patm.s.pPatchedInstrGCLowest = patmInfo.pPatchedInstrGCLowest;
850 pVM->patm.s.pPatchedInstrGCHighest = patmInfo.pPatchedInstrGCHighest;
853 pVM->patm.s.pfnSysEnterGC = patmInfo.pfnSysEnterGC;
854 pVM->patm.s.pfnSysEnterPatchGC = patmInfo.pfnSysEnterPatchGC;
855 pVM->patm.s.uSysEnterPatchIdx = patmInfo.uSysEnterPatchIdx;
857 Assert(patmInfo.ulCallDepth == 0 && pVM->patm.s.ulCallDepth == 0);
859 Log(("pPatchMemGC %RRv vs old %RRv\n", pVM->patm.s.pPatchMemGC, patmInfo.pPatchMemGC));
860 Log(("pGCStateGC %RRv vs old %RRv\n", pVM->patm.s.pGCStateGC, patmInfo.pGCStateGC));
861 Log(("pGCStackGC %RRv vs old %RRv\n", pVM->patm.s.pGCStackGC, patmInfo.pGCStackGC));
862 Log(("pCPUMCtxGC %RRv vs old %RRv\n", pVM->patm.s.pCPUMCtxGC, patmInfo.pCPUMCtxGC));
870 Log(("Restore patch memory: new %RRv old %RRv\n", pVM->patm.s.pPatchMemGC, patmInfo.pPatchMemGC));
902 for (unsigned i = 0; i < patmInfo.savedstate.cPatches; i++)
926 Log(("Restoring patch %RRv -> %RRv state %x\n", pPatchRec->patch.pPrivInstrGC, patmInfo.pPatchMemGC + pPatchRec->patch.pPatchBlockOffset, pPatchRec->patch.uState));
986 rc = patmCorrectFixup(pVM, uVersion, patmInfo, &pPatchRec->patch, &rec, offset, pFixup);
1073 rc = patmCorrectFixup(pVM, uVersion, patmInfo, &pVM->patm.s.pGlobalPatchRec->patch, pRec, offset, pFixup);
1081 pVM->patm.s.StatDisabled = patmInfo.StatDisabled;
1082 pVM->patm.s.StatUnusable = patmInfo.StatUnusable;
1083 pVM->patm.s.StatEnabled = patmInfo.StatEnabled;
1084 pVM->patm.s.StatInstalled = patmInfo.StatInstalled;
1096 * @param patmInfo Saved PATM structure
1102 static int patmCorrectFixup(PVM pVM, unsigned uVersion, PATM &patmInfo, PPATCHINFO pPatch, PRELOCREC pRec,
1105 int32_t delta = pVM->patm.s.pPatchMemGC - patmInfo.pPatchMemGC;
1122 if ( uFixup >= patmInfo.pGCStateGC
1123 && uFixup < patmInfo.pGCStateGC + sizeof(PATMGCSTATE))
1125 LogFlow(("Changing absolute GCState at %RRv from %RRv to %RRv\n", patmInfo.pPatchMemGC + offset, uFixup, (uFixup - patmInfo.pGCStateGC) + pVM->patm.s.pGCStateGC));
1126 *pFixup = (uFixup - patmInfo.pGCStateGC) + pVM->patm.s.pGCStateGC;
1128 else if ( uFixup >= patmInfo.pCPUMCtxGC
1129 && uFixup < patmInfo.pCPUMCtxGC + sizeof(CPUMCTX))
1131 LogFlow(("Changing absolute CPUMCTX at %RRv from %RRv to %RRv\n", patmInfo.pPatchMemGC + offset, uFixup, (uFixup - patmInfo.pCPUMCtxGC) + pVM->patm.s.pCPUMCtxGC));
1136 unsigned offCpumCtx = uFixup - patmInfo.pCPUMCtxGC;
1235 *pFixup = (uFixup - patmInfo.pCPUMCtxGC) + pVM->patm.s.pCPUMCtxGC;
1237 else if ( uFixup >= patmInfo.pStatsGC
1238 && uFixup < patmInfo.pStatsGC + PATM_STAT_MEMSIZE)
1240 LogFlow(("Changing absolute Stats at %RRv from %RRv to %RRv\n", patmInfo.pPatchMemGC + offset, uFixup, (uFixup - patmInfo.pStatsGC) + pVM->patm.s.pStatsGC));
1241 *pFixup = (uFixup - patmInfo.pStatsGC) + pVM->patm.s.pStatsGC;
1243 else if ( uFixup >= patmInfo.pGCStackGC
1244 && uFixup < patmInfo.pGCStackGC + PATM_STACK_TOTAL_SIZE)
1246 LogFlow(("Changing absolute Stack at %RRv from %RRv to %RRv\n", patmInfo.pPatchMemGC + offset, uFixup, (uFixup - patmInfo.pGCStackGC) + pVM->patm.s.pGCStackGC));
1247 *pFixup = (uFixup - patmInfo.pGCStackGC) + pVM->patm.s.pGCStackGC;
1249 else if ( uFixup >= patmInfo.pPatchMemGC
1250 && uFixup < patmInfo.pPatchMemGC + patmInfo.cbPatchMem)
1252 LogFlow(("Changing absolute PatchMem at %RRv from %RRv to %RRv\n", patmInfo.pPatchMemGC + offset, uFixup, (uFixup - patmInfo.pPatchMemGC) + pVM->patm.s.pPatchMemGC));
1253 *pFixup = (uFixup - patmInfo.pPatchMemGC) + pVM->patm.s.pPatchMemGC;
1264 && uFixup - (patmInfo.pCPUMCtxGC & UINT32_C(0xffc00000)) < UINT32_C(32))
1272 && uFixup - (patmInfo.pCPUMCtxGC & UINT32_C(0xffc00000)) < UINT32_C(8192))