VirtualBox

Changeset 5197 in vbox for trunk/src/recompiler/target-i386


Ignore:
Timestamp:
Oct 9, 2007 12:31:32 PM (17 years ago)
Author:
vboxsync
Message:

Experiment with call recording for CSAM

Location:
trunk/src/recompiler/target-i386
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/target-i386/exec.h

    r2422 r5197  
    215215#ifdef VBOX
    216216void helper_external_event(void);
     217void helper_record_call(void);
    217218
    218219/* in helper.c */
  • trunk/src/recompiler/target-i386/helper.c

    r3727 r5197  
    12221222        remR3TimersRun(env);
    12231223    }
     1224}
     1225/* helper for recording call instruction addresses for later scanning */
     1226void 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);
    12241232}
    12251233#endif /* VBOX */
     
    22482256    uint32_t val, limit, old_sp_mask;
    22492257    target_ulong ssp, old_ssp, next_eip, new_eip;
    2250    
     2258
    22512259    new_cs = T0;
    22522260    new_eip = T1;
  • trunk/src/recompiler/target-i386/op.c

    r2841 r5197  
    821821    }
    822822}
     823
     824void OPPROTO op_record_call(void)
     825{
     826    helper_record_call();
     827}
     828
    823829#endif /* VBOX */
    824830
  • trunk/src/recompiler/target-i386/translate.c

    r3952 r5197  
    123123#ifdef VBOX
    124124    int vme;    /* CR4.VME */
     125    int record_call;    /* record calls for CSAM or not? */
    125126#endif
    126127    int cpl;
     
    36743675        case 2: /* call Ev */
    36753676            /* 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
    36763681            if (s->dflag == 0)
    36773682                gen_op_andl_T0_ffff();
     
    65966601    dc->f_st = 0;
    65976602    dc->vm86 = (flags >> VM_SHIFT) & 1;
    6598 #ifdef VBOX
     6603#ifdef VBOX_WITH_CALL_RECORD
    65996604    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;
    66006612#endif
    66016613    dc->cpl = (flags >> HF_CPL_SHIFT) & 3;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette