VirtualBox

Changeset 61968 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Jun 30, 2016 5:42:31 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108414
Message:

IEM: Fixed setjmp bug (still disabled). Made IEMExecLots execute lots of instructions instead of just one, forcing us to return an instruction count and add proper flushing of the prefetch buffer.

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r61899 r61968  
    896896 * Initializes the decoder state.
    897897 *
     898 * iemReInitDecoder is mostly a copy of this function.
     899 *
    898900 * @param   pIemCpu             The per CPU IEM state.
    899901 * @param   fBypassHandlers     Whether to bypass access handlers.
     
    974976#endif
    975977}
     978
     979
     980/**
     981 * Reinitializes the decoder state 2nd+ loop of IEMExecLots.
     982 *
     983 * This is mostly a copy of iemInitDecoder.
     984 *
     985 * @param   pVCpu               The cross context virtual CPU structure of the calling EMT.
     986 * @param   pIemCpu             The per CPU IEM state.
     987 */
     988DECLINLINE(void) iemReInitDecoder(PVMCPU pVCpu, PIEMCPU pIemCpu)
     989{
     990    PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
     991
     992    Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_IEM));
     993
     994#if defined(VBOX_STRICT) && (defined(IEM_VERIFICATION_MODE_FULL) || !defined(VBOX_WITH_RAW_MODE_NOT_R0))
     995    Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->cs));
     996    Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->ss));
     997    Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->es));
     998    Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->ds));
     999    Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->fs));
     1000    Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->gs));
     1001    Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->ldtr));
     1002    Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pCtx->tr));
     1003#endif
     1004
     1005    pIemCpu->uCpl               = CPUMGetGuestCPL(pVCpu);   /** @todo this should be updated during execution! */
     1006#ifdef IEM_VERIFICATION_MODE_FULL
     1007    if (pIemCpu->uInjectCpl != UINT8_MAX)
     1008        pIemCpu->uCpl           = pIemCpu->uInjectCpl;
     1009#endif
     1010    IEMMODE enmMode = iemCalcCpuMode(pCtx);
     1011    pIemCpu->enmCpuMode         = enmMode;                  /** @todo this should be updated during execution! */
     1012    pIemCpu->enmDefAddrMode     = enmMode;  /** @todo check if this is correct... */
     1013    pIemCpu->enmEffAddrMode     = enmMode;
     1014    if (enmMode != IEMMODE_64BIT)
     1015    {
     1016        pIemCpu->enmDefOpSize   = enmMode;  /** @todo check if this is correct... */
     1017        pIemCpu->enmEffOpSize   = enmMode;
     1018    }
     1019    else
     1020    {
     1021        pIemCpu->enmDefOpSize   = IEMMODE_32BIT;
     1022        pIemCpu->enmEffOpSize   = IEMMODE_32BIT;
     1023    }
     1024    pIemCpu->fPrefixes          = 0;
     1025    pIemCpu->uRexReg            = 0;
     1026    pIemCpu->uRexB              = 0;
     1027    pIemCpu->uRexIndex          = 0;
     1028    pIemCpu->iEffSeg            = X86_SREG_DS;
     1029    if (pIemCpu->cbOpcode > pIemCpu->offOpcode) /* No need to check RIP here because branch instructions will update cbOpcode.  */
     1030    {
     1031        pIemCpu->cbOpcode      -= pIemCpu->offOpcode;
     1032        memmove(&pIemCpu->abOpcode[0], &pIemCpu->abOpcode[pIemCpu->offOpcode], pIemCpu->cbOpcode);
     1033    }
     1034    else
     1035        pIemCpu->cbOpcode       = 0;
     1036    pIemCpu->offOpcode          = 0;
     1037    Assert(pIemCpu->cActiveMappings == 0);
     1038    pIemCpu->iNextMapping       = 0;
     1039    Assert(pIemCpu->rcPassUp   == VINF_SUCCESS);
     1040    Assert(pIemCpu->fBypassHandlers == false);
     1041#ifdef VBOX_WITH_RAW_MODE_NOT_R0
     1042    if (!pIemCpu->fInPatchCode)
     1043    { /* likely */ }
     1044    else
     1045    {
     1046        pIemCpu->fInPatchCode   = pIemCpu->uCpl == 0
     1047                               && pCtx->cs.u64Base == 0
     1048                               && pCtx->cs.u32Limit == UINT32_MAX
     1049                               && PATMIsPatchGCAddr(IEMCPU_TO_VM(pIemCpu), pCtx->eip);
     1050        if (!pIemCpu->fInPatchCode)
     1051            CPUMRawLeave(pVCpu, VINF_SUCCESS);
     1052    }
     1053#endif
     1054
     1055#ifdef DBGFTRACE_ENABLED
     1056    switch (enmMode)
     1057    {
     1058        case IEMMODE_64BIT:
     1059            RTTraceBufAddMsgF(pVCpu->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf), "I64/%u %08llx", pIemCpu->uCpl, pCtx->rip);
     1060            break;
     1061        case IEMMODE_32BIT:
     1062            RTTraceBufAddMsgF(pVCpu->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf), "I32/%u %04x:%08x", pIemCpu->uCpl, pCtx->cs.Sel, pCtx->eip);
     1063            break;
     1064        case IEMMODE_16BIT:
     1065            RTTraceBufAddMsgF(pVCpu->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf), "I16/%u %04x:%04x", pIemCpu->uCpl, pCtx->cs.Sel, pCtx->eip);
     1066            break;
     1067    }
     1068#endif
     1069}
     1070
    9761071
    9771072
     
    17531848    } while (0)
    17541849#else
    1755 # define IEM_OPCODE_GET_NEXT_U16_ZX_U32(a_pu32) (*(a_pu32) = (int16_t)iemOpcodeGetNextU16Jmp(pIemCpu))
     1850# define IEM_OPCODE_GET_NEXT_U16_ZX_U32(a_pu32) (*(a_pu32) = iemOpcodeGetNextU16Jmp(pIemCpu))
    17561851#endif
    17571852
     
    18161911    } while (0)
    18171912#else
    1818 # define IEM_OPCODE_GET_NEXT_U16_ZX_U64(a_pu64)  (*(a_pu64) = (int16_t)iemOpcodeGetNextU16Jmp(pIemCpu))
     1913# define IEM_OPCODE_GET_NEXT_U16_ZX_U64(a_pu64)  (*(a_pu64) = iemOpcodeGetNextU16Jmp(pIemCpu))
    18191914#endif
    18201915
     
    20352130    } while (0)
    20362131#else
    2037 # define IEM_OPCODE_GET_NEXT_U32_ZX_U64(a_pu64) (*(a_pu64) = (int32_t)iemOpcodeGetNextU32Jmp(pIemCpu))
     2132# define IEM_OPCODE_GET_NEXT_U32_ZX_U64(a_pu64) (*(a_pu64) = iemOpcodeGetNextU32Jmp(pIemCpu))
    20382133#endif
    20392134
     
    42704365
    42714366    /*
     4367     * Flush prefetch buffer
     4368     */
     4369    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     4370
     4371    /*
    42724372     * Perform the V8086 IOPL check and upgrade the fault without nesting.
    42734373     */
     
    43744474    else
    43754475        rcStrict = iemRaiseXcptOrIntInProtMode( pIemCpu, pCtx, cbInstr, u8Vector, fFlags, uErr, uCr2);
     4476
     4477    /* Flush the prefetch buffer. */
     4478    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    43764479
    43774480    /*
     
    50915194
    50925195    pCtx->eflags.Bits.u1RF = 0;
     5196
     5197    /* Flush the prefetch buffer. */
     5198    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     5199
    50935200    return VINF_SUCCESS;
    50945201}
     
    51185225    pCtx->eflags.Bits.u1RF = 0;
    51195226
     5227    /* Flush the prefetch buffer. */
     5228    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     5229
    51205230    return VINF_SUCCESS;
    51215231}
     
    51565266    }
    51575267    pCtx->eflags.Bits.u1RF = 0;
     5268
     5269    /* Flush the prefetch buffer. */
     5270    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     5271
    51585272    return VINF_SUCCESS;
    51595273}
     
    52115325
    52125326    pCtx->eflags.Bits.u1RF = 0;
     5327
     5328    /* Flush the prefetch buffer. */
     5329    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     5330
    52135331    return VINF_SUCCESS;
    52145332}
     
    94219539#define IEM_MC_SET_RIP_U32(a_u32NewIP)                  IEM_MC_RETURN_ON_FAILURE(iemRegRipJump((pIemCpu), (a_u32NewIP)))
    94229540#define IEM_MC_SET_RIP_U64(a_u64NewIP)                  IEM_MC_RETURN_ON_FAILURE(iemRegRipJump((pIemCpu), (a_u64NewIP)))
    9423 
    94249541#define IEM_MC_RAISE_DIVIDE_ERROR()                     return iemRaiseDivideError(pIemCpu)
    94259542#define IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE()       \
     
    1236712484 * IEMExecOneWithPrefetchedByPC.
    1236812485 *
     12486 * Similar code is found in IEMExecLots.
     12487 *
    1236912488 * @return  Strict VBox status code.
    1237012489 * @param   pVCpu       The cross context virtual CPU structure of the calling EMT.
     
    1238512504        rcStrict = FNIEMOP_CALL(g_apfnOneByteMap[b]);
    1238612505    }
     12506    else
     12507        pIemCpu->cLongJumps++;
    1238712508    pIemCpu->CTX_SUFF(pJmpBuf) = pSavedJmpBuf;
    1238812509#else
     
    1239312514        pIemCpu->cInstructions++;
    1239412515    if (pIemCpu->cActiveMappings > 0)
     12516    {
     12517        Assert(rcStrict != VINF_SUCCESS);
    1239512518        iemMemRollback(pIemCpu);
     12519    }
    1239612520//#ifdef DEBUG
    1239712521//    AssertMsg(pIemCpu->offOpcode == cbInstr || rcStrict != VINF_SUCCESS, ("%u %u\n", pIemCpu->offOpcode, cbInstr));
     
    1241812542                rcStrict = FNIEMOP_CALL(g_apfnOneByteMap[b]);
    1241912543            }
     12544            else
     12545                pIemCpu->cLongJumps++;
    1242012546            pIemCpu->CTX_SUFF(pJmpBuf) = pSavedJmpBuf;
    1242112547#else
     
    1242612552                pIemCpu->cInstructions++;
    1242712553            if (pIemCpu->cActiveMappings > 0)
     12554            {
     12555                Assert(rcStrict != VINF_SUCCESS);
    1242812556                iemMemRollback(pIemCpu);
     12557            }
    1242912558        }
    1243012559        EMSetInhibitInterruptsPC(pVCpu, UINT64_C(0x7777555533331111));
     
    1267112800
    1267212801
    12673 VMMDECL(VBOXSTRICTRC) IEMExecLots(PVMCPU pVCpu)
    12674 {
    12675     PIEMCPU  pIemCpu = &pVCpu->iem.s;
    12676 
     12802VMMDECL(VBOXSTRICTRC) IEMExecLots(PVMCPU pVCpu, uint32_t *pcInstructions)
     12803{
     12804    PIEMCPU         pIemCpu              = &pVCpu->iem.s;
     12805    uint32_t const  cInstructionsAtStart = pIemCpu->cInstructions;
     12806
     12807#if defined(IEM_VERIFICATION_MODE_FULL) && defined(IN_RING3)
    1267712808    /*
    12678      * See if there is an interrupt pending in TRPM and inject it if we can.
     12809     * See if there is an interrupt pending in TRPM, inject it if we can.
    1267912810     */
    12680 #if !defined(IEM_VERIFICATION_MODE_FULL) || !defined(IN_RING3)
    1268112811    PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
    1268212812# ifdef IEM_VERIFICATION_MODE_FULL
     
    1269612826            TRPMResetTrap(pVCpu);
    1269712827    }
    12698 #else
    12699     iemExecVerificationModeSetup(pIemCpu);
    12700     PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
    12701 #endif
    1270212828
    1270312829    /*
    1270412830     * Log the state.
    1270512831     */
    12706 #ifdef LOG_ENABLED
     12832# ifdef LOG_ENABLED
    1270712833    iemLogCurInstr(pVCpu, pCtx, true);
    12708 #endif
     12834# endif
    1270912835
    1271012836    /*
     
    1271512841        rcStrict = iemExecOneInner(pVCpu, pIemCpu, true);
    1271612842
    12717 #if defined(IEM_VERIFICATION_MODE_FULL) && defined(IN_RING3)
    1271812843    /*
    1271912844     * Assert some sanity.
    1272012845     */
    1272112846    rcStrict = iemExecVerificationModeCheck(pIemCpu, rcStrict);
    12722 #endif
     12847
     12848    /*
     12849     * Log and return.
     12850     */
     12851    if (rcStrict != VINF_SUCCESS)
     12852        LogFlow(("IEMExecLots: cs:rip=%04x:%08RX64 ss:rsp=%04x:%08RX64 EFL=%06x - rcStrict=%Rrc\n",
     12853                 pCtx->cs.Sel, pCtx->rip, pCtx->ss.Sel, pCtx->rsp, pCtx->eflags.u, VBOXSTRICTRC_VAL(rcStrict)));
     12854    if (pcInstructions)
     12855        *pcInstructions = pIemCpu->cInstructions - cInstructionsAtStart;
     12856    return rcStrict;
     12857
     12858#else  /* Not verification mode */
     12859
     12860    /*
     12861     * See if there is an interrupt pending in TRPM, inject it if we can.
     12862     */
     12863    PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
     12864# ifdef IEM_VERIFICATION_MODE_FULL
     12865    pIemCpu->uInjectCpl = UINT8_MAX;
     12866# endif
     12867    if (   pCtx->eflags.Bits.u1IF
     12868        && TRPMHasTrap(pVCpu)
     12869        && EMGetInhibitInterruptsPC(pVCpu) != pCtx->rip)
     12870    {
     12871        uint8_t     u8TrapNo;
     12872        TRPMEVENT   enmType;
     12873        RTGCUINT    uErrCode;
     12874        RTGCPTR     uCr2;
     12875        int rc2 = TRPMQueryTrapAll(pVCpu, &u8TrapNo, &enmType, &uErrCode, &uCr2, NULL /* pu8InstLen */); AssertRC(rc2);
     12876        IEMInjectTrap(pVCpu, u8TrapNo, enmType, (uint16_t)uErrCode, uCr2, 0 /* cbInstr */);
     12877        if (!IEM_VERIFICATION_ENABLED(pIemCpu))
     12878            TRPMResetTrap(pVCpu);
     12879    }
     12880
     12881    /*
     12882     * Initial decoder init w/ prefetch, then setup setjmp.
     12883     */
     12884    VBOXSTRICTRC rcStrict = iemInitDecoderAndPrefetchOpcodes(pIemCpu, false);
     12885    if (rcStrict == VINF_SUCCESS)
     12886    {
     12887# ifdef IEM_WITH_SETJMP
     12888        jmp_buf         JmpBuf;
     12889        jmp_buf        *pSavedJmpBuf = pIemCpu->CTX_SUFF(pJmpBuf);
     12890        pIemCpu->CTX_SUFF(pJmpBuf)   = &JmpBuf;
     12891        pIemCpu->cActiveMappings     = 0;
     12892        if ((rcStrict = setjmp(JmpBuf)) == 0)
     12893# endif
     12894        {
     12895            /*
     12896             * The run loop.  We limit ourselves to 2048 instructions right now.
     12897             */
     12898            PVM         pVM    = pVCpu->CTX_SUFF(pVM);
     12899            uint32_t    cInstr = 2048;
     12900            for (;;)
     12901            {
     12902                /*
     12903                 * Log the state.
     12904                 */
     12905# ifdef LOG_ENABLED
     12906                iemLogCurInstr(pVCpu, pCtx, true);
     12907# endif
     12908
     12909                /*
     12910                 * Do the decoding and emulation.
     12911                 */
     12912                uint8_t b; IEM_OPCODE_GET_NEXT_U8(&b);
     12913                rcStrict = FNIEMOP_CALL(g_apfnOneByteMap[b]);
     12914                if (RT_LIKELY(rcStrict == VINF_SUCCESS))
     12915                {
     12916                    Assert(pIemCpu->cActiveMappings == 0);
     12917                    pIemCpu->cInstructions++;
     12918                    if (RT_LIKELY(pIemCpu->rcPassUp == VINF_SUCCESS))
     12919                    {
     12920                        if (RT_LIKELY(   !VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_ALL_MASK & ~VMCPU_FF_INHIBIT_INTERRUPTS)
     12921                                      && !VM_FF_IS_PENDING(pVM, VM_FF_ALL_MASK)
     12922                                      && cInstr-- > 0 ))
     12923                        {
     12924                            iemReInitDecoder(pVCpu, pIemCpu);
     12925                            continue;
     12926                        }
     12927                    }
     12928                }
     12929                else if (pIemCpu->cActiveMappings > 0) /** @todo This should only happen when rcStrict != VINF_SUCCESS! */
     12930                    iemMemRollback(pIemCpu);
     12931                rcStrict = iemExecStatusCodeFiddling(pIemCpu, rcStrict);
     12932                break;
     12933            }
     12934        }
     12935# ifdef IEM_WITH_SETJMP
     12936        else
     12937        {
     12938            if (pIemCpu->cActiveMappings > 0)
     12939                iemMemRollback(pIemCpu);
     12940            pIemCpu->cLongJumps++;
     12941        }
     12942# endif
     12943
     12944        /*
     12945         * Assert hidden register sanity (also done in iemInitDecoder and iemReInitDecoder).
     12946         */
     12947        Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pIemCpu->CTX_SUFF(pCtx)->cs));
     12948        Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pIemCpu->CTX_SUFF(pCtx)->ss));
     12949# if defined(IEM_VERIFICATION_MODE_FULL)
     12950        Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pIemCpu->CTX_SUFF(pCtx)->es));
     12951        Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pIemCpu->CTX_SUFF(pCtx)->ds));
     12952        Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pIemCpu->CTX_SUFF(pCtx)->fs));
     12953        Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pIemCpu->CTX_SUFF(pCtx)->gs));
     12954# endif
     12955    }
    1272312956
    1272412957    /*
    1272512958     * Maybe re-enter raw-mode and log.
    1272612959     */
    12727 #ifdef IN_RC
     12960# ifdef IN_RC
    1272812961    rcStrict = iemRCRawMaybeReenter(pIemCpu, pVCpu, pIemCpu->CTX_SUFF(pCtx), rcStrict);
    12729 #endif
     12962# endif
    1273012963    if (rcStrict != VINF_SUCCESS)
    1273112964        LogFlow(("IEMExecLots: cs:rip=%04x:%08RX64 ss:rsp=%04x:%08RX64 EFL=%06x - rcStrict=%Rrc\n",
    1273212965                 pCtx->cs.Sel, pCtx->rip, pCtx->ss.Sel, pCtx->rsp, pCtx->eflags.u, VBOXSTRICTRC_VAL(rcStrict)));
     12966    if (pcInstructions)
     12967        *pcInstructions = pIemCpu->cInstructions - cInstructionsAtStart;
    1273312968    return rcStrict;
     12969#endif /* Not verification mode */
    1273412970}
    1273512971
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h

    r61636 r61968  
    759759    pCtx->rip = uNewPC;
    760760    pCtx->eflags.Bits.u1RF = 0;
     761
     762    /* Flush the prefetch buffer. */
     763    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    761764    return VINF_SUCCESS;
    762765}
     
    782785    pCtx->rip = uNewPC;
    783786    pCtx->eflags.Bits.u1RF = 0;
     787
     788    /* Flush the prefetch buffer. */
     789    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    784790    return VINF_SUCCESS;
    785791}
     
    823829    pCtx->rip = uNewPC;
    824830    pCtx->eflags.Bits.u1RF = 0;
     831
     832    /* Flush the prefetch buffer. */
     833    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    825834    return VINF_SUCCESS;
    826835}
     
    846855    pCtx->rip = uNewPC;
    847856    pCtx->eflags.Bits.u1RF = 0;
     857
     858    /* Flush the prefetch buffer. */
     859    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    848860    return VINF_SUCCESS;
    849861}
     
    870882    pCtx->rip = uNewPC;
    871883    pCtx->eflags.Bits.u1RF = 0;
     884
     885    /* Flush the prefetch buffer. */
     886    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    872887    return VINF_SUCCESS;
    873888}
     
    893908    pCtx->rip = uNewPC;
    894909    pCtx->eflags.Bits.u1RF = 0;
     910
     911    /* Flush the prefetch buffer. */
     912    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     913
    895914    return VINF_SUCCESS;
    896915}
     
    16251644    }
    16261645    pCtx->eflags.Bits.u1RF = 0;
     1646
     1647    /* Flush the prefetch buffer. */
     1648    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    16271649    return VINF_SUCCESS;
    16281650#endif
     
    18471869    /** @todo check if the hidden bits are loaded correctly for 64-bit
    18481870     *        mode.  */
     1871
     1872    /* Flush the prefetch buffer. */
     1873    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     1874
    18491875    return VINF_SUCCESS;
    18501876}
     
    20662092    /** @todo check if the hidden bits are loaded correctly for 64-bit
    20672093     *        mode.  */
     2094
     2095    /* Flush the prefetch buffer. */
     2096    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     2097
    20682098    return VINF_SUCCESS;
    20692099}
     
    24662496        pCtx->eflags.Bits.u1RF = 0;
    24672497    }
     2498
     2499    /* Flush the prefetch buffer. */
     2500    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    24682501    return VINF_SUCCESS;
    24692502}
     
    25362569    pCtx->rsp = NewRsp.u;
    25372570    pCtx->eflags.Bits.u1RF = 0;
     2571
     2572    /* Flush the prefetch buffer. */
     2573    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    25382574
    25392575    return VINF_SUCCESS;
     
    28572893    IEMMISC_SET_EFL(pIemCpu, pCtx, uNewFlags);
    28582894
     2895    /* Flush the prefetch buffer. */
     2896    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     2897
    28592898    return VINF_SUCCESS;
    28602899}
     
    29322971    pCtx->rsp      = uNewEsp; /** @todo check this out! */
    29332972    pIemCpu->uCpl  = 3;
     2973
     2974    /* Flush the prefetch buffer. */
     2975    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    29342976
    29352977    return VINF_SUCCESS;
     
    33643406        /* Done! */
    33653407    }
     3408
     3409    /* Flush the prefetch buffer. */
     3410    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     3411
    33663412    return VINF_SUCCESS;
    33673413}
     
    36613707    }
    36623708
     3709    /* Flush the prefetch buffer. */
     3710    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     3711
    36633712    return VINF_SUCCESS;
    36643713}
     
    37853834    pCtx->ss.fFlags     = CPUMSELREG_FLAGS_VALID;
    37863835
     3836    /* Flush the prefetch buffer. */
     3837    pIemCpu->cbOpcode = pIemCpu->offOpcode;
     3838
    37873839    return VINF_SUCCESS;
    37883840}
     
    38853937    /** @todo Testcase: verify that SS.u1Long and SS.u1DefBig are left unchanged
    38863938     *        on sysret. */
     3939
     3940    /* Flush the prefetch buffer. */
     3941    pIemCpu->cbOpcode = pIemCpu->offOpcode;
    38873942
    38883943    return VINF_SUCCESS;
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