Changeset 41738 in vbox
- Timestamp:
- Jun 15, 2012 1:25:47 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/dis.h
r41737 r41738 91 91 /** @} */ 92 92 93 /** @name Operand type .93 /** @name Operand type (DISOPCODE::fOpType). 94 94 * @{ 95 95 */ … … 449 449 const char *pszOpcode; 450 450 #endif 451 /** Parameter \#1 parser index. */ 451 452 uint8_t idxParse1; 453 /** Parameter \#2 parser index. */ 452 454 uint8_t idxParse2; 455 /** Parameter \#3 parser index. */ 453 456 uint8_t idxParse3; 457 /** Unused padding. */ 454 458 uint8_t uUnused; 455 459 /** The opcode identifier. This DIS specific, @see grp_dis_opcodes and 456 460 * VBox/disopcode.h. */ 457 461 uint16_t uOpcode; 458 uint16_t param1; 459 uint16_t param2; 460 uint16_t param3; 461 uint32_t optype; 462 /** Parameter \#1 info, @see grp_dis_opparam. */ 463 uint16_t fParam1; 464 /** Parameter \#2 info, @see grp_dis_opparam. */ 465 uint16_t fParam2; 466 /** Parameter \#3 info, @see grp_dis_opparam. */ 467 uint16_t fParam3; 468 /** Operand type flags, DISOPTYPE_XXX. */ 469 uint32_t fOpType; 462 470 } DISOPCODE; 463 471 /** Pointer to const opcode. */ -
trunk/include/VBox/disopcode.h
r41737 r41738 629 629 630 630 631 /** @name Opcode parameters 631 /** @defgroup grp_dis_opparam Opcode parameters (DISOPCODE::fParam1, 632 * DISOPCODE::fParam2, DISOPCODE::fParam3) 633 * @ingroup grp_dis 632 634 * @{ 633 635 */ 636 634 637 /* NOTE: Register order is important for translations!! */ 635 638 #define OP_PARM_NONE 0 -
trunk/src/VBox/Disassembler/DisasmCore.cpp
r41737 r41738 358 358 // segment override prefix byte 359 359 case OP_SEG: 360 pCpu->idxSegPrefix = (DISSELREG)(paOneByteMap[codebyte]. param1 - OP_PARM_REG_SEG_START);360 pCpu->idxSegPrefix = (DISSELREG)(paOneByteMap[codebyte].fParam1 - OP_PARM_REG_SEG_START); 361 361 /* Segment prefixes for CS, DS, ES and SS are ignored in long mode. */ 362 362 if ( pCpu->uCpuMode != DISCPUMODE_64BIT … … 414 414 /* REX prefix byte */ 415 415 pCpu->fPrefix |= DISPREFIX_REX; 416 pCpu->fRexPrefix = DISPREFIX_REX_OP_2_FLAGS(paOneByteMap[codebyte]. param1);416 pCpu->fRexPrefix = DISPREFIX_REX_OP_2_FLAGS(paOneByteMap[codebyte].fParam1); 417 417 iByte += sizeof(uint8_t); 418 418 … … 459 459 * Note! Multibyte opcodes are always marked harmless until the final byte. 460 460 */ 461 if ((pOp-> optype & pCpu->fFilter) == 0)461 if ((pOp->fOpType & pCpu->fFilter) == 0) 462 462 { 463 463 fFiltered = true; … … 471 471 472 472 // Should contain the parameter type on input 473 pCpu->param1.param = pOp-> param1;474 pCpu->param2.param = pOp-> param2;475 pCpu->param3.param = pOp-> param3;473 pCpu->param1.param = pOp->fParam1; 474 pCpu->param2.param = pOp->fParam2; 475 pCpu->param3.param = pOp->fParam3; 476 476 477 477 /* Correct the operand size if the instruction is marked as forced or default 64 bits */ 478 478 if (pCpu->uCpuMode == DISCPUMODE_64BIT) 479 479 { 480 if (pOp-> optype & DISOPTYPE_FORCED_64_OP_SIZE)480 if (pOp->fOpType & DISOPTYPE_FORCED_64_OP_SIZE) 481 481 pCpu->uOpMode = DISCPUMODE_64BIT; 482 482 else 483 if ( (pOp-> optype & DISOPTYPE_DEFAULT_64_OP_SIZE)483 if ( (pOp->fOpType & DISOPTYPE_DEFAULT_64_OP_SIZE) 484 484 && !(pCpu->fPrefix & DISPREFIX_OPSIZE)) 485 485 pCpu->uOpMode = DISCPUMODE_64BIT; 486 486 } 487 487 else 488 if (pOp-> optype & DISOPTYPE_FORCED_32_OP_SIZE_X86)488 if (pOp->fOpType & DISOPTYPE_FORCED_32_OP_SIZE_X86) 489 489 { 490 490 /* Forced 32 bits operand size for certain instructions (mov crx, mov drx). */ … … 534 534 535 535 // Should contain the parameter type on input 536 pCpu->param1.param = fpop-> param1;537 pCpu->param2.param = fpop-> param2;536 pCpu->param1.param = fpop->fParam1; 537 pCpu->param2.param = fpop->fParam2; 538 538 } 539 539 else … … 547 547 * @note Multibyte opcodes are always marked harmless until the final byte. 548 548 */ 549 if ((fpop-> optype & pCpu->fFilter) == 0)549 if ((fpop->fOpType & pCpu->fFilter) == 0) 550 550 pCpu->pfnDisasmFnTable = g_apfnCalcSize; 551 551 else … … 557 557 { 558 558 /* Note: redundant, but just in case this ever changes */ 559 if (fpop-> optype & DISOPTYPE_FORCED_64_OP_SIZE)559 if (fpop->fOpType & DISOPTYPE_FORCED_64_OP_SIZE) 560 560 pCpu->uOpMode = DISCPUMODE_64BIT; 561 561 else 562 if ( (fpop-> optype & DISOPTYPE_DEFAULT_64_OP_SIZE)562 if ( (fpop->fOpType & DISOPTYPE_DEFAULT_64_OP_SIZE) 563 563 && !(pCpu->fPrefix & DISPREFIX_OPSIZE)) 564 564 pCpu->uOpMode = DISCPUMODE_64BIT; … … 1077 1077 * encoding of the MOD field in the MODR/M byte. 1078 1078 */ 1079 if (pOp-> optype & DISOPTYPE_MOD_FIXED_11)1079 if (pOp->fOpType & DISOPTYPE_MOD_FIXED_11) 1080 1080 pCpu->ModRM.Bits.Mod = 3; 1081 1081 … … 1123 1123 * encoding of the MOD field in the MODR/M byte. 1124 1124 */ 1125 if (pOp-> optype & DISOPTYPE_MOD_FIXED_11)1125 if (pOp->fOpType & DISOPTYPE_MOD_FIXED_11) 1126 1126 pCpu->ModRM.Bits.Mod = 3; 1127 1127 … … 1568 1568 /* Use 64-bit registers. */ 1569 1569 pParam->base.reg_gen = pParam->param - OP_PARM_REG_GEN32_START; 1570 if ( (pOp-> optype & DISOPTYPE_REXB_EXTENDS_OPREG)1570 if ( (pOp->fOpType & DISOPTYPE_REXB_EXTENDS_OPREG) 1571 1571 && pParam == &pCpu->param1 /* ugly assumption that it only applies to the first parameter */ 1572 1572 && (pCpu->fPrefix & DISPREFIX_REX) … … 1612 1612 if (pCpu->uOpMode == DISCPUMODE_64BIT) 1613 1613 { 1614 if ( (pOp-> optype & DISOPTYPE_REXB_EXTENDS_OPREG)1614 if ( (pOp->fOpType & DISOPTYPE_REXB_EXTENDS_OPREG) 1615 1615 && pParam == &pCpu->param1 /* ugly assumption that it only applies to the first parameter */ 1616 1616 && (pCpu->fPrefix & DISPREFIX_REX) -
trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp
r41737 r41738 675 675 if ( pParam->param != OP_PARM_Ev 676 676 || pOp->uOpcode != OP_MOV 677 || ( pOp-> param1 != OP_PARM_Sw678 && pOp-> param2 != OP_PARM_Sw))677 || ( pOp->fParam1 != OP_PARM_Sw 678 && pOp->fParam2 != OP_PARM_Sw)) 679 679 PUT_SIZE_OVERRIDE(); 680 680 PUT_C('['); … … 792 792 case DISUSE_IMMEDIATE8: 793 793 if ( (fFlags & DIS_FMT_FLAGS_STRICT) 794 && ( (pOp-> param1 >= OP_PARM_REG_GEN8_START && pOp->param1 <= OP_PARM_REG_GEN8_END)795 || (pOp-> param2 >= OP_PARM_REG_GEN8_START && pOp->param2 <= OP_PARM_REG_GEN8_END))794 && ( (pOp->fParam1 >= OP_PARM_REG_GEN8_START && pOp->fParam1 <= OP_PARM_REG_GEN8_END) 795 || (pOp->fParam2 >= OP_PARM_REG_GEN8_START && pOp->fParam2 <= OP_PARM_REG_GEN8_END)) 796 796 ) 797 797 PUT_SZ("strict byte "); … … 803 803 || ( (fFlags & DIS_FMT_FLAGS_STRICT) 804 804 && ( (int8_t)pParam->parval == (int16_t)pParam->parval 805 || (pOp-> param1 >= OP_PARM_REG_GEN16_START && pOp->param1 <= OP_PARM_REG_GEN16_END)806 || (pOp-> param2 >= OP_PARM_REG_GEN16_START && pOp->param2 <= OP_PARM_REG_GEN16_END))805 || (pOp->fParam1 >= OP_PARM_REG_GEN16_START && pOp->fParam1 <= OP_PARM_REG_GEN16_END) 806 || (pOp->fParam2 >= OP_PARM_REG_GEN16_START && pOp->fParam2 <= OP_PARM_REG_GEN16_END)) 807 807 ) 808 808 ) … … 826 826 || ( (fFlags & DIS_FMT_FLAGS_STRICT) 827 827 && ( (int8_t)pParam->parval == (int32_t)pParam->parval 828 || (pOp-> param1 >= OP_PARM_REG_GEN32_START && pOp->param1 <= OP_PARM_REG_GEN32_END)829 || (pOp-> param2 >= OP_PARM_REG_GEN32_START && pOp->param2 <= OP_PARM_REG_GEN32_END))828 || (pOp->fParam1 >= OP_PARM_REG_GEN32_START && pOp->fParam1 <= OP_PARM_REG_GEN32_END) 829 || (pOp->fParam2 >= OP_PARM_REG_GEN32_START && pOp->fParam2 <= OP_PARM_REG_GEN32_END)) 830 830 ) 831 831 ) … … 1302 1302 { 1303 1303 Assert(pCpu->fPrefix & DISPREFIX_ADDRSIZE); 1304 if ( pCpu->pCurInstr-> param3 == OP_PARM_NONE1305 && pCpu->pCurInstr-> param2 == OP_PARM_NONE1306 && ( pCpu->pCurInstr-> param1 >= OP_PARM_REG_GEN32_START1307 && pCpu->pCurInstr-> param1 <= OP_PARM_REG_GEN32_END))1304 if ( pCpu->pCurInstr->fParam3 == OP_PARM_NONE 1305 && pCpu->pCurInstr->fParam2 == OP_PARM_NONE 1306 && ( pCpu->pCurInstr->fParam1 >= OP_PARM_REG_GEN32_START 1307 && pCpu->pCurInstr->fParam1 <= OP_PARM_REG_GEN32_END)) 1308 1308 return true; 1309 1309 } … … 1319 1319 1320 1320 case OP_JMP: 1321 if ( pCpu->pCurInstr-> param1 != OP_PARM_Jb1322 && pCpu->pCurInstr-> param1 != OP_PARM_Jv)1321 if ( pCpu->pCurInstr->fParam1 != OP_PARM_Jb 1322 && pCpu->pCurInstr->fParam1 != OP_PARM_Jv) 1323 1323 break; 1324 1324 /* fall thru */ … … 1352 1352 case OP_POP: 1353 1353 case OP_PUSH: 1354 if ( pCpu->pCurInstr-> param1 >= OP_PARM_REG_SEG_START1355 && pCpu->pCurInstr-> param1 <= OP_PARM_REG_SEG_END)1354 if ( pCpu->pCurInstr->fParam1 >= OP_PARM_REG_SEG_START 1355 && pCpu->pCurInstr->fParam1 <= OP_PARM_REG_SEG_END) 1356 1356 return true; 1357 1357 if ( (fPrefixes & ~DISPREFIX_OPSIZE) 1358 && pCpu->pCurInstr-> param1 >= OP_PARM_REG_GEN32_START1359 && pCpu->pCurInstr-> param1 <= OP_PARM_REG_GEN32_END)1358 && pCpu->pCurInstr->fParam1 >= OP_PARM_REG_GEN32_START 1359 && pCpu->pCurInstr->fParam1 <= OP_PARM_REG_GEN32_END) 1360 1360 return true; 1361 1361 break; … … 1373 1373 /* Implicit 8-bit register instructions doesn't mix with operand size. */ 1374 1374 if ( (fPrefixes & DISPREFIX_OPSIZE) 1375 && ( ( pCpu->pCurInstr-> param1 == OP_PARM_Gb /* r8 */1376 && pCpu->pCurInstr-> param2 == OP_PARM_Eb /* r8/mem8 */)1377 || ( pCpu->pCurInstr-> param2 == OP_PARM_Gb /* r8 */1378 && pCpu->pCurInstr-> param1 == OP_PARM_Eb /* r8/mem8 */))1375 && ( ( pCpu->pCurInstr->fParam1 == OP_PARM_Gb /* r8 */ 1376 && pCpu->pCurInstr->fParam2 == OP_PARM_Eb /* r8/mem8 */) 1377 || ( pCpu->pCurInstr->fParam2 == OP_PARM_Gb /* r8 */ 1378 && pCpu->pCurInstr->fParam1 == OP_PARM_Eb /* r8/mem8 */)) 1379 1379 ) 1380 1380 { … … 1415 1415 case OP_XOR: 1416 1416 case OP_CMP: 1417 if ( ( pCpu->pCurInstr-> param1 == OP_PARM_Gb /* r8 */1418 && pCpu->pCurInstr-> param2 == OP_PARM_Eb /* r8/mem8 */)1419 || ( pCpu->pCurInstr-> param1 == OP_PARM_Gv /* rX */1420 && pCpu->pCurInstr-> param2 == OP_PARM_Ev /* rX/memX */))1417 if ( ( pCpu->pCurInstr->fParam1 == OP_PARM_Gb /* r8 */ 1418 && pCpu->pCurInstr->fParam2 == OP_PARM_Eb /* r8/mem8 */) 1419 || ( pCpu->pCurInstr->fParam1 == OP_PARM_Gv /* rX */ 1420 && pCpu->pCurInstr->fParam2 == OP_PARM_Ev /* rX/memX */)) 1421 1421 return true; 1422 1422 … … 1448 1448 1449 1449 /* shl eax,1 will be assembled to the form without the immediate byte. */ 1450 if ( pCpu->pCurInstr-> param2 == OP_PARM_Ib1450 if ( pCpu->pCurInstr->fParam2 == OP_PARM_Ib 1451 1451 && (uint8_t)pCpu->param2.parval == 1) 1452 1452 { -
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r41737 r41738 881 881 882 882 case OP_PUSH: 883 if (pCpu->pCurInstr-> param1 != OP_PARM_REG_CS)883 if (pCpu->pCurInstr->fParam1 != OP_PARM_REG_CS) 884 884 break; 885 885 … … 956 956 { 957 957 // return or jump/call through a jump table 958 if (OP_PARM_VTYPE(pCpu->pCurInstr-> param1) != OP_PARM_J)958 if (OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J) 959 959 { 960 960 #ifdef DEBUG … … 1304 1304 * If it's harmless, then don't bother checking it (the disasm tables had better be accurate!) 1305 1305 */ 1306 if ((cpu.pCurInstr-> optype & ~DISOPTYPE_RRM_MASK) == DISOPTYPE_HARMLESS)1306 if ((cpu.pCurInstr->fOpType & ~DISOPTYPE_RRM_MASK) == DISOPTYPE_HARMLESS) 1307 1307 { 1308 1308 AssertMsg(pfnCSAMR3Analyse(pVM, &cpu, pInstrGC, pCurInstrGC, pCacheRec, (void *)pPage) == VWRN_CONTINUE_ANALYSIS, ("Instruction incorrectly marked harmless?!?!?\n")); … … 1327 1327 1328 1328 // For our first attempt, we'll handle only simple relative jumps and calls (immediate offset coded in instruction) 1329 if ( ((cpu.pCurInstr-> optype & DISOPTYPE_CONTROLFLOW) && (OP_PARM_VTYPE(cpu.pCurInstr->param1) == OP_PARM_J))1329 if ( ((cpu.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) && (OP_PARM_VTYPE(cpu.pCurInstr->fParam1) == OP_PARM_J)) 1330 1330 || (cpu.pCurInstr->uOpcode == OP_CALL && cpu.param1.fUse == DISUSE_DISPLACEMENT32)) /* simple indirect call (call dword ptr [address]) */ 1331 1331 { … … 1395 1395 1396 1396 rc = VWRN_CONTINUE_ANALYSIS; 1397 } //if ((cpu.pCurInstr-> optype & DISOPTYPE_CONTROLFLOW) && (OP_PARM_VTYPE(cpu.pCurInstr->param1) == OP_PARM_J))1397 } //if ((cpu.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) && (OP_PARM_VTYPE(cpu.pCurInstr->fParam1) == OP_PARM_J)) 1398 1398 #ifdef CSAM_SCAN_JUMP_TABLE 1399 1399 else … … 2567 2567 if ( rc == VINF_SUCCESS 2568 2568 && cpu.pCurInstr->uOpcode == OP_PUSH 2569 && cpu.pCurInstr-> param1 == OP_PARM_REG_CS)2569 && cpu.pCurInstr->fParam1 == OP_PARM_REG_CS) 2570 2570 { 2571 2571 rc = PATMR3InstallPatch(pVM, pHandler - aOpenBsdPushCSOffset[i], PATMFL_CODE32 | PATMFL_GUEST_SPECIFIC); -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r41737 r41738 622 622 rc = CPUMR3DisasmInstrCPU(pVM, pVCpu, pCtx, pCtx->rip, &cpu, "Guest Trap: "); 623 623 if ( RT_SUCCESS(rc) 624 && (cpu.pCurInstr-> optype & DISOPTYPE_PORTIO))624 && (cpu.pCurInstr->fOpType & DISOPTYPE_PORTIO)) 625 625 { 626 626 /* -
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r41737 r41738 1395 1395 { 1396 1396 /* No unconditional jumps or calls without fixed displacements. */ 1397 if ( (pCpu->pCurInstr-> optype & DISOPTYPE_CONTROLFLOW)1397 if ( (pCpu->pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) 1398 1398 && (pCpu->pCurInstr->uOpcode == OP_JMP || pCpu->pCurInstr->uOpcode == OP_CALL) 1399 1399 ) … … 1402 1402 if ( pCpu->param1.cb == 6 /* far call/jmp */ 1403 1403 || (pCpu->pCurInstr->uOpcode == OP_CALL && !(pPatch->flags & PATMFL_SUPPORT_CALLS)) 1404 || (OP_PARM_VTYPE(pCpu->pCurInstr-> param1) != OP_PARM_J && !(pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS))1404 || (OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J && !(pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS)) 1405 1405 ) 1406 1406 { … … 1502 1502 1503 1503 default: 1504 if (pCpu->pCurInstr-> optype & (DISOPTYPE_PRIVILEGED_NOTRAP))1504 if (pCpu->pCurInstr->fOpType & (DISOPTYPE_PRIVILEGED_NOTRAP)) 1505 1505 { 1506 1506 patmAddIllegalInstrRecord(pVM, pPatch, pCurInstrGC); … … 1511 1511 1512 1512 /* If single instruction patch, we've copied enough instructions *and* the current instruction is not a relative jump. */ 1513 if ((pPatch->flags & PATMFL_CHECK_SIZE) && pPatch->cbPatchBlockSize > SIZEOF_NEARJUMP32 && !(pCpu->pCurInstr-> optype & DISOPTYPE_RELATIVE_CONTROLFLOW))1513 if ((pPatch->flags & PATMFL_CHECK_SIZE) && pPatch->cbPatchBlockSize > SIZEOF_NEARJUMP32 && !(pCpu->pCurInstr->fOpType & DISOPTYPE_RELATIVE_CONTROLFLOW)) 1514 1514 { 1515 1515 /* The end marker for this kind of patch is any instruction at a location outside our patch jump. */ … … 1554 1554 { 1555 1555 // no unconditional jumps or calls without fixed displacements 1556 if ( (pCpu->pCurInstr-> optype & DISOPTYPE_CONTROLFLOW)1556 if ( (pCpu->pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) 1557 1557 && (pCpu->pCurInstr->uOpcode == OP_JMP || pCpu->pCurInstr->uOpcode == OP_CALL) 1558 1558 ) … … 1561 1561 if ( pCpu->param1.cb == 6 /* far call/jmp */ 1562 1562 || (pCpu->pCurInstr->uOpcode == OP_CALL && !(pPatch->flags & PATMFL_SUPPORT_CALLS)) 1563 || (OP_PARM_VTYPE(pCpu->pCurInstr-> param1) != OP_PARM_J && !(pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS))1563 || (OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J && !(pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS)) 1564 1564 ) 1565 1565 { … … 1583 1583 #if 0 1584 1584 ///@todo we can handle certain in/out and privileged instructions in the guest context 1585 if (pCpu->pCurInstr-> optype & DISOPTYPE_PRIVILEGED && pCpu->pCurInstr->uOpcode != OP_STI)1585 if (pCpu->pCurInstr->fOpType & DISOPTYPE_PRIVILEGED && pCpu->pCurInstr->uOpcode != OP_STI) 1586 1586 { 1587 1587 Log(("Illegal instructions for function patch!!\n")); … … 1616 1616 return VWRN_CONTINUE_ANALYSIS; 1617 1617 default: 1618 if (pCpu->pCurInstr-> optype & (DISOPTYPE_PRIVILEGED_NOTRAP))1618 if (pCpu->pCurInstr->fOpType & (DISOPTYPE_PRIVILEGED_NOTRAP)) 1619 1619 { 1620 1620 patmAddIllegalInstrRecord(pVM, pPatch, pCurInstrGC); … … 1694 1694 * Indirect calls are handled below. 1695 1695 */ 1696 if ( (pCpu->pCurInstr-> optype & DISOPTYPE_CONTROLFLOW)1696 if ( (pCpu->pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) 1697 1697 && (pCpu->pCurInstr->uOpcode != OP_CALL || (pPatch->flags & PATMFL_SUPPORT_CALLS)) 1698 && (OP_PARM_VTYPE(pCpu->pCurInstr-> param1) == OP_PARM_J))1698 && (OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) == OP_PARM_J)) 1699 1699 { 1700 1700 RCPTRTYPE(uint8_t *) pTargetGC = PATMResolveBranch(pCpu, pCurInstrGC); … … 1745 1745 1746 1746 case OP_MOV: 1747 if (pCpu->pCurInstr-> optype & DISOPTYPE_POTENTIALLY_DANGEROUS)1747 if (pCpu->pCurInstr->fOpType & DISOPTYPE_POTENTIALLY_DANGEROUS) 1748 1748 { 1749 1749 /* mov ss, src? */ … … 1772 1772 1773 1773 case OP_POP: 1774 if (pCpu->pCurInstr-> param1 == OP_PARM_REG_SS)1775 { 1776 Assert(pCpu->pCurInstr-> optype & DISOPTYPE_INHIBIT_IRQS);1774 if (pCpu->pCurInstr->fParam1 == OP_PARM_REG_SS) 1775 { 1776 Assert(pCpu->pCurInstr->fOpType & DISOPTYPE_INHIBIT_IRQS); 1777 1777 1778 1778 Log(("Force recompilation of next instruction for OP_MOV at %RRv\n", pCurInstrGC)); … … 1879 1879 1880 1880 case OP_PUSH: 1881 if (pCpu->pCurInstr-> param1 == OP_PARM_REG_CS)1881 if (pCpu->pCurInstr->fParam1 == OP_PARM_REG_CS) 1882 1882 { 1883 1883 rc = patmPatchGenPushCS(pVM, pPatch); … … 1979 1979 case OP_MOV_DR: 1980 1980 /* Note: currently we let DRx writes cause a trap d; our trap handler will decide to interpret it or not. */ 1981 if (pCpu->pCurInstr-> param2 == OP_PARM_Dd)1981 if (pCpu->pCurInstr->fParam2 == OP_PARM_Dd) 1982 1982 { 1983 1983 rc = patmPatchGenMovDebug(pVM, pPatch, pCpu); … … 1990 1990 case OP_MOV_CR: 1991 1991 /* Note: currently we let CRx writes cause a trap d; our trap handler will decide to interpret it or not. */ 1992 if (pCpu->pCurInstr-> param2 == OP_PARM_Cd)1992 if (pCpu->pCurInstr->fParam2 == OP_PARM_Cd) 1993 1993 { 1994 1994 rc = patmPatchGenMovControl(pVM, pPatch, pCpu); … … 2000 2000 2001 2001 default: 2002 if (pCpu->pCurInstr-> optype & (DISOPTYPE_CONTROLFLOW | DISOPTYPE_PRIVILEGED_NOTRAP))2002 if (pCpu->pCurInstr->fOpType & (DISOPTYPE_CONTROLFLOW | DISOPTYPE_PRIVILEGED_NOTRAP)) 2003 2003 { 2004 2004 gen_illegal_instr: … … 2049 2049 if ( (pPatch->flags & PATMFL_CHECK_SIZE) 2050 2050 && pCurInstrGC + pCpu->cbInstr - pInstrGC >= SIZEOF_NEARJUMP32 2051 && !(pCpu->pCurInstr-> optype & DISOPTYPE_RELATIVE_CONTROLFLOW)2051 && !(pCpu->pCurInstr->fOpType & DISOPTYPE_RELATIVE_CONTROLFLOW) 2052 2052 && !(pPatch->flags & PATMFL_RECOMPILE_NEXT) /* do not do this when the next instruction *must* be executed! */ 2053 2053 ) … … 2232 2232 2233 2233 /* For our first attempt, we'll handle only simple relative jumps and calls (immediate offset coded in instruction) */ 2234 if ( (cpu.pCurInstr-> optype & DISOPTYPE_CONTROLFLOW)2235 && (OP_PARM_VTYPE(cpu.pCurInstr-> param1) == OP_PARM_J)2234 if ( (cpu.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) 2235 && (OP_PARM_VTYPE(cpu.pCurInstr->fParam1) == OP_PARM_J) 2236 2236 && cpu.pCurInstr->uOpcode != OP_CALL /* complete functions are replaced; don't bother here. */ 2237 2237 ) … … 2419 2419 2420 2420 default: 2421 if (cpunext.pCurInstr-> optype & DISOPTYPE_CONTROLFLOW)2421 if (cpunext.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) 2422 2422 { 2423 2423 Log(("Unexpected control flow instruction after inhibit irq instruction\n")); … … 2453 2453 2454 2454 /* For our first attempt, we'll handle only simple relative jumps and calls (immediate offset coded in instruction). */ 2455 if ( (cpu.pCurInstr-> optype & DISOPTYPE_CONTROLFLOW)2456 && (OP_PARM_VTYPE(cpu.pCurInstr-> param1) == OP_PARM_J)2455 if ( (cpu.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) 2456 && (OP_PARM_VTYPE(cpu.pCurInstr->fParam1) == OP_PARM_J) 2457 2457 && cpu.pCurInstr->uOpcode != OP_CALL /* complete functions are replaced; don't bother here. */ 2458 2458 ) … … 2469 2469 2470 2470 /* We don't check if the branch target lies in a valid page as we've already done that in the analysis phase. */ 2471 if (!(cpu.pCurInstr-> optype & DISOPTYPE_UNCOND_CONTROLFLOW))2471 if (!(cpu.pCurInstr->fOpType & DISOPTYPE_UNCOND_CONTROLFLOW)) 2472 2472 { 2473 2473 Log(("patmRecompileCodeStream continue passed conditional jump\n")); … … 2517 2517 } 2518 2518 else 2519 if (cpu.pCurInstr-> optype & DISOPTYPE_UNCOND_CONTROLFLOW)2519 if (cpu.pCurInstr->fOpType & DISOPTYPE_UNCOND_CONTROLFLOW) 2520 2520 { 2521 2521 rc = VINF_SUCCESS; … … 5198 5198 if ( disret == true 5199 5199 && (pConflictPatch->flags & PATMFL_CODE32) 5200 && (cpu.pCurInstr->uOpcode == OP_JMP || (cpu.pCurInstr-> optype & DISOPTYPE_COND_CONTROLFLOW))5200 && (cpu.pCurInstr->uOpcode == OP_JMP || (cpu.pCurInstr->fOpType & DISOPTYPE_COND_CONTROLFLOW)) 5201 5201 && (cpu.param1.fUse & DISUSE_IMMEDIATE32_REL)) 5202 5202 { … … 6014 6014 rc = CPUMR3DisasmInstrCPU(pVM, pVCpu, pCtx, pCurPatchInstrGC, &CpuOld, 0); 6015 6015 if ( RT_FAILURE(rc) 6016 || !(CpuOld.pCurInstr-> optype & DISOPTYPE_HARMLESS))6016 || !(CpuOld.pCurInstr->fOpType & DISOPTYPE_HARMLESS)) 6017 6017 { 6018 6018 if (RT_SUCCESS(rc)) … … 6050 6050 6051 6051 if ( RT_SUCCESS(rc) 6052 && (CpuOld.pCurInstr-> optype & DISOPTYPE_HARMLESS)6052 && (CpuOld.pCurInstr->fOpType & DISOPTYPE_HARMLESS) 6053 6053 ) 6054 6054 { … … 6065 6065 rc = CPUMR3DisasmInstrCPU(pVM, pVCpu, pCtx, pCurInstrGC, &CpuNew, 0); 6066 6066 6067 fValidInstr = !!(CpuNew.pCurInstr-> optype & DISOPTYPE_HARMLESS);6067 fValidInstr = !!(CpuNew.pCurInstr->fOpType & DISOPTYPE_HARMLESS); 6068 6068 if ( !fValidInstr 6069 && (CpuNew.pCurInstr-> optype & DISOPTYPE_RELATIVE_CONTROLFLOW)6069 && (CpuNew.pCurInstr->fOpType & DISOPTYPE_RELATIVE_CONTROLFLOW) 6070 6070 ) 6071 6071 { -
trunk/src/VBox/VMM/VMMR3/PATMGuest.cpp
r41737 r41738 235 235 * cli 236 236 */ 237 if (pCpu->pCurInstr-> param1 == OP_PARM_REG_CS)237 if (pCpu->pCurInstr->fParam1 == OP_PARM_REG_CS) 238 238 return PATMPatchOpenBSDHandlerPrefix(pVM, pCpu, pInstrGC, pInstrHC, pPatchRec); 239 239 -
trunk/src/VBox/VMM/VMMR3/PATMPatch.cpp
r41737 r41738 695 695 Log(("patmPatchGenIndirectCall\n")); 696 696 Assert(pCpu->param1.cb == 4); 697 Assert(OP_PARM_VTYPE(pCpu->pCurInstr-> param1) != OP_PARM_J);697 Assert(OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J); 698 698 699 699 /* We push it onto the stack here, so the guest's context isn't ruined when this happens to cause … … 720 720 AssertMsg(PATMIsPatchGCAddr(pVM, pTargetGC) == false, ("Target is already a patch address (%RRv)?!?\n", pTargetGC)); 721 721 Assert(pTargetGC); 722 Assert(OP_PARM_VTYPE(pCpu->pCurInstr-> param1) == OP_PARM_J);722 Assert(OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) == OP_PARM_J); 723 723 724 724 /** @todo wasting memory as the complex search is overkill and we need only one lookup slot... */ … … 791 791 Log(("patmPatchGenIndirectJump\n")); 792 792 Assert(pCpu->param1.cb == 4); 793 Assert(OP_PARM_VTYPE(pCpu->pCurInstr-> param1) != OP_PARM_J);793 Assert(OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J); 794 794 795 795 /* We push it onto the stack here, so the guest's context isn't ruined when this happens to cause … … 1158 1158 mod = 0; //effective address (only) 1159 1159 rm = 5; //disp32 1160 if (pCpu->pCurInstr-> param1 == OP_PARM_Dd)1160 if (pCpu->pCurInstr->fParam1 == OP_PARM_Dd) 1161 1161 { 1162 1162 Assert(0); // You not come here. Illegal! … … 1208 1208 mod = 0; //effective address (only) 1209 1209 rm = 5; //disp32 1210 if (pCpu->pCurInstr-> param1 == OP_PARM_Cd)1210 if (pCpu->pCurInstr->fParam1 == OP_PARM_Cd) 1211 1211 { 1212 1212 Assert(0); // You not come here. Illegal! -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r41737 r41738 992 992 */ 993 993 if ( pVCpu->trpm.s.uActiveErrorCode == 0 994 && (Cpu.pCurInstr-> optype & DISOPTYPE_PORTIO))994 && (Cpu.pCurInstr->fOpType & DISOPTYPE_PORTIO)) 995 995 { 996 996 VBOXSTRICTRC rcStrict = IOMRCIOPortHandler(pVM, pRegFrame, &Cpu);
Note:
See TracChangeset
for help on using the changeset viewer.