VirtualBox

Changeset 5612 in vbox for trunk/src/VBox/VMM/PATM


Ignore:
Timestamp:
Nov 2, 2007 11:59:34 AM (17 years ago)
Author:
vboxsync
Message:

Bit more checking to ensure we don't invalidate instructions that are not affected by the write

File:
1 edited

Legend:

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

    r5610 r5612  
    47274727
    47284728                        /* Find the closest instruction from below; the above quick check ensured that we are indeed in patched code */
    4729                         pPatchInstrGC = patmGuestGCPtrToClosestPatchGCPtr(pVM, pPatch, pGuestPtrGC);
    4730                         Assert(pPatchInstrGC);
     4729                        pPatchInstrGC = patmGuestGCPtrToPatchGCPtr(pVM, pPatch, pGuestPtrGC);
     4730                        if (!pPatchInstrGC)
     4731                        {
     4732                            RTGCPTR  pClosestInstrGC;
     4733                            uint32_t size;
     4734
     4735                            pPatchInstrGC   = patmGuestGCPtrToClosestPatchGCPtr(pVM, pPatch, pGuestPtrGC);
     4736                            if (pPatchInstrGC)
     4737                            {
     4738                                pClosestInstrGC = patmPatchGCPtr2GuestGCPtr(pVM, pPatch, pPatchInstrGC);
     4739                                Assert(pClosestInstrGC <= pGuestPtrGC);
     4740                                size            = patmGetInstrSize(pVM, pPatch, pClosestInstrGC);
     4741                                /* Check if this is not a write into a gap between two patches */
     4742                                if (pClosestInstrGC + size - 1 < pGuestPtrGC)
     4743                                    pPatchInstrGC = 0;
     4744                            }
     4745                        }
    47314746                        if (pPatchInstrGC)
    47324747                        {
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