Changeset 66463 in vbox
- Timestamp:
- Apr 6, 2017 5:58:25 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114448
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r66336 r66463 549 549 550 550 551 /** Invalid with RM byte where both AMD and Intel decodes any additional 552 * address encoding bytes. */ 553 FNIEMOPRM_DEF(iemOp_InvalidWithRMAllNeeded) 554 { 555 IEMOP_MNEMONIC(InvalidWithRMAllNeeded, "InvalidWithRMAllNeeded"); 556 #ifndef TST_IEM_CHECK_MC 557 if ((bRm & X86_MODRM_MOD_MASK) != (3 << X86_MODRM_MOD_SHIFT)) 558 { 559 RTGCPTR GCPtrEff; 560 VBOXSTRICTRC rcStrict = iemOpHlpCalcRmEffAddr(pVCpu, bRm, 0, &GCPtrEff); 561 if (rcStrict != VINF_SUCCESS) 562 return rcStrict; 563 } 564 #endif 565 IEMOP_HLP_DONE_DECODING(); 566 return IEMOP_RAISE_INVALID_OPCODE(); 567 } 568 569 551 570 /** Invalid with RM byte where intel requires 8-byte immediate. 552 571 * Intel will also need SIB and displacement if bRm indicates memory. */ … … 614 633 615 634 635 /** Invalid opcode where both AMD and Intel requires Mod R/M sequence. */ 636 FNIEMOP_DEF(iemOp_InvalidAllNeedRM) 637 { 638 IEMOP_MNEMONIC(InvalidAllNeedRM, "InvalidAllNeedRM"); 639 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); RT_NOREF(bRm); 640 #ifndef TST_IEM_CHECK_MC 641 if ((bRm & X86_MODRM_MOD_MASK) != (3 << X86_MODRM_MOD_SHIFT)) 642 { 643 RTGCPTR GCPtrEff; 644 VBOXSTRICTRC rcStrict = iemOpHlpCalcRmEffAddr(pVCpu, bRm, 0, &GCPtrEff); 645 if (rcStrict != VINF_SUCCESS) 646 return rcStrict; 647 } 648 #endif 649 IEMOP_HLP_DONE_DECODING(); 650 return IEMOP_RAISE_INVALID_OPCODE(); 651 } 652 653 616 654 /** Invalid opcode where intel requires Mod R/M sequence and 8-byte 617 655 * immediate. */ -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsOneByte.cpp.h
r66462 r66463 1974 1974 { 1975 1975 Log(("evex not supported by the guest CPU!\n")); 1976 return FNIEMOP_CALL(iemOp_Invalid NeedRM);1976 return FNIEMOP_CALL(iemOp_InvalidAllNeedRM); 1977 1977 } 1978 1978 IEM_OPCODE_GET_NEXT_U8(&bRm); -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r66462 r66463 6028 6028 IEMOP_MNEMONIC1(M_MEM, CLFLUSH, clflush, MbRO, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZE); 6029 6029 if (!IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fClFlush) 6030 return IEMOP_RAISE_INVALID_OPCODE();6030 return FNIEMOP_CALL_1(iemOp_InvalidWithRMAllNeeded, bRm); 6031 6031 6032 6032 IEM_MC_BEGIN(2, 0); … … 6053 6053 IEMOP_MNEMONIC1(M_MEM, CLFLUSHOPT, clflushopt, MbRO, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZE); 6054 6054 if (!IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fClFlushOpt) 6055 return IEMOP_RAISE_INVALID_OPCODE();6055 return FNIEMOP_CALL_1(iemOp_InvalidWithRMAllNeeded, bRm); 6056 6056 6057 6057 IEM_MC_BEGIN(2, 0); -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66462 r66463 121 121 /** The encoding. */ 122 122 BS3CG1ENC enmEncoding; 123 /** The non-invalid encoding. This differs from enmEncoding when 124 * Bs3Cg1CalcNoneIntelInvalidEncoding has been called. */ 125 BS3CG1ENC enmEncodingNonInvalid; 123 126 /** The CPU test / CPU ID. */ 124 127 BS3CG1CPU enmCpuTest; … … 2219 2222 { 2220 2223 case BS3CG1ENC_MODRM_Gb_Eb: 2224 case BS3CG1ENC_MODRM_Gv_Ma: 2221 2225 case BS3CG1ENC_FIXED: 2222 2226 return BS3CG1ENC_FIXED; … … 2703 2707 2704 2708 default: 2709 if (pThis->enmEncoding != pThis->enmEncodingNonInvalid) 2710 goto l_advance_to_next; 2705 2711 return Bs3TestFailedF("Internal error: cbDst=%u idxField=%d (%d) offField=%#x: enmLocation=%u off=%#x idxField=%u", 2706 2712 cbDst, idxField, idxOp, offField, pThis->aOperands[idxOp].enmLocation, … … 2917 2923 * Advance to the next instruction. 2918 2924 */ 2925 l_advance_to_next: 2919 2926 pbCode += cbValue; 2920 2927 cbLeft -= cbValue; … … 3497 3504 */ 3498 3505 PCBS3CG1INSTR pInstr = &g_aBs3Cg1Instructions[iInstr]; 3499 pThis->iInstr = iInstr; 3500 pThis->pTestHdr = (PCBS3CG1TESTHDR)&g_abBs3Cg1Tests[pInstr->offTests]; 3501 pThis->fFlags = pInstr->fFlags; 3502 pThis->enmEncoding = (BS3CG1ENC)pInstr->enmEncoding; 3503 pThis->enmCpuTest = (BS3CG1CPU)pInstr->enmCpuTest; 3504 pThis->enmPrefixKind = (BS3CG1PFXKIND)pInstr->enmPrefixKind; 3505 pThis->enmXcptType = (BS3CG1XCPTTYPE)pInstr->enmXcptType; 3506 pThis->cchMnemonic = pInstr->cchMnemonic; 3506 pThis->iInstr = iInstr; 3507 pThis->pTestHdr = (PCBS3CG1TESTHDR)&g_abBs3Cg1Tests[pInstr->offTests]; 3508 pThis->fFlags = pInstr->fFlags; 3509 pThis->enmEncoding = (BS3CG1ENC)pInstr->enmEncoding; 3510 pThis->enmEncodingNonInvalid = (BS3CG1ENC)pInstr->enmEncoding; 3511 pThis->enmCpuTest = (BS3CG1CPU)pInstr->enmCpuTest; 3512 pThis->enmPrefixKind = (BS3CG1PFXKIND)pInstr->enmPrefixKind; 3513 pThis->enmXcptType = (BS3CG1XCPTTYPE)pInstr->enmXcptType; 3514 pThis->cchMnemonic = pInstr->cchMnemonic; 3507 3515 if (pThis->fAdvanceMnemonic) 3508 3516 Bs3TestSubF("%s / %.*s", pThis->pszModeShort, pThis->cchMnemonic, pThis->pchMnemonic); 3509 pThis->fAdvanceMnemonic = pInstr->fAdvanceMnemonic;3510 pThis->cOperands = pInstr->cOperands;3511 pThis->cbOpcodes = pInstr->cbOpcodes;3517 pThis->fAdvanceMnemonic = pInstr->fAdvanceMnemonic; 3518 pThis->cOperands = pInstr->cOperands; 3519 pThis->cbOpcodes = pInstr->cbOpcodes; 3512 3520 switch (pThis->cOperands) 3513 3521 { … … 3517 3525 case 1: pThis->aenmOperands[0] = (BS3CG1OP)pThis->pabOperands[0]; 3518 3526 } 3519 3520 3527 switch (pThis->cbOpcodes) 3521 3528 { … … 3526 3533 } 3527 3534 3528 /* Switch the encoder for some of the invalid instructions on non-intel CPUs. */3529 if ( (pThis->fFlags & BS3CG1INSTR_F_INTEL_DECODES_INVALID)3530 && pThis->bCpuVendor != BS3CPUVENDOR_INTEL3531 && ( (pThis->fFlags & (BS3CG1INSTR_F_UNUSED | BS3CG1INSTR_F_INVALID))3532 || (BS3_MODE_IS_64BIT_CODE(pThis->bMode) && (pThis->fFlags & BS3CG1INSTR_F_INVALID_64BIT)) ) )3533 pThis->enmEncoding = Bs3Cg1CalcNoneIntelInvalidEncoding(pThis->enmEncoding);3534 3535 3535 /* 3536 3536 * Check if the CPU supports the instruction. … … 3539 3539 || (pThis->fFlags & (BS3CG1INSTR_F_UNUSED | BS3CG1INSTR_F_INVALID))) 3540 3540 fOuterInvalidInstr = true; 3541 3542 /* Switch the encoder for some of the invalid instructions on non-intel CPUs. */ 3543 if ( (pThis->fFlags & BS3CG1INSTR_F_INTEL_DECODES_INVALID) 3544 && pThis->bCpuVendor != BS3CPUVENDOR_INTEL 3545 && ( (pThis->fFlags & (BS3CG1INSTR_F_UNUSED | BS3CG1INSTR_F_INVALID)) 3546 || (BS3_MODE_IS_64BIT_CODE(pThis->bMode) && (pThis->fFlags & BS3CG1INSTR_F_INVALID_64BIT)) 3547 || fOuterInvalidInstr ) ) 3548 pThis->enmEncoding = Bs3Cg1CalcNoneIntelInvalidEncoding(pThis->enmEncoding); 3541 3549 3542 3550 for (iCpuSetup = 0;; iCpuSetup++) … … 3705 3713 #if 0 3706 3714 /* (for debugging) */ 3707 if (bMode != BS3_MODE_PPV86)3715 if (bMode < BS3_MODE_LM16) 3708 3716 return BS3TESTDOMODE_SKIPPED; 3709 3717 #endif
Note:
See TracChangeset
for help on using the changeset viewer.