Changeset 5197 in vbox
- Timestamp:
- Oct 9, 2007 12:31:32 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 25124
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/REMInternal.h
r4787 r5197 266 266 void remR3TrapStat(CPUState *env, uint32_t uTrap); 267 267 void remR3CpuId(CPUState *env, unsigned uOperator, void *pvEAX, void *pvEBX, void *pvECX, void *pvEDX); 268 void remR3RecordCall(CPUState *env); 268 269 #endif 269 270 void remR3TrapClear(PVM pVM); -
trunk/src/recompiler/VBoxREMWrapper.cpp
r5181 r5197 489 489 { REMPARMDESC_FLAGS_INT, sizeof(CSAMTAG), NULL } 490 490 }; 491 492 static const REMPARMDESC g_aArgsCSAMR3RecordCallAddress[] = 493 { 494 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 495 { REMPARMDESC_FLAGS_INT, sizeof(RTGCPTR), NULL } 496 }; 497 491 498 #if !(defined(RT_OS_WINDOWS) && defined(RT_ARCH_AMD64)) /* the callbacks are problematic */ 492 499 static const REMPARMDESC g_aArgsDBGCRegisterCommands[] = … … 990 997 { "CPUMQueryGuestCtxPtr", (void *)(uintptr_t)&CPUMQueryGuestCtxPtr, &g_aArgsCPUMQueryGuestCtxPtr[0], ELEMENTS(g_aArgsCPUMQueryGuestCtxPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 991 998 { "CSAMR3MonitorPage", (void *)(uintptr_t)&CSAMR3MonitorPage, &g_aArgsCSAMR3MonitorPage[0], ELEMENTS(g_aArgsCSAMR3MonitorPage), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 999 { "CSAMR3RecordCallAddress", (void *)(uintptr_t)&CSAMR3RecordCallAddress, &g_aArgsCSAMR3RecordCallAddress[0], ELEMENTS(g_aArgsCSAMR3RecordCallAddress), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 992 1000 #if !(defined(RT_OS_WINDOWS) && defined(RT_ARCH_AMD64)) /* the callbacks are problematic */ 993 1001 { "DBGCRegisterCommands", (void *)(uintptr_t)&DBGCRegisterCommands, &g_aArgsDBGCRegisterCommands[0], ELEMENTS(g_aArgsDBGCRegisterCommands), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, -
trunk/src/recompiler/VBoxRecompiler.c
r4986 r5197 427 427 pVM->rem.s.cInvalidatedPages = 0; 428 428 pVM->rem.s.fIgnoreAll = false; 429 430 /* Clear raw ring 0 init state */ 431 pVM->rem.s.Env.state &= ~CPU_RAW_RING0; 429 432 } 430 433 … … 1546 1549 } 1547 1550 1551 /* 1552 * Record previous call instruction addresses 1553 * 1554 * @param env Pointer to the CPU environment. 1555 */ 1556 void remR3RecordCall(CPUState *env) 1557 { 1558 CSAMR3RecordCallAddress((PVM)env->pVM, env->eip); 1559 } 1548 1560 1549 1561 /** -
trunk/src/recompiler/target-i386/exec.h
r2422 r5197 215 215 #ifdef VBOX 216 216 void helper_external_event(void); 217 void helper_record_call(void); 217 218 218 219 /* in helper.c */ -
trunk/src/recompiler/target-i386/helper.c
r3727 r5197 1222 1222 remR3TimersRun(env); 1223 1223 } 1224 } 1225 /* helper for recording call instruction addresses for later scanning */ 1226 void helper_record_call() 1227 { 1228 if ( !(env->state & CPU_RAW_RING0) 1229 && (env->cr[0] & CR0_PG_MASK) 1230 && !(env->eflags & X86_EFL_IF)) 1231 remR3RecordCall(env); 1224 1232 } 1225 1233 #endif /* VBOX */ … … 2248 2256 uint32_t val, limit, old_sp_mask; 2249 2257 target_ulong ssp, old_ssp, next_eip, new_eip; 2250 2258 2251 2259 new_cs = T0; 2252 2260 new_eip = T1; -
trunk/src/recompiler/target-i386/op.c
r2841 r5197 821 821 } 822 822 } 823 824 void OPPROTO op_record_call(void) 825 { 826 helper_record_call(); 827 } 828 823 829 #endif /* VBOX */ 824 830 -
trunk/src/recompiler/target-i386/translate.c
r3952 r5197 123 123 #ifdef VBOX 124 124 int vme; /* CR4.VME */ 125 int record_call; /* record calls for CSAM or not? */ 125 126 #endif 126 127 int cpl; … … 3674 3675 case 2: /* call Ev */ 3675 3676 /* XXX: optimize if memory (no 'and' is necessary) */ 3677 #ifdef VBOX_WITH_CALL_RECORD 3678 if (s->record_call) 3679 gen_op_record_call(); 3680 #endif 3676 3681 if (s->dflag == 0) 3677 3682 gen_op_andl_T0_ffff(); … … 6596 6601 dc->f_st = 0; 6597 6602 dc->vm86 = (flags >> VM_SHIFT) & 1; 6598 #ifdef VBOX 6603 #ifdef VBOX_WITH_CALL_RECORD 6599 6604 dc->vme = !!(env->cr[4] & CR4_VME_MASK); 6605 if ( !(env->state & CPU_RAW_RING0) 6606 && (env->cr[0] & CR0_PG_MASK) 6607 && !(env->eflags & X86_EFL_IF) 6608 && dc->code32) 6609 dc->record_call = 1; 6610 else 6611 dc->record_call = 0; 6600 6612 #endif 6601 6613 dc->cpl = (flags >> HF_CPL_SHIFT) & 3;
Note:
See TracChangeset
for help on using the changeset viewer.