VirtualBox

Changeset 8217

Show
Ignore:
Timestamp:
04/21/08 13:33:22 (9 months ago)
Author:
vboxsync
Message:

Added CSAMR3UnmonitorPage

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/VBox/csam.h

    r8155 r8217  
    274274 
    275275/** 
     276 * Unmonitors a code page 
     277 * 
     278 * @returns VBox status code 
     279 * @param   pVM         The VM to operate on. 
     280 * @param   pPageAddrGC The page to monitor 
     281 * @param   enmTag      Monitor tag 
     282 */ 
     283CSAMR3DECL(int) CSAMR3UnmonitorPage(PVM pVM, RTGCPTR pPageAddrGC, CSAMTAG enmTag); 
     284 
     285/** 
    276286 * Analyse interrupt and trap gates 
    277287 * 
  • trunk/src/VBox/VMM/PATM/CSAM.cpp

    r8155 r8217  
    18181818 
    18191819/** 
     1820 * Unmonitors a code page 
     1821 * 
     1822 * @returns VBox status code 
     1823 * @param   pVM         The VM to operate on. 
     1824 * @param   pPageAddrGC The page to monitor 
     1825 * @param   enmTag      Monitor tag 
     1826 */ 
     1827CSAMR3DECL(int) CSAMR3UnmonitorPage(PVM pVM, RTGCPTR pPageAddrGC, CSAMTAG enmTag) 
     1828{ 
     1829    pPageAddrGC &= PAGE_BASE_GC_MASK; 
     1830 
     1831    Log(("CSAMR3UnmonitorPage %VGv %d\n", pPageAddrGC, enmTag)); 
     1832 
     1833    Assert(enmTag == CSAM_TAG_REM); 
     1834 
     1835#ifdef VBOX_STRICT 
     1836    PCSAMPAGEREC pPageRec; 
     1837 
     1838    pPageRec = (PCSAMPAGEREC)RTAvlPVGet(&pVM->csam.s.pPageTree, (AVLPVKEY)pPageAddrGC); 
     1839    Assert(pPageRec && pPageRec->page.enmTag == enmTag); 
     1840#endif 
     1841    return CSAMR3RemovePage(pVM, pPageAddrGC); 
     1842} 
     1843 
     1844/** 
    18201845 * Removes a page record from our lookup tree 
    18211846 * 
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r8155 r8217  
    493493    { REMPARMDESC_FLAGS_INT,        sizeof(CSAMTAG), NULL } 
    494494}; 
     495static const REMPARMDESC g_aArgsCSAMR3UnmonitorPage[] = 
     496{ 
     497    { REMPARMDESC_FLAGS_INT,        sizeof(PVM), NULL }, 
     498    { REMPARMDESC_FLAGS_INT,        sizeof(RTGCPTR), NULL }, 
     499    { REMPARMDESC_FLAGS_INT,        sizeof(CSAMTAG), NULL } 
     500}; 
    495501 
    496502static const REMPARMDESC g_aArgsCSAMR3RecordCallAddress[] = 
     
    10091015    { "CPUMQueryGuestCtxPtr",                   (void *)(uintptr_t)&CPUMQueryGuestCtxPtr,           &g_aArgsCPUMQueryGuestCtxPtr[0],            ELEMENTS(g_aArgsCPUMQueryGuestCtxPtr),              REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL }, 
    10101016    { "CSAMR3MonitorPage",                      (void *)(uintptr_t)&CSAMR3MonitorPage,              &g_aArgsCSAMR3MonitorPage[0],               ELEMENTS(g_aArgsCSAMR3MonitorPage),                 REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL }, 
     1017    { "CSAMR3UnmonitorPage",                    (void *)(uintptr_t)&CSAMR3UnmonitorPage,            &g_aArgsCSAMR3UnmonitorPage[0],             ELEMENTS(g_aArgsCSAMR3UnmonitorPage),               REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL }, 
    10111018    { "CSAMR3RecordCallAddress",                (void *)(uintptr_t)&CSAMR3RecordCallAddress,        &g_aArgsCSAMR3RecordCallAddress[0],         ELEMENTS(g_aArgsCSAMR3RecordCallAddress),           REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL }, 
    10121019#if defined(VBOX_WITH_DEBUGGER) && !(defined(RT_OS_WINDOWS) && defined(RT_ARCH_AMD64)) /* the callbacks are problematic */ 
  • trunk/src/recompiler/VBoxRecompiler.c

    r8174 r8217  
    13751375        &&  !HWACCMIsEnabled(env->pVM)) 
    13761376        CSAMR3MonitorPage(env->pVM, GCPtr, CSAM_TAG_REM); 
     1377} 
     1378 
     1379/** 
     1380 * Called from tlb_unprotect_code in order to clear write monitoring for a code page. 
     1381 * 
     1382 * @param   env             Pointer to the CPU environment. 
     1383 * @param   GCPtr           Code page to monitor 
     1384 */ 
     1385void remR3UnprotectCode(CPUState *env, RTGCPTR GCPtr) 
     1386{ 
     1387    Assert(env->pVM->rem.s.fInREM); 
     1388    if (     (env->cr[0] & X86_CR0_PG)                      /* paging must be enabled */ 
     1389        &&  !(env->state & CPU_EMULATE_SINGLE_INSTR)        /* ignore during single instruction execution */ 
     1390        &&   (((env->hflags >> HF_CPL_SHIFT) & 3) == 0)     /* supervisor mode only */ 
     1391        &&  !(env->eflags & VM_MASK)                        /* no V86 mode */ 
     1392        &&  !HWACCMIsEnabled(env->pVM)) 
     1393        CSAMR3UnmonitorPage(env->pVM, GCPtr, CSAM_TAG_REM); 
    13771394} 
    13781395 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy