VirtualBox

Changeset 2046 in vbox for trunk


Ignore:
Timestamp:
Apr 12, 2007 1:23:27 PM (18 years ago)
Author:
vboxsync
Message:

Corrections and activation of mov gpr,ss patch.

Location:
trunk/src/VBox/VMM/PATM
Files:
4 edited

Legend:

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

    r2043 r2046  
    16521652
    16531653    case OP_MOV:
    1654         if (pCpu->pCurInstr->optype & OPTYPE_INHIBIT_IRQS)
    1655         {
    1656             Assert(pCpu->pCurInstr->param1 == OP_PARM_Sw && (pCpu->param1.flags & USE_REG_SEG));
    1657 
     1654        if (pCpu->pCurInstr->optype & OPTYPE_POTENTIALLY_DANGEROUS)
     1655        {
    16581656            /* mov ss, src? */
    16591657            if (    (pCpu->param1.flags & USE_REG_SEG)
     
    16641662                /** @todo this could cause a fault (ring 0 selector being loaded in ring 1) */
    16651663            }
    1666 #if 0
    16671664            else
    16681665            if (    (pCpu->param2.flags & USE_REG_SEG)
     
    16711668            {
    16721669                /* mov GPR, ss */
    1673                 rc = patmPatchGenMovFromSS(pVM, pPatch, pCpu);
     1670                rc = patmPatchGenMovFromSS(pVM, pPatch, pCpu, pCurInstrGC);
    16741671                if (VBOX_SUCCESS(rc))
    16751672                    rc = VWRN_CONTINUE_RECOMPILE;
    16761673                break;
    16771674            }
    1678 #endif
    16791675        }
    16801676        goto duplicate_instr;
  • trunk/src/VBox/VMM/PATM/PATMA.asm

    r2043 r2046  
    25572557    DD      0
    25582558    DD      0
     2559    DD      0
    25592560    DD      PATMMovFromSS_Start_End - PATMMovFromSS_Start
    2560     DD      0
    25612561    DD      0
    25622562    DD      0ffffffffh
  • trunk/src/VBox/VMM/PATM/PATMPatch.cpp

    r2043 r2046  
    12811281 * mov GPR, SS
    12821282 */
    1283 int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu)
     1283int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR pCurInstrGC)
    12841284{
    12851285    uint32_t size, offset;
    12861286
    1287     PATCHGEN_PROLOG(pVM, pPatch);
    1288     size = patmPatchGenCode(pVM, pPatch, pPB, &PATMSetPIFRecord, 0, false);
     1287    Log(("patmPatchGenMovFromSS %VGv\n", pCurInstrGC));
     1288
     1289    PATCHGEN_PROLOG(pVM, pPatch);
     1290    size = patmPatchGenCode(pVM, pPatch, pPB, &PATMClearPIFRecord, 0, false);
    12891291    PATCHGEN_EPILOG(pPatch, size);
    12901292
     
    12991301    if (pPatch->flags & PATMFL_CODE32)
    13001302        pPB[offset++] = 0x66; /* size override -> 16 bits pop */
    1301     pPB[offset++] = 0x50 + pCpu->param1.base.reg_gen32;
     1303    pPB[offset++] = 0x58 + pCpu->param1.base.reg_gen32;
    13021304    PATCHGEN_EPILOG(pPatch, offset);
    13031305
    13041306
    13051307    PATCHGEN_PROLOG_NODEF(pVM, pPatch);
    1306     size = patmPatchGenCode(pVM, pPatch, pPB, &PATMClearPIFRecord, 0, false);
     1308    size = patmPatchGenCode(pVM, pPatch, pPB, &PATMSetPIFRecord, 0, false);
    13071309    PATCHGEN_EPILOG(pPatch, size);
    13081310
  • trunk/src/VBox/VMM/PATM/PATMPatch.h

    r2043 r2046  
    3030int patmPatchGenMovControl(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu);
    3131int patmPatchGenMovDebug(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu);
    32 int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu);
     32int patmPatchGenMovFromSS(PVM pVM, PPATCHINFO pPatch, DISCPUSTATE *pCpu, RTGCPTR pCurInstrGC);
    3333int patmPatchGenRelJump(PVM pVM, PPATCHINFO pPatch, GCPTRTYPE(uint8_t *)pTargetGC, uint32_t opcode, bool fSizeOverride);
    3434int patmPatchGenLoop(PVM pVM, PPATCHINFO pPatch, GCPTRTYPE(uint8_t *)pTargetGC, uint32_t opcode, bool fSizeOverride);
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