VirtualBox

Changeset 2919 in vbox


Ignore:
Timestamp:
May 29, 2007 2:43:31 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
21592
Message:

Stricter checks for patch jumps.
Do not check for page boundary crossing when a patch jump will not be installed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PATM/PATM.cpp

    r2049 r2919  
    26772677    }
    26782678
    2679     if (PAGE_ADDRESS(pInstrGC) != PAGE_ADDRESS(pInstrGC + SIZEOF_NEARJUMP32))
     2679    if (!(pPatch->flags & (PATMFL_IDTHANDLER|PATMFL_IDTHANDLER_WITHOUT_ENTRYPOINT|PATMFL_SYSENTER|PATMFL_INT3_REPLACEMENT_BLOCK)))   
     2680        pPatch->flags |= PATMFL_MUST_INSTALL_PATCHJMP;
     2681
     2682    /* If we're going to insert a patch jump, then the jump itself is not allowed to cross a page boundary. */
     2683    if (     (pPatch->flags & PATMFL_MUST_INSTALL_PATCHJMP)
     2684        &&   PAGE_ADDRESS(pInstrGC) != PAGE_ADDRESS(pInstrGC + SIZEOF_NEARJUMP32)
     2685       )
    26802686    {
    26812687        STAM_COUNTER_INC(&pVM->patm.s.StatPageBoundaryCrossed);
     
    27942800        STAM_COUNTER_INC(&pVM->patm.s.StatInt3Callable);
    27952801    }
    2796     else
    2797     if (!(pPatch->flags & PATMFL_IDTHANDLER))
    2798     {
    2799         pPatch->flags |= PATMFL_MUST_INSTALL_PATCHJMP;
    2800 
     2802
     2803    if (pPatch->flags & PATMFL_MUST_INSTALL_PATCHJMP)
     2804    {
     2805        Assert(!(pPatch->flags & (PATMFL_IDTHANDLER|PATMFL_IDTHANDLER_WITHOUT_ENTRYPOINT|PATMFL_SYSENTER|PATMFL_INT3_REPLACEMENT_BLOCK)));
    28012806        /* now insert a jump in the guest code */
    28022807        rc = patmGenJumpToPatch(pVM, pPatch, true);
Note: See TracChangeset for help on using the changeset viewer.

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