VirtualBox

Changeset 41739 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Jun 15, 2012 1:31:29 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
78547
Message:

DISCPUSTATE: s/param/Param/

Location:
trunk/src/VBox/VMM/VMMR3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CSAM.cpp

    r41738 r41739  
    800800    {
    801801    case OP_INT:
    802         Assert(pCpu->param1.fUse & DISUSE_IMMEDIATE8);
    803         if (pCpu->param1.parval == 3)
     802        Assert(pCpu->Param1.fUse & DISUSE_IMMEDIATE8);
     803        if (pCpu->Param1.parval == 3)
    804804        {
    805805            //two byte int 3
     
    10971097                     * Any register is allowed as long as source and destination are identical.
    10981098                     */
    1099                     if (    cpu.param1.fUse != DISUSE_REG_GEN32
    1100                         ||  (   cpu.param2.flags != DISUSE_REG_GEN32
    1101                              && (   !(cpu.param2.flags & DISUSE_REG_GEN32)
    1102                                  || !(cpu.param2.flags & (DISUSE_DISPLACEMENT8|DISUSE_DISPLACEMENT16|DISUSE_DISPLACEMENT32))
    1103                                  ||  cpu.param2.parval != 0
     1099                    if (    cpu.Param1.fUse != DISUSE_REG_GEN32
     1100                        ||  (   cpu.Param2.flags != DISUSE_REG_GEN32
     1101                             && (   !(cpu.Param2.flags & DISUSE_REG_GEN32)
     1102                                 || !(cpu.Param2.flags & (DISUSE_DISPLACEMENT8|DISUSE_DISPLACEMENT16|DISUSE_DISPLACEMENT32))
     1103                                 ||  cpu.Param2.parval != 0
    11041104                                )
    11051105                            )
    1106                         ||  cpu.param1.base.reg_gen32 != cpu.param2.base.reg_gen32
     1106                        ||  cpu.Param1.base.reg_gen32 != cpu.Param2.base.reg_gen32
    11071107                       )
    11081108                    {
     
    11151115                {
    11161116                    if (    (pCurInstrGC & 0x3) != 0
    1117                         ||  cpu.param1.fUse != DISUSE_REG_GEN32
    1118                         ||  cpu.param1.base.reg_gen32 != USE_REG_EBP
     1117                        ||  cpu.Param1.fUse != DISUSE_REG_GEN32
     1118                        ||  cpu.Param1.base.reg_gen32 != USE_REG_EBP
    11191119                       )
    11201120                    {
     
    11411141                {
    11421142                    if (    (pCurInstrGC & 0x3) != 0
    1143                         ||  cpu.param1.fUse != DISUSE_REG_GEN32
    1144                         ||  cpu.param1.base.reg_gen32 != USE_REG_ESP
     1143                        ||  cpu.Param1.fUse != DISUSE_REG_GEN32
     1144                        ||  cpu.Param1.base.reg_gen32 != USE_REG_ESP
    11451145                       )
    11461146                    {
     
    13281328        // For our first attempt, we'll handle only simple relative jumps and calls (immediate offset coded in instruction)
    13291329        if (    ((cpu.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) && (OP_PARM_VTYPE(cpu.pCurInstr->fParam1) == OP_PARM_J))
    1330             ||  (cpu.pCurInstr->uOpcode == OP_CALL && cpu.param1.fUse == DISUSE_DISPLACEMENT32))  /* simple indirect call (call dword ptr [address]) */
     1330            ||  (cpu.pCurInstr->uOpcode == OP_CALL && cpu.Param1.fUse == DISUSE_DISPLACEMENT32))  /* simple indirect call (call dword ptr [address]) */
    13311331        {
    13321332            /* We need to parse 'call dword ptr [address]' type of calls to catch cpuid instructions in some recent Linux distributions (e.g. OpenSuse 10.3) */
    13331333            if (    cpu.pCurInstr->uOpcode == OP_CALL
    1334                 &&  cpu.param1.fUse == DISUSE_DISPLACEMENT32)
     1334                &&  cpu.Param1.fUse == DISUSE_DISPLACEMENT32)
    13351335            {
    13361336                addr = 0;
    1337                 PGMPhysSimpleReadGCPtr(pVCpu, &addr, (RTRCUINTPTR)cpu.param1.uDisp.i32, sizeof(addr));
     1337                PGMPhysSimpleReadGCPtr(pVCpu, &addr, (RTRCUINTPTR)cpu.Param1.uDisp.i32, sizeof(addr));
    13381338            }
    13391339            else
     
    13421342            if (addr == 0)
    13431343            {
    1344                 Log(("We don't support far jumps here!! (%08X)\n", cpu.param1.fUse));
     1344                Log(("We don't support far jumps here!! (%08X)\n", cpu.Param1.fUse));
    13451345                rc = VINF_SUCCESS;
    13461346                break;
     
    13991399        else
    14001400        if (    cpu.pCurInstr->uOpcode == OP_JMP
    1401             &&  (cpu.param1.fUse & (DISUSE_DISPLACEMENT32|DISUSE_INDEX|DISUSE_SCALE)) == (DISUSE_DISPLACEMENT32|DISUSE_INDEX|DISUSE_SCALE)
     1401            &&  (cpu.Param1.fUse & (DISUSE_DISPLACEMENT32|DISUSE_INDEX|DISUSE_SCALE)) == (DISUSE_DISPLACEMENT32|DISUSE_INDEX|DISUSE_SCALE)
    14021402           )
    14031403        {
    1404             RTRCPTR  pJumpTableGC = (RTRCPTR)cpu.param1.disp32;
     1404            RTRCPTR  pJumpTableGC = (RTRCPTR)cpu.Param1.disp32;
    14051405            uint8_t *pJumpTableHC;
    14061406            int      rc2;
     
    14151415                    uint64_t fFlags;
    14161416
    1417                     addr = pJumpTableGC + cpu.param1.scale * i;
     1417                    addr = pJumpTableGC + cpu.Param1.scale * i;
    14181418                    /* Same page? */
    14191419                    if (PAGE_ADDRESS(addr) != PAGE_ADDRESS(pJumpTableGC))
    14201420                        break;
    14211421
    1422                     addr = *(RTRCPTR *)(pJumpTableHC + cpu.param1.scale * i);
     1422                    addr = *(RTRCPTR *)(pJumpTableHC + cpu.Param1.scale * i);
    14231423
    14241424                    rc2 = PGMGstGetPage(pVCpu, addr, &fFlags, NULL);
  • trunk/src/VBox/VMM/VMMR3/EMRaw.cpp

    r41738 r41739  
    990990
    991991            case OP_MOV_CR:
    992                 if (Cpu.param1.fUse & DISUSE_REG_GEN32)
     992                if (Cpu.Param1.fUse & DISUSE_REG_GEN32)
    993993                {
    994994                    //read
    995                     Assert(Cpu.param2.fUse & DISUSE_REG_CR);
    996                     Assert(Cpu.param2.base.reg_ctrl <= DISCREG_CR4);
    997                     STAM_COUNTER_INC(&pStats->StatMovReadCR[Cpu.param2.base.reg_ctrl]);
     995                    Assert(Cpu.Param2.fUse & DISUSE_REG_CR);
     996                    Assert(Cpu.Param2.base.reg_ctrl <= DISCREG_CR4);
     997                    STAM_COUNTER_INC(&pStats->StatMovReadCR[Cpu.Param2.base.reg_ctrl]);
    998998                }
    999999                else
    10001000                {
    10011001                    //write
    1002                     Assert(Cpu.param1.fUse & DISUSE_REG_CR);
    1003                     Assert(Cpu.param1.base.reg_ctrl <= DISCREG_CR4);
    1004                     STAM_COUNTER_INC(&pStats->StatMovWriteCR[Cpu.param1.base.reg_ctrl]);
     1002                    Assert(Cpu.Param1.fUse & DISUSE_REG_CR);
     1003                    Assert(Cpu.Param1.base.reg_ctrl <= DISCREG_CR4);
     1004                    STAM_COUNTER_INC(&pStats->StatMovWriteCR[Cpu.Param1.base.reg_ctrl]);
    10051005                }
    10061006                break;
     
    11001100
    11011101                        if (    Cpu.pCurInstr->uOpcode == OP_MOV_CR
    1102                             &&  Cpu.param1.fUse == DISUSE_REG_CR /* write */
     1102                            &&  Cpu.Param1.fUse == DISUSE_REG_CR /* write */
    11031103                           )
    11041104                        {
  • trunk/src/VBox/VMM/VMMR3/HWACCM.cpp

    r41737 r41739  
    18331833        pPatch->cbOp     = cbOp;
    18341834
    1835         if (pDis->param1.fUse == DISUSE_DISPLACEMENT32)
     1835        if (pDis->Param1.fUse == DISUSE_DISPLACEMENT32)
    18361836        {
    18371837            /* write. */
    1838             if (pDis->param2.fUse == DISUSE_REG_GEN32)
     1838            if (pDis->Param2.fUse == DISUSE_REG_GEN32)
    18391839            {
    18401840                pPatch->enmType     = HWACCMTPRINSTR_WRITE_REG;
    1841                 pPatch->uSrcOperand = pDis->param2.base.reg_gen;
     1841                pPatch->uSrcOperand = pDis->Param2.base.reg_gen;
    18421842            }
    18431843            else
    18441844            {
    1845                 Assert(pDis->param2.fUse == DISUSE_IMMEDIATE32);
     1845                Assert(pDis->Param2.fUse == DISUSE_IMMEDIATE32);
    18461846                pPatch->enmType     = HWACCMTPRINSTR_WRITE_IMM;
    1847                 pPatch->uSrcOperand = pDis->param2.parval;
     1847                pPatch->uSrcOperand = pDis->Param2.parval;
    18481848            }
    18491849            rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, aVMMCall, sizeof(aVMMCall));
     
    18571857            RTGCPTR  oldrip   = pCtx->rip;
    18581858            uint32_t oldcbOp  = cbOp;
    1859             uint32_t uMmioReg = pDis->param1.base.reg_gen;
     1859            uint32_t uMmioReg = pDis->Param1.base.reg_gen;
    18601860
    18611861            /* read */
    1862             Assert(pDis->param1.fUse == DISUSE_REG_GEN32);
     1862            Assert(pDis->Param1.fUse == DISUSE_REG_GEN32);
    18631863
    18641864            /* Found:
     
    18721872            if (    rc == VINF_SUCCESS
    18731873                &&  pDis->pCurInstr->uOpcode == OP_SHR
    1874                 &&  pDis->param1.fUse == DISUSE_REG_GEN32
    1875                 &&  pDis->param1.base.reg_gen == uMmioReg
    1876                 &&  pDis->param2.fUse == DISUSE_IMMEDIATE8
    1877                 &&  pDis->param2.parval == 4
     1874                &&  pDis->Param1.fUse == DISUSE_REG_GEN32
     1875                &&  pDis->Param1.base.reg_gen == uMmioReg
     1876                &&  pDis->Param2.fUse == DISUSE_IMMEDIATE8
     1877                &&  pDis->Param2.parval == 4
    18781878                &&  oldcbOp + cbOp < sizeof(pVM->hwaccm.s.aPatches[idx].aOpcode))
    18791879            {
     
    18901890                szInstr[1] = 0x0F;
    18911891                szInstr[2] = 0x20;
    1892                 szInstr[3] = 0xC0 | pDis->param1.base.reg_gen;
     1892                szInstr[3] = 0xC0 | pDis->Param1.base.reg_gen;
    18931893                for (unsigned i = 4; i < pPatch->cbOp; i++)
    18941894                    szInstr[i] = 0x90;  /* nop */
     
    19061906            {
    19071907                pPatch->enmType     = HWACCMTPRINSTR_READ;
    1908                 pPatch->uDstOperand = pDis->param1.base.reg_gen;
     1908                pPatch->uDstOperand = pDis->Param1.base.reg_gen;
    19091909
    19101910                rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, aVMMCall, sizeof(aVMMCall));
     
    20082008        pPatch->enmType = HWACCMTPRINSTR_JUMP_REPLACEMENT;
    20092009
    2010         if (pDis->param1.fUse == DISUSE_DISPLACEMENT32)
     2010        if (pDis->Param1.fUse == DISUSE_DISPLACEMENT32)
    20112011        {
    20122012            /*
     
    20282028                *
    20292029                */
    2030             bool fUsesEax = (pDis->param2.fUse == DISUSE_REG_GEN32 && pDis->param2.base.reg_gen == DISGREG_EAX);
     2030            bool fUsesEax = (pDis->Param2.fUse == DISUSE_REG_GEN32 && pDis->Param2.base.reg_gen == DISGREG_EAX);
    20312031
    20322032            aPatch[off++] = 0x51;    /* push ecx */
     
    20362036            aPatch[off++] = 0x31;    /* xor edx, edx */
    20372037            aPatch[off++] = 0xD2;
    2038             if (pDis->param2.fUse == DISUSE_REG_GEN32)
     2038            if (pDis->Param2.fUse == DISUSE_REG_GEN32)
    20392039            {
    20402040                if (!fUsesEax)
    20412041                {
    20422042                    aPatch[off++] = 0x89;    /* mov eax, src_reg */
    2043                     aPatch[off++] = MAKE_MODRM(3, pDis->param2.base.reg_gen, DISGREG_EAX);
     2043                    aPatch[off++] = MAKE_MODRM(3, pDis->Param2.base.reg_gen, DISGREG_EAX);
    20442044                }
    20452045            }
    20462046            else
    20472047            {
    2048                 Assert(pDis->param2.fUse == DISUSE_IMMEDIATE32);
     2048                Assert(pDis->Param2.fUse == DISUSE_IMMEDIATE32);
    20492049                aPatch[off++] = 0xB8;    /* mov eax, immediate */
    2050                 *(uint32_t *)&aPatch[off] = pDis->param2.parval;
     2050                *(uint32_t *)&aPatch[off] = pDis->Param2.parval;
    20512051                off += sizeof(uint32_t);
    20522052            }
     
    20792079                *
    20802080                */
    2081             Assert(pDis->param1.fUse == DISUSE_REG_GEN32);
    2082 
    2083             if (pDis->param1.base.reg_gen != DISGREG_ECX)
     2081            Assert(pDis->Param1.fUse == DISUSE_REG_GEN32);
     2082
     2083            if (pDis->Param1.base.reg_gen != DISGREG_ECX)
    20842084                aPatch[off++] = 0x51;    /* push ecx */
    2085             if (pDis->param1.base.reg_gen != DISGREG_EDX )
     2085            if (pDis->Param1.base.reg_gen != DISGREG_EDX )
    20862086                aPatch[off++] = 0x52;    /* push edx */
    2087             if (pDis->param1.base.reg_gen != DISGREG_EAX)
     2087            if (pDis->Param1.base.reg_gen != DISGREG_EAX)
    20882088                aPatch[off++] = 0x50;    /* push eax */
    20892089
     
    20982098            aPatch[off++] = 0x32;
    20992099
    2100             if (pDis->param1.base.reg_gen != DISGREG_EAX)
     2100            if (pDis->Param1.base.reg_gen != DISGREG_EAX)
    21012101            {
    21022102                aPatch[off++] = 0x89;    /* mov dst_reg, eax */
    2103                 aPatch[off++] = MAKE_MODRM(3, DISGREG_EAX, pDis->param1.base.reg_gen);
     2103                aPatch[off++] = MAKE_MODRM(3, DISGREG_EAX, pDis->Param1.base.reg_gen);
    21042104            }
    21052105
    2106             if (pDis->param1.base.reg_gen != DISGREG_EAX)
     2106            if (pDis->Param1.base.reg_gen != DISGREG_EAX)
    21072107                aPatch[off++] = 0x58;    /* pop eax */
    2108             if (pDis->param1.base.reg_gen != DISGREG_EDX )
     2108            if (pDis->Param1.base.reg_gen != DISGREG_EDX )
    21092109                aPatch[off++] = 0x5A;    /* pop edx */
    2110             if (pDis->param1.base.reg_gen != DISGREG_ECX)
     2110            if (pDis->Param1.base.reg_gen != DISGREG_ECX)
    21112111                aPatch[off++] = 0x59;    /* pop ecx */
    21122112        }
  • trunk/src/VBox/VMM/VMMR3/PATM.cpp

    r41738 r41739  
    13991399           )
    14001400        {
    1401             Assert(pCpu->param1.cb <= 4 || pCpu->param1.cb == 6);
    1402             if (    pCpu->param1.cb == 6 /* far call/jmp */
     1401            Assert(pCpu->Param1.cb <= 4 || pCpu->Param1.cb == 6);
     1402            if (    pCpu->Param1.cb == 6 /* far call/jmp */
    14031403                ||  (pCpu->pCurInstr->uOpcode == OP_CALL && !(pPatch->flags & PATMFL_SUPPORT_CALLS))
    14041404                ||  (OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J && !(pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS))
     
    15581558           )
    15591559        {
    1560             Assert(pCpu->param1.cb <= 4 || pCpu->param1.cb == 6);
    1561             if (    pCpu->param1.cb == 6 /* far call/jmp */
     1560            Assert(pCpu->Param1.cb <= 4 || pCpu->Param1.cb == 6);
     1561            if (    pCpu->Param1.cb == 6 /* far call/jmp */
    15621562                ||  (pCpu->pCurInstr->uOpcode == OP_CALL && !(pPatch->flags & PATMFL_SUPPORT_CALLS))
    15631563                ||  (OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J && !(pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS))
     
    17011701        if (pTargetGC == 0)
    17021702        {
    1703             Log(("We don't support far jumps here!! (%08X)\n", pCpu->param1.fUse));
     1703            Log(("We don't support far jumps here!! (%08X)\n", pCpu->Param1.fUse));
    17041704            return VERR_PATCHING_REFUSED;
    17051705        }
     
    17481748        {
    17491749            /* mov ss, src? */
    1750             if (    (pCpu->param1.fUse & DISUSE_REG_SEG)
    1751                 &&  (pCpu->param1.base.reg_seg == DISSELREG_SS))
     1750            if (    (pCpu->Param1.fUse & DISUSE_REG_SEG)
     1751                &&  (pCpu->Param1.base.reg_seg == DISSELREG_SS))
    17521752            {
    17531753                Log(("Force recompilation of next instruction for OP_MOV at %RRv\n", pCurInstrGC));
     
    17571757#if 0 /* necessary for Haiku */
    17581758            else
    1759             if (    (pCpu->param2.fUse & DISUSE_REG_SEG)
    1760                 &&  (pCpu->param2.base.reg_seg == USE_REG_SS)
    1761                 &&  (pCpu->param1.fUse & (DISUSE_REG_GEN32|DISUSE_REG_GEN16)))     /** @todo memory operand must in theory be handled too */
     1759            if (    (pCpu->Param2.fUse & DISUSE_REG_SEG)
     1760                &&  (pCpu->Param2.base.reg_seg == USE_REG_SS)
     1761                &&  (pCpu->Param1.fUse & (DISUSE_REG_GEN32|DISUSE_REG_GEN16)))     /** @todo memory operand must in theory be handled too */
    17621762            {
    17631763                /* mov GPR, ss */
     
    19451945         * In that case we'll jump to the original instruction and continue from there. Otherwise an int 3 is executed.
    19461946         */
    1947         Assert(pCpu->param1.cb == 4 || pCpu->param1.cb == 6);
    1948         if (pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS && pCpu->param1.cb == 4 /* no far calls! */)
     1947        Assert(pCpu->Param1.cb == 4 || pCpu->Param1.cb == 6);
     1948        if (pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS && pCpu->Param1.cb == 4 /* no far calls! */)
    19491949        {
    19501950            rc = patmPatchGenCall(pVM, pPatch, pCpu, pCurInstrGC, (RTRCPTR)0xDEADBEEF, true);
     
    19621962         * In that case we'll jump to the original instruction and continue from there. Otherwise an int 3 is executed.
    19631963         */
    1964         Assert(pCpu->param1.cb == 4 || pCpu->param1.cb == 6);
    1965         if (pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS && pCpu->param1.cb == 4 /* no far jumps! */)
     1964        Assert(pCpu->Param1.cb == 4 || pCpu->Param1.cb == 6);
     1965        if (pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS && pCpu->Param1.cb == 4 /* no far jumps! */)
    19661966        {
    19671967            rc = patmPatchGenJump(pVM, pPatch, pCpu, pCurInstrGC);
     
    21332133
    21342134            bool disret = patmR3DisInstr(pVM, pPatch, pOrgJumpGC, pOrgJumpHC, PATMREAD_ORGCODE, &cpu, NULL);
    2135             if (!disret || cpu.pCurInstr->uOpcode != OP_CALL || cpu.param1.cb != 4 /* only near calls */)
     2135            if (!disret || cpu.pCurInstr->uOpcode != OP_CALL || cpu.Param1.cb != 4 /* only near calls */)
    21362136                return VINF_SUCCESS;
    21372137        }
     
    22422242            if (pTargetGC == 0)
    22432243            {
    2244                 Log(("We don't support far jumps here!! (%08X)\n", cpu.param1.fUse));
     2244                Log(("We don't support far jumps here!! (%08X)\n", cpu.Param1.fUse));
    22452245                rc = VERR_PATCHING_REFUSED;
    22462246                break;
     
    24612461            if (addr == 0)
    24622462            {
    2463                 Log(("We don't support far jumps here!! (%08X)\n", cpu.param1.fUse));
     2463                Log(("We don't support far jumps here!! (%08X)\n", cpu.Param1.fUse));
    24642464                rc = VERR_PATCHING_REFUSED;
    24652465                break;
     
    35813581    if (pTargetGC == 0)
    35823582    {
    3583         Log(("We don't support far jumps here!! (%08X)\n", pCpu->param1.fUse));
     3583        Log(("We don't support far jumps here!! (%08X)\n", pCpu->Param1.fUse));
    35843584        rc = VERR_PATCHING_REFUSED;
    35853585        goto failure;
     
    36733673        goto failure;
    36743674
    3675     if (pCpu->param2.fUse != DISUSE_DISPLACEMENT32)
     3675    if (pCpu->Param2.fUse != DISUSE_DISPLACEMENT32)
    36763676        goto failure;
    36773677
     
    37523752    if (cbInstr > MAX_INSTR_SIZE)
    37533753        return VERR_PATCHING_REFUSED;
    3754     if (cpu.param2.fUse != DISUSE_DISPLACEMENT32)
     3754    if (cpu.Param2.fUse != DISUSE_DISPLACEMENT32)
    37553755        return VERR_PATCHING_REFUSED;
    37563756
     
    39143914    case OP_JMP:
    39153915        Assert(pPatch->flags & PATMFL_JUMP_CONFLICT);
    3916         Assert(pCpu->param1.fUse & DISUSE_IMMEDIATE32_REL);
    3917         if (!(pCpu->param1.fUse & DISUSE_IMMEDIATE32_REL))
     3916        Assert(pCpu->Param1.fUse & DISUSE_IMMEDIATE32_REL);
     3917        if (!(pCpu->Param1.fUse & DISUSE_IMMEDIATE32_REL))
    39183918            goto failure;
    39193919
     
    39493949     * references the target instruction in the conflict patch.
    39503950     */
    3951     RTRCPTR pJmpDest = PATMR3GuestGCPtrToPatchGCPtr(pVM, pInstrGC + pCpu->cbInstr + (int32_t)pCpu->param1.parval);
    3952 
    3953     AssertMsg(pJmpDest, ("PATMR3GuestGCPtrToPatchGCPtr failed for %RRv\n", pInstrGC + pCpu->cbInstr + (int32_t)pCpu->param1.parval));
     3951    RTRCPTR pJmpDest = PATMR3GuestGCPtrToPatchGCPtr(pVM, pInstrGC + pCpu->cbInstr + (int32_t)pCpu->Param1.parval);
     3952
     3953    AssertMsg(pJmpDest, ("PATMR3GuestGCPtrToPatchGCPtr failed for %RRv\n", pInstrGC + pCpu->cbInstr + (int32_t)pCpu->Param1.parval));
    39543954    pPatch->pPatchJumpDestGC = pJmpDest;
    39553955
     
    51995199        && (pConflictPatch->flags & PATMFL_CODE32)
    52005200        && (cpu.pCurInstr->uOpcode == OP_JMP || (cpu.pCurInstr->fOpType & DISOPTYPE_COND_CONTROLFLOW))
    5201         && (cpu.param1.fUse & DISUSE_IMMEDIATE32_REL))
     5201        && (cpu.Param1.fUse & DISUSE_IMMEDIATE32_REL))
    52025202    {
    52035203        /* Hint patches must be enabled first. */
  • trunk/src/VBox/VMM/VMMR3/PATMPatch.cpp

    r41738 r41739  
    694694    {
    695695        Log(("patmPatchGenIndirectCall\n"));
    696         Assert(pCpu->param1.cb == 4);
     696        Assert(pCpu->Param1.cb == 4);
    697697        Assert(OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J);
    698698
     
    790790
    791791    Log(("patmPatchGenIndirectJump\n"));
    792     Assert(pCpu->param1.cb == 4);
     792    Assert(pCpu->Param1.cb == 4);
    793793    Assert(OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J);
    794794
     
    857857    /** @note optimization: multiple identical ret instruction in a single patch can share a single patched ret. */
    858858    if (    pPatch->pTempInfo->pPatchRetInstrGC
    859         &&  pPatch->pTempInfo->uPatchRetParam1 == (uint32_t)pCpu->param1.parval) /* nr of bytes popped off the stack should be identical of course! */
     859        &&  pPatch->pTempInfo->uPatchRetParam1 == (uint32_t)pCpu->Param1.parval) /* nr of bytes popped off the stack should be identical of course! */
    860860    {
    861861        Assert(pCpu->pCurInstr->uOpcode == OP_RETN);
     
    891891    {
    892892        pPatch->pTempInfo->pPatchRetInstrGC = pPatchRetInstrGC;
    893         pPatch->pTempInfo->uPatchRetParam1  = pCpu->param1.parval;
     893        pPatch->pTempInfo->uPatchRetParam1  = pCpu->Param1.parval;
    894894    }
    895895    return rc;
     
    11641164        // mov DRx, GPR
    11651165        pPB[0] = 0x89;      //mov disp32, GPR
    1166         Assert(pCpu->param1.fUse & DISUSE_REG_DBG);
    1167         Assert(pCpu->param2.fUse & DISUSE_REG_GEN32);
    1168 
    1169         dbgreg = pCpu->param1.base.reg_dbg;
    1170         reg    = pCpu->param2.base.reg_gen;
     1166        Assert(pCpu->Param1.fUse & DISUSE_REG_DBG);
     1167        Assert(pCpu->Param2.fUse & DISUSE_REG_GEN32);
     1168
     1169        dbgreg = pCpu->Param1.base.reg_dbg;
     1170        reg    = pCpu->Param2.base.reg_gen;
    11711171    }
    11721172    else
    11731173    {
    11741174        // mov GPR, DRx
    1175         Assert(pCpu->param1.fUse & DISUSE_REG_GEN32);
    1176         Assert(pCpu->param2.fUse & DISUSE_REG_DBG);
     1175        Assert(pCpu->Param1.fUse & DISUSE_REG_GEN32);
     1176        Assert(pCpu->Param2.fUse & DISUSE_REG_DBG);
    11771177
    11781178        pPB[0] = 0x8B;      // mov GPR, disp32
    1179         reg    = pCpu->param1.base.reg_gen;
    1180         dbgreg = pCpu->param2.base.reg_dbg;
     1179        reg    = pCpu->Param1.base.reg_gen;
     1180        dbgreg = pCpu->Param2.base.reg_dbg;
    11811181    }
    11821182
     
    12141214        // mov CRx, GPR
    12151215        pPB[0] = 0x89;      //mov disp32, GPR
    1216         ctrlreg = pCpu->param1.base.reg_ctrl;
    1217         reg     = pCpu->param2.base.reg_gen;
    1218         Assert(pCpu->param1.fUse & DISUSE_REG_CR);
    1219         Assert(pCpu->param2.fUse & DISUSE_REG_GEN32);
     1216        ctrlreg = pCpu->Param1.base.reg_ctrl;
     1217        reg     = pCpu->Param2.base.reg_gen;
     1218        Assert(pCpu->Param1.fUse & DISUSE_REG_CR);
     1219        Assert(pCpu->Param2.fUse & DISUSE_REG_GEN32);
    12201220    }
    12211221    else
    12221222    {
    12231223        // mov GPR, DRx
    1224         Assert(pCpu->param1.fUse & DISUSE_REG_GEN32);
    1225         Assert(pCpu->param2.fUse & DISUSE_REG_CR);
     1224        Assert(pCpu->Param1.fUse & DISUSE_REG_GEN32);
     1225        Assert(pCpu->Param2.fUse & DISUSE_REG_CR);
    12261226
    12271227        pPB[0]  = 0x8B;      // mov GPR, disp32
    1228         reg     = pCpu->param1.base.reg_gen;
    1229         ctrlreg = pCpu->param2.base.reg_ctrl;
     1228        reg     = pCpu->Param1.base.reg_gen;
     1229        ctrlreg = pCpu->Param2.base.reg_ctrl;
    12301230    }
    12311231
     
    12921292    if (pCpu->fPrefix & DISPREFIX_OPSIZE)
    12931293        pPB[offset++] = 0x66; /* size override -> 16 bits pop */
    1294     pPB[offset++] = 0x58 + pCpu->param1.base.reg_gen;
     1294    pPB[offset++] = 0x58 + pCpu->Param1.base.reg_gen;
    12951295    PATCHGEN_EPILOG(pPatch, offset);
    12961296
     
    13251325    PATCHGEN_PROLOG(pVM, pPatch);
    13261326
    1327     if (pCpu->param1.fUse == DISUSE_REG_GEN32 || pCpu->param1.fUse == DISUSE_REG_GEN16)
     1327    if (pCpu->Param1.fUse == DISUSE_REG_GEN32 || pCpu->Param1.fUse == DISUSE_REG_GEN16)
    13281328    {
    13291329        /* Register operand */
     
    13351335        pPB[offset++] = 0x8B;              // mov       destreg, CPUMCTX.tr/ldtr
    13361336        /* Modify REG part according to destination of original instruction */
    1337         pPB[offset++] = MAKE_MODRM(0, pCpu->param1.base.reg_gen, 5);
     1337        pPB[offset++] = MAKE_MODRM(0, pCpu->Param1.base.reg_gen, 5);
    13381338        if (pCpu->pCurInstr->uOpcode == OP_STR)
    13391339        {
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