Lines Matching defs:pPage

77 bool                csamIsCodeScanned(PVM pVM, RTRCPTR pInstr, PCSAMPAGE *pPage);
82 static void csamMarkCode(PVM pVM, PCSAMPAGE pPage, RTRCPTR pInstr, uint32_t opsize, bool fScanned);
499 PCSAMPAGEREC pPage = (PCSAMPAGEREC)pNode;
500 CSAMPAGEREC page = *pPage;
648 PCSAMPAGE pPage;
657 pPage = csamCreatePageRecord(pVM, page.page.pPageGC, page.page.enmTag, page.page.fCode32, page.page.fMonitorInvalidation);
658 AssertReturn(pPage, VERR_NO_MEMORY);
660 pPage->GCPhys = page.page.GCPhys;
661 pPage->fFlags = page.page.fFlags;
662 pPage->u64Hash = page.page.u64Hash;
666 rc = SSMR3GetMem(pSSM, pPage->pBitmap, CSAM_PAGE_BITMAP_SIZE);
671 MMR3HeapFree(pPage->pBitmap);
672 pPage->pBitmap = 0;
842 PCSAMPAGE pPage = (PCSAMPAGE)pUserData;
888 bool fCode32 = pPage->fCode32;
902 if (csamIsCodeScanned(pVM, pCurInstrGC + cbCurInstr, &pPage) == true)
941 rc = PATMR3InstallPatch(pVM, pCurInstrGC, (pPage->fCode32) ? PATMFL_CODE32 : 0);
1016 rc = PATMR3InstallPatch(pVM, pCurInstrGC, (pPage->fCode32) ? PATMFL_CODE32 : 0);
1074 PCSAMPAGE pPage = 0;
1086 PCSAMPAGE pPage = 0;
1091 if (csamIsCodeScanned(pVM, pCurInstrGC, &pPage) == false)
1099 if (pPage == NULL)
1102 pPage = csamCreatePageRecord(pVM, pCurInstrGC, CSAM_TAG_CSAM, fCode32);
1103 if (pPage == NULL)
1199 if (csamIsCodeScanned(pVM, pCurInstrGC, &pPage) == false)
1225 if (csamIsCodeScanned(pVM, pCurInstrGC, &pPage) == false)
1245 csamMarkCode(pVM, pPage, pCurInstrGC, cbInstr, true);
1276 PCSAMPAGE pPage = (PCSAMPAGE)pUserData;
1310 if (csamIsCodeScanned(pVM, pCurInstrGC, &pPage) == false)
1312 if (pPage == NULL)
1315 pPage = csamCreatePageRecord(pVM, pCurInstrGC, CSAM_TAG_CSAM, fCode32);
1316 if (pPage == NULL)
1360 csamMarkCode(pVM, pPage, pCurInstrGC, cbInstr, true);
1382 AssertMsg(pfnCSAMR3Analyse(pVM, &cpu, pInstrGC, pCurInstrGC, pCacheRec, (void *)pPage) == VWRN_CONTINUE_ANALYSIS, ("Instruction incorrectly marked harmless?!?!?\n"));
1398 rc = pfnCSAMR3Analyse(pVM, &cpu, pInstrGC, pCurInstrGC, pCacheRec, (void *)pPage);
1453 Assert(pPage);
1519 Assert(pPage);
1820 PCSAMPAGEREC pPage;
1828 pPage = (PCSAMPAGEREC)MMR3HeapAllocZ(pVM, MM_TAG_CSAM_PATCH, sizeof(CSAMPAGEREC));
1829 if (pPage == NULL)
1836 pPage->Core.Key = (AVLPVKEY)(uintptr_t)GCPtr;
1837 pPage->page.pPageGC = GCPtr;
1838 pPage->page.fCode32 = fCode32;
1839 pPage->page.fMonitorInvalidation = fMonitorInvalidation;
1840 pPage->page.enmTag = enmTag;
1841 pPage->page.fMonitorActive = false;
1842 pPage->page.pBitmap = (uint8_t *)MMR3HeapAllocZ(pVM, MM_TAG_CSAM_PATCH, PAGE_SIZE/sizeof(uint8_t));
1843 rc = PGMGstGetPage(pVCpu, GCPtr, &pPage->page.fFlags, &pPage->page.GCPhys);
1846 pPage->page.u64Hash = csamR3CalcPageHash(pVM, GCPtr);
1847 ret = RTAvlPVInsert(&pVM->csam.s.pPageTree, &pPage->Core);
1877 pPage->page.fMonitorActive = true;
1885 Log(("csamCreatePageRecord %RRv GCPhys=%RGp\n", GCPtr, pPage->page.GCPhys));
1910 return &pPage->page;
2212 * @param pPage CSAM patch structure pointer
2214 bool csamIsCodeScanned(PVM pVM, RTRCPTR pInstr, PCSAMPAGE *pPage)
2224 Assert(pPage);
2226 if (*pPage && (*pPage)->pPageGC == pInstr)
2228 if ((*pPage)->pBitmap == NULL || ASMBitTest((*pPage)->pBitmap, offset))
2241 if (pPage) *pPage= &pPageRec->page;
2251 if (pPage) *pPage = NULL;
2261 * @param pPage Patch structure pointer
2266 static void csamMarkCode(PVM pVM, PCSAMPAGE pPage, RTRCPTR pInstr, uint32_t cbInstr, bool fScanned)
2272 if (pPage->pBitmap == NULL)
2278 if (ASMBitTest(pPage->pBitmap, pInstr & PAGE_OFFSET_MASK) == 0)
2280 pPage->uSize += cbInstr;
2283 if (pPage->uSize >= PAGE_SIZE)
2286 MMR3HeapFree(pPage->pBitmap);
2287 pPage->pBitmap = NULL;
2290 ASMBitSet(pPage->pBitmap, pInstr & PAGE_OFFSET_MASK);
2293 ASMBitClear(pPage->pBitmap, pInstr & PAGE_OFFSET_MASK);
2307 PCSAMPAGE pPage = 0;
2313 if (csamIsCodeScanned(pVM, pInstr, &pPage) == false)
2320 csamMarkCode(pVM, pPage, pInstr, cbInstr, fScanned);
2363 PCSAMPAGE pPage = NULL;
2380 rc = csamAnalyseCallCodeStream(pVM, pInstrGC, pInstrGC, true /* 32 bits code */, CSAMR3AnalyseCallback, pPage, &cacheRec);
2543 PCSAMPAGE pPage = NULL;
2549 rc = csamAnalyseCodeStream(pVM, pHandler, pHandler, true, CSAMR3AnalyseCallback, pPage, &cacheRec);
2599 PCSAMPAGE pPage = NULL;
2630 rc = csamAnalyseCodeStream(pVM, pHandler, pHandler, true, CSAMR3AnalyseCallback, pPage, &cacheRec);