Lines Matching defs:pPatch

1741         PHMTPRPATCH pPatch = &pVM->hm.s.aPatches[i];
1742 RTGCPTR pInstrGC = (RTGCPTR)pPatch->Core.Key;
1755 rc = PGMPhysSimpleReadGCPtr(pVCpu, abInstr, pInstrGC, pPatch->cbNewOp);
1762 if (memcmp(abInstr, pPatch->aNewOpcode, pPatch->cbNewOp))
1768 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pInstrGC, pPatch->aOpcode, pPatch->cbOp);
1884 PHMTPRPATCH pPatch = (PHMTPRPATCH)RTAvloU32Get(&pVM->hm.s.PatchTree, (AVLOU32KEY)pCtx->eip);
1885 if (pPatch)
1896 pPatch = &pVM->hm.s.aPatches[idx];
1914 rc = PGMPhysSimpleReadGCPtr(pVCpu, pPatch->aOpcode, pCtx->rip, cbOp);
1917 pPatch->cbOp = cbOp;
1924 pPatch->enmType = HMTPRINSTR_WRITE_REG;
1925 pPatch->uSrcOperand = pDis->Param2.Base.idxGenReg;
1931 pPatch->enmType = HMTPRINSTR_WRITE_IMM;
1932 pPatch->uSrcOperand = pDis->Param2.uValue;
1938 memcpy(pPatch->aNewOpcode, s_abVMMCall, sizeof(s_abVMMCall));
1939 pPatch->cbNewOp = sizeof(s_abVMMCall);
1974 rc = PGMPhysSimpleReadGCPtr(pVCpu, &pPatch->aOpcode, pCtx->rip, cbOpMmio + cbOp);
1977 pPatch->cbOp = cbOpMmio + cbOp;
1984 for (unsigned i = 4; i < pPatch->cbOp; i++)
1987 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, abInstr, pPatch->cbOp);
1990 memcpy(pPatch->aNewOpcode, abInstr, pPatch->cbOp);
1991 pPatch->cbNewOp = pPatch->cbOp;
1994 pPatch->enmType = HMTPRINSTR_READ_SHR4;
1998 pPatch->enmType = HMTPRINSTR_READ;
1999 pPatch->uDstOperand = idxMmioReg;
2004 memcpy(pPatch->aNewOpcode, s_abVMMCall, sizeof(s_abVMMCall));
2005 pPatch->cbNewOp = sizeof(s_abVMMCall);
2006 Log(("hmR3ReplaceTprInstr: HMTPRINSTR_READ %u\n", pPatch->uDstOperand));
2010 pPatch->Core.Key = pCtx->eip;
2011 rc = RTAvloU32Insert(&pVM->hm.s.PatchTree, &pPatch->Core);
2023 pPatch->Core.Key = pCtx->eip;
2024 pPatch->enmType = HMTPRINSTR_INVALID;
2025 rc = RTAvloU32Insert(&pVM->hm.s.PatchTree, &pPatch->Core);
2058 PHMTPRPATCH pPatch = (PHMTPRPATCH)RTAvloU32Get(&pVM->hm.s.PatchTree, (AVLOU32KEY)pCtx->eip);
2059 if (pPatch)
2070 pPatch = &pVM->hm.s.aPatches[idx];
2089 rc = PGMPhysSimpleReadGCPtr(pVCpu, pPatch->aOpcode, pCtx->rip, cbOp);
2092 pPatch->cbOp = cbOp;
2093 pPatch->enmType = HMTPRINSTR_JUMP_REPLACEMENT;
2224 pPatch->aNewOpcode[0] = 0xE9;
2225 *(RTRCUINTPTR *)&pPatch->aNewOpcode[1] = ((RTRCUINTPTR)pVM->hm.s.pFreeGuestPatchMem) - ((RTRCUINTPTR)pCtx->eip + 5);
2228 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->eip, pPatch->aNewOpcode, 5);
2234 pPatch->cbNewOp = 5;
2236 pPatch->Core.Key = pCtx->eip;
2237 rc = RTAvloU32Insert(&pVM->hm.s.PatchTree, &pPatch->Core);
2255 pPatch = &pVM->hm.s.aPatches[idx];
2256 pPatch->Core.Key = pCtx->eip;
2257 pPatch->enmType = HMTPRINSTR_INVALID;
2258 rc = RTAvloU32Insert(&pVM->hm.s.PatchTree, &pPatch->Core);
3058 PHMTPRPATCH pPatch = &pVM->hm.s.aPatches[i];
3060 rc = SSMR3PutU32(pSSM, pPatch->Core.Key);
3063 rc = SSMR3PutMem(pSSM, pPatch->aOpcode, sizeof(pPatch->aOpcode));
3066 rc = SSMR3PutU32(pSSM, pPatch->cbOp);
3069 rc = SSMR3PutMem(pSSM, pPatch->aNewOpcode, sizeof(pPatch->aNewOpcode));
3072 rc = SSMR3PutU32(pSSM, pPatch->cbNewOp);
3076 rc = SSMR3PutU32(pSSM, (uint32_t)pPatch->enmType);
3079 rc = SSMR3PutU32(pSSM, pPatch->uSrcOperand);
3082 rc = SSMR3PutU32(pSSM, pPatch->uDstOperand);
3085 rc = SSMR3PutU32(pSSM, pPatch->pJumpTarget);
3088 rc = SSMR3PutU32(pSSM, pPatch->cFaults);
3159 PHMTPRPATCH pPatch = &pVM->hm.s.aPatches[i];
3161 rc = SSMR3GetU32(pSSM, &pPatch->Core.Key);
3164 rc = SSMR3GetMem(pSSM, pPatch->aOpcode, sizeof(pPatch->aOpcode));
3167 rc = SSMR3GetU32(pSSM, &pPatch->cbOp);
3170 rc = SSMR3GetMem(pSSM, pPatch->aNewOpcode, sizeof(pPatch->aNewOpcode));
3173 rc = SSMR3GetU32(pSSM, &pPatch->cbNewOp);
3176 rc = SSMR3GetU32(pSSM, (uint32_t *)&pPatch->enmType);
3179 if (pPatch->enmType == HMTPRINSTR_JUMP_REPLACEMENT)
3182 Assert(pPatch->enmType == HMTPRINSTR_JUMP_REPLACEMENT || pVM->hm.s.fTPRPatchingActive == false);
3184 rc = SSMR3GetU32(pSSM, &pPatch->uSrcOperand);
3187 rc = SSMR3GetU32(pSSM, &pPatch->uDstOperand);
3190 rc = SSMR3GetU32(pSSM, &pPatch->cFaults);
3193 rc = SSMR3GetU32(pSSM, &pPatch->pJumpTarget);
3197 Log(("Key = %x\n", pPatch->Core.Key));
3198 Log(("cbOp = %d\n", pPatch->cbOp));
3199 Log(("cbNewOp = %d\n", pPatch->cbNewOp));
3200 Log(("type = %d\n", pPatch->enmType));
3201 Log(("srcop = %d\n", pPatch->uSrcOperand));
3202 Log(("dstop = %d\n", pPatch->uDstOperand));
3203 Log(("cFaults = %d\n", pPatch->cFaults));
3204 Log(("target = %x\n", pPatch->pJumpTarget));
3205 rc = RTAvloU32Insert(&pVM->hm.s.PatchTree, &pPatch->Core);