Changeset 5198 in vbox for trunk/src/VBox/VMM/PATM
- Timestamp:
- Oct 9, 2007 12:32:03 PM (17 years ago)
- Location:
- trunk/src/VBox/VMM/PATM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PATM/CSAM.cpp
r4959 r5198 233 233 pVM->csam.s.cDangerousInstr = 0; 234 234 pVM->csam.s.iDangerousInstr = 0; 235 236 memset(pVM->csam.s.pvCallInstruction, 0, sizeof(pVM->csam.s.pvCallInstruction)); 237 pVM->csam.s.iCallInstruction = 0; 235 238 236 239 /** @note never mess with the pgdir bitmap here! */ … … 2248 2251 2249 2252 if (cGates != 1) 2253 { 2250 2254 pVM->csam.s.fGatesChecked = true; 2255 for (unsigned i=0;i<RT_ELEMENTS(pVM->csam.s.pvCallInstruction);i++) 2256 { 2257 RTGCPTR pHandler = pVM->csam.s.pvCallInstruction[i]; 2258 CSAMP2GLOOKUPREC cacheRec = {0}; /* Cache record for PATMGCVirtToHCVirt. */ 2259 PCSAMPAGE pPage = NULL; 2260 2261 Log(("CSAMCheckGates: checking previous call instruction %VGv\n", pHandler)); 2262 STAM_PROFILE_START(&pVM->csam.s.StatTime, a); 2263 rc = csamAnalyseCodeStream(pVM, pHandler, pHandler, true, CSAMR3AnalyseCallback, pPage, &cacheRec); 2264 STAM_PROFILE_STOP(&pVM->csam.s.StatTime, a); 2265 if (rc != VINF_SUCCESS) 2266 { 2267 Log(("CSAMCheckGates: csamAnalyseCodeStream failed with %d\n", rc)); 2268 continue; 2269 } 2270 } 2271 } 2251 2272 2252 2273 /* Determine valid upper boundary. */ … … 2412 2433 2413 2434 /** 2435 * Record previous call instruction addresses 2436 * 2437 * @returns VBox status code. 2438 * @param pVM The VM to operate on. 2439 * @param GCPtrCall Call address 2440 */ 2441 CSAMR3DECL(int) CSAMR3RecordCallAddress(PVM pVM, RTGCPTR GCPtrCall) 2442 { 2443 for (unsigned i=0;i<RT_ELEMENTS(pVM->csam.s.pvCallInstruction);i++) 2444 { 2445 if (pVM->csam.s.pvCallInstruction[i] == GCPtrCall) 2446 return VINF_SUCCESS; 2447 } 2448 2449 Log(("CSAMR3RecordCallAddress %VGv\n", GCPtrCall)); 2450 2451 pVM->csam.s.pvCallInstruction[pVM->csam.s.iCallInstruction++] = GCPtrCall; 2452 if (pVM->csam.s.iCallInstruction >= RT_ELEMENTS(pVM->csam.s.pvCallInstruction)) 2453 pVM->csam.s.iCallInstruction = 0; 2454 2455 return VINF_SUCCESS; 2456 } 2457 2458 2459 /** 2414 2460 * Query CSAM state (enabled/disabled) 2415 2461 * -
trunk/src/VBox/VMM/PATM/CSAMInternal.h
r4776 r5198 176 176 uint32_t cPossibleCodePages; 177 177 RTGCPTR pvPossibleCodePage[CSAM_MAX_CODE_PAGES_FLUSH]; 178 179 /* call addresses reported by the recompiler */ 180 RTGCPTR pvCallInstruction[128]; 181 RTUINT iCallInstruction; 178 182 179 183 /* Set when scanning has started. */
Note:
See TracChangeset
for help on using the changeset viewer.