VirtualBox

Ignore:
Timestamp:
Jul 6, 2016 4:37:04 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108548
Message:

IEM: Make use of the direct CPUMCTX access (VMCPU_INCL_CPUM_GST_CTX).

File:
1 edited

Legend:

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

    r62015 r62076  
    176176static void iemHlpUpdateArithEFlagsU8(PVMCPU pVCpu, uint8_t u8Result, uint32_t fToUpdate, uint32_t fUndefined)
    177177{
    178     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     178    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    179179
    180180    uint32_t fEFlags = pCtx->eflags.u;
     
    232232IEM_CIMPL_DEF_0(iemCImpl_popa_16)
    233233{
    234     PCPUMCTX        pCtx        = pVCpu->iem.s.CTX_SUFF(pCtx);
     234    PCPUMCTX        pCtx        = IEM_GET_CTX(pVCpu);
    235235    RTGCPTR         GCPtrStart  = iemRegGetEffRsp(pVCpu, pCtx);
    236236    RTGCPTR         GCPtrLast   = GCPtrStart + 15;
     
    304304IEM_CIMPL_DEF_0(iemCImpl_popa_32)
    305305{
    306     PCPUMCTX        pCtx        = pVCpu->iem.s.CTX_SUFF(pCtx);
     306    PCPUMCTX        pCtx        = IEM_GET_CTX(pVCpu);
    307307    RTGCPTR         GCPtrStart  = iemRegGetEffRsp(pVCpu, pCtx);
    308308    RTGCPTR         GCPtrLast   = GCPtrStart + 31;
     
    385385IEM_CIMPL_DEF_0(iemCImpl_pusha_16)
    386386{
    387     PCPUMCTX        pCtx        = pVCpu->iem.s.CTX_SUFF(pCtx);
     387    PCPUMCTX        pCtx        = IEM_GET_CTX(pVCpu);
    388388    RTGCPTR         GCPtrTop    = iemRegGetEffRsp(pVCpu, pCtx);
    389389    RTGCPTR         GCPtrBottom = GCPtrTop - 15;
     
    457457IEM_CIMPL_DEF_0(iemCImpl_pusha_32)
    458458{
    459     PCPUMCTX        pCtx        = pVCpu->iem.s.CTX_SUFF(pCtx);
     459    PCPUMCTX        pCtx        = IEM_GET_CTX(pVCpu);
    460460    RTGCPTR         GCPtrTop    = iemRegGetEffRsp(pVCpu, pCtx);
    461461    RTGCPTR         GCPtrBottom = GCPtrTop - 31;
     
    532532IEM_CIMPL_DEF_1(iemCImpl_pushf, IEMMODE, enmEffOpSize)
    533533{
    534     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     534    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    535535
    536536    /*
     
    588588IEM_CIMPL_DEF_1(iemCImpl_popf, IEMMODE, enmEffOpSize)
    589589{
    590     PCPUMCTX        pCtx    = pVCpu->iem.s.CTX_SUFF(pCtx);
     590    PCPUMCTX        pCtx    = IEM_GET_CTX(pVCpu);
    591591    uint32_t const  fEflOld = IEMMISC_GET_EFL(pVCpu, pCtx);
    592592    VBOXSTRICTRC    rcStrict;
     
    748748IEM_CIMPL_DEF_1(iemCImpl_call_16, uint16_t, uNewPC)
    749749{
    750     PCPUMCTX pCtx   = pVCpu->iem.s.CTX_SUFF(pCtx);
     750    PCPUMCTX pCtx   = IEM_GET_CTX(pVCpu);
    751751    uint16_t uOldPC = pCtx->ip + cbInstr;
    752752    if (uNewPC > pCtx->cs.u32Limit)
     
    773773IEM_CIMPL_DEF_1(iemCImpl_call_rel_16, int16_t, offDisp)
    774774{
    775     PCPUMCTX pCtx   = pVCpu->iem.s.CTX_SUFF(pCtx);
     775    PCPUMCTX pCtx   = IEM_GET_CTX(pVCpu);
    776776    uint16_t uOldPC = pCtx->ip + cbInstr;
    777777    uint16_t uNewPC = uOldPC + offDisp;
     
    801801IEM_CIMPL_DEF_1(iemCImpl_call_32, uint32_t, uNewPC)
    802802{
    803     PCPUMCTX pCtx   = pVCpu->iem.s.CTX_SUFF(pCtx);
     803    PCPUMCTX pCtx   = IEM_GET_CTX(pVCpu);
    804804    uint32_t uOldPC = pCtx->eip + cbInstr;
    805805    if (uNewPC > pCtx->cs.u32Limit)
     
    843843IEM_CIMPL_DEF_1(iemCImpl_call_rel_32, int32_t, offDisp)
    844844{
    845     PCPUMCTX pCtx   = pVCpu->iem.s.CTX_SUFF(pCtx);
     845    PCPUMCTX pCtx   = IEM_GET_CTX(pVCpu);
    846846    uint32_t uOldPC = pCtx->eip + cbInstr;
    847847    uint32_t uNewPC = uOldPC + offDisp;
     
    871871IEM_CIMPL_DEF_1(iemCImpl_call_64, uint64_t, uNewPC)
    872872{
    873     PCPUMCTX pCtx   = pVCpu->iem.s.CTX_SUFF(pCtx);
     873    PCPUMCTX pCtx   = IEM_GET_CTX(pVCpu);
    874874    uint64_t uOldPC = pCtx->rip + cbInstr;
    875875    if (!IEM_IS_CANONICAL(uNewPC))
     
    896896IEM_CIMPL_DEF_1(iemCImpl_call_rel_64, int64_t, offDisp)
    897897{
    898     PCPUMCTX pCtx   = pVCpu->iem.s.CTX_SUFF(pCtx);
     898    PCPUMCTX pCtx   = IEM_GET_CTX(pVCpu);
    899899    uint64_t uOldPC = pCtx->rip + cbInstr;
    900900    uint64_t uNewPC = uOldPC + offDisp;
     
    951951    }
    952952
    953     PCPUMCTX pCtx     = pVCpu->iem.s.CTX_SUFF(pCtx);
     953    PCPUMCTX pCtx     = IEM_GET_CTX(pVCpu);
    954954    uint32_t uNextEip = pCtx->eip + cbInstr;
    955     return iemTaskSwitch(pVCpu, pVCpu->iem.s.CTX_SUFF(pCtx), enmBranch == IEMBRANCH_JUMP ? IEMTASKSWITCH_JUMP : IEMTASKSWITCH_CALL,
     955    return iemTaskSwitch(pVCpu, pCtx, enmBranch == IEMBRANCH_JUMP ? IEMTASKSWITCH_JUMP : IEMTASKSWITCH_CALL,
    956956                         uNextEip, 0 /* fFlags */, 0 /* uErr */, 0 /* uCr2 */, uSel, pDesc);
    957957#endif
     
    10201020    }
    10211021
    1022     PCPUMCTX pCtx     = pVCpu->iem.s.CTX_SUFF(pCtx);
     1022    PCPUMCTX pCtx     = IEM_GET_CTX(pVCpu);
    10231023    uint32_t uNextEip = pCtx->eip + cbInstr;
    1024     return iemTaskSwitch(pVCpu, pVCpu->iem.s.CTX_SUFF(pCtx), enmBranch == IEMBRANCH_JUMP ? IEMTASKSWITCH_JUMP : IEMTASKSWITCH_CALL,
     1024    return iemTaskSwitch(pVCpu, pCtx, enmBranch == IEMBRANCH_JUMP ? IEMTASKSWITCH_JUMP : IEMTASKSWITCH_CALL,
    10251025                         uNextEip, 0 /* fFlags */, 0 /* uErr */, 0 /* uCr2 */, uSelTss, &TssDesc);
    10261026#endif
     
    10611061    RTSEL           uNewCS;
    10621062    IEMSELDESC      DescCS;
    1063     PCPUMCTX        pCtx;
    10641063
    10651064    AssertCompile(X86_SEL_TYPE_SYS_386_CALL_GATE == AMD64_SEL_TYPE_SYS_CALL_GATE);
     
    11631162    }
    11641163
    1165     pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     1164    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    11661165
    11671166    if (enmBranch == IEMBRANCH_JUMP)
     
    17231722IEM_CIMPL_DEF_3(iemCImpl_FarJmp, uint16_t, uSel, uint64_t, offSeg, IEMMODE, enmEffOpSize)
    17241723{
    1725     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     1724    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    17261725    NOREF(cbInstr);
    17271726    Assert(offSeg <= UINT32_MAX);
     
    18881887IEM_CIMPL_DEF_3(iemCImpl_callf, uint16_t, uSel, uint64_t, offSeg, IEMMODE, enmEffOpSize)
    18891888{
    1890     PCPUMCTX        pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     1889    PCPUMCTX        pCtx = IEM_GET_CTX(pVCpu);
    18911890    VBOXSTRICTRC    rcStrict;
    18921891    uint64_t        uNewRsp;
     
    21092108IEM_CIMPL_DEF_2(iemCImpl_retf, IEMMODE, enmEffOpSize, uint16_t, cbPop)
    21102109{
    2111     PCPUMCTX        pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     2110    PCPUMCTX        pCtx = IEM_GET_CTX(pVCpu);
    21122111    VBOXSTRICTRC    rcStrict;
    21132112    RTCPTRUNION     uPtrFrame;
     
    25152514IEM_CIMPL_DEF_2(iemCImpl_retn, IEMMODE, enmEffOpSize, uint16_t, cbPop)
    25162515{
    2517     PCPUMCTX        pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     2516    PCPUMCTX        pCtx = IEM_GET_CTX(pVCpu);
    25182517    NOREF(cbInstr);
    25192518
     
    25872586IEM_CIMPL_DEF_3(iemCImpl_enter, IEMMODE, enmEffOpSize, uint16_t, cbFrame, uint8_t, cParameters)
    25882587{
    2589     PCPUMCTX        pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     2588    PCPUMCTX        pCtx = IEM_GET_CTX(pVCpu);
    25902589
    25912590    /* Push RBP, saving the old value in TmpRbp. */
     
    27032702IEM_CIMPL_DEF_1(iemCImpl_leave, IEMMODE, enmEffOpSize)
    27042703{
    2705     PCPUMCTX        pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     2704    PCPUMCTX        pCtx = IEM_GET_CTX(pVCpu);
    27062705
    27072706    /* Calculate the intermediate RSP from RBP and the stack attributes. */
     
    27742773IEM_CIMPL_DEF_1(iemCImpl_iret_real_v8086, IEMMODE, enmEffOpSize)
    27752774{
    2776     PCPUMCTX  pCtx  = pVCpu->iem.s.CTX_SUFF(pCtx);
     2775    PCPUMCTX  pCtx  = IEM_GET_CTX(pVCpu);
    27772776    X86EFLAGS Efl;
    27782777    Efl.u = IEMMISC_GET_EFL(pVCpu, pCtx);
     
    29942993     */
    29952994    RTSEL        uSelRet;
    2996     PCPUMCTX     pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     2995    PCPUMCTX     pCtx = IEM_GET_CTX(pVCpu);
    29972996    VBOXSTRICTRC rcStrict = iemMemFetchSysU16(pVCpu, &uSelRet, UINT8_MAX, pCtx->tr.u64Base);
    29982997    if (rcStrict != VINF_SUCCESS)
     
    30333032
    30343033    uint32_t uNextEip = pCtx->eip + cbInstr;
    3035     return iemTaskSwitch(pVCpu, pVCpu->iem.s.CTX_SUFF(pCtx), IEMTASKSWITCH_IRET, uNextEip, 0 /* fFlags */, 0 /* uErr */,
     3034    return iemTaskSwitch(pVCpu, pCtx, IEMTASKSWITCH_IRET, uNextEip, 0 /* fFlags */, 0 /* uErr */,
    30363035                         0 /* uCr2 */, uSelRet, &TssDesc);
    30373036#endif
     
    30463045IEM_CIMPL_DEF_1(iemCImpl_iret_prot, IEMMODE, enmEffOpSize)
    30473046{
    3048     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     3047    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    30493048    NOREF(cbInstr);
    30503049    Assert(enmEffOpSize == IEMMODE_32BIT || enmEffOpSize == IEMMODE_16BIT);
     
    34213420IEM_CIMPL_DEF_1(iemCImpl_iret_64bit, IEMMODE, enmEffOpSize)
    34223421{
    3423     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     3422    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    34243423    NOREF(cbInstr);
    34253424
     
    37443743IEM_CIMPL_DEF_0(iemCImpl_syscall)
    37453744{
    3746     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     3745    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    37473746
    37483747    /*
     
    38463845
    38473846{
    3848     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     3847    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    38493848
    38503849    /*
     
    39523951IEM_CIMPL_DEF_2(iemCImpl_LoadSReg, uint8_t, iSegReg, uint16_t, uSel)
    39533952{
    3954     /*PCPUMCTX        pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);*/
     3953    /*PCPUMCTX        pCtx = IEM_GET_CTX(pVCpu);*/
    39553954    uint16_t       *pSel = iemSRegRef(pVCpu, iSegReg);
    39563955    PCPUMSELREGHID  pHid = iemSRegGetHid(pVCpu, iSegReg);
     
    41424141        if (iSegReg == X86_SREG_SS)
    41434142        {
    4144             PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4143            PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    41454144            EMSetInhibitInterruptsPC(pVCpu, pCtx->rip);
    41464145        }
     
    41584157IEM_CIMPL_DEF_2(iemCImpl_pop_Sreg, uint8_t, iSegReg, IEMMODE, enmEffOpSize)
    41594158{
    4160     PCPUMCTX        pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4159    PCPUMCTX        pCtx = IEM_GET_CTX(pVCpu);
    41614160    VBOXSTRICTRC    rcStrict;
    41624161
     
    42204219                IEMMODE,  enmEffOpSize)
    42214220{
    4222     /*PCPUMCTX        pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);*/
     4221    /*PCPUMCTX        pCtx = IEM_GET_CTX(pVCpu);*/
    42234222    VBOXSTRICTRC    rcStrict;
    42244223
     
    42714270
    42724271    /* Within the table limits? */
    4273     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4272    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    42744273    RTGCPTR GCPtrBase;
    42754274    if (uSel & X86_SEL_LDT)
     
    43514350
    43524351    /* commit */
    4353     pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1ZF = fAccessible;
     4352    IEM_GET_CTX(pVCpu)->eflags.Bits.u1ZF = fAccessible;
    43544353
    43554354    iemRegAddToRipAndClearRF(pVCpu, cbInstr);
     
    43834382        if (!Desc.Legacy.Gen.u1DescType)
    43844383        {
    4385             if (CPUMIsGuestInLongModeEx(pVCpu->iem.s.CTX_SUFF(pCtx)))
     4384            if (CPUMIsGuestInLongModeEx(IEM_GET_CTX(pVCpu)))
    43864385            {
    43874386                if (Desc.Long.Gen.u5Zeros)
     
    44584457
    44594458    /* commit flags value and advance rip. */
    4460     pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1ZF = fDescOk;
     4459    IEM_GET_CTX(pVCpu)->eflags.Bits.u1ZF = fDescOk;
    44614460    iemRegAddToRipAndClearRF(pVCpu, cbInstr);
    44624461
     
    44944493    if (pVCpu->iem.s.uCpl != 0)
    44954494        return iemRaiseGeneralProtectionFault0(pVCpu);
    4496     Assert(!pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1VM);
     4495    Assert(!IEM_GET_CTX(pVCpu)->eflags.Bits.u1VM);
    44974496
    44984497    /*
     
    45114510            else
    45124511            {
    4513                 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4512                PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    45144513                pCtx->gdtr.cbGdt = cbLimit;
    45154514                pCtx->gdtr.pGdt  = GCPtrBase;
     
    45414540     *       you really must know.
    45424541     */
    4543     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4542    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    45444543    VBOXSTRICTRC rcStrict = iemMemStoreDataXdtr(pVCpu, pCtx->gdtr.cbGdt, pCtx->gdtr.pGdt, iEffSeg, GCPtrEffDst);
    45454544    if (rcStrict == VINF_SUCCESS)
     
    45604559    if (pVCpu->iem.s.uCpl != 0)
    45614560        return iemRaiseGeneralProtectionFault0(pVCpu);
    4562     Assert(!pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1VM);
     4561    Assert(!IEM_GET_CTX(pVCpu)->eflags.Bits.u1VM);
    45634562
    45644563    /*
     
    45774576            else
    45784577            {
    4579                 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4578                PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    45804579                pCtx->idtr.cbIdt = cbLimit;
    45814580                pCtx->idtr.pIdt  = GCPtrBase;
     
    46064605     *       you really must know.
    46074606     */
    4608     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4607    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    46094608    VBOXSTRICTRC rcStrict = iemMemStoreDataXdtr(pVCpu, pCtx->idtr.cbIdt, pCtx->idtr.pIdt, iEffSeg, GCPtrEffDst);
    46104609    if (rcStrict == VINF_SUCCESS)
     
    46214620IEM_CIMPL_DEF_1(iemCImpl_lldt, uint16_t, uNewLdt)
    46224621{
    4623     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4622    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    46244623
    46254624    /*
     
    47474746IEM_CIMPL_DEF_1(iemCImpl_ltr, uint16_t, uNewTr)
    47484747{
    4749     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4748    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    47504749
    47514750    /*
     
    48694868IEM_CIMPL_DEF_2(iemCImpl_mov_Rd_Cd, uint8_t, iGReg, uint8_t, iCrReg)
    48704869{
    4871     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     4870    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    48724871    if (pVCpu->iem.s.uCpl != 0)
    48734872        return iemRaiseGeneralProtectionFault0(pVCpu);
     
    49184917IEM_CIMPL_DEF_2(iemCImpl_load_CrX, uint8_t, iCrReg, uint64_t, uNewCrX)
    49194918{
    4920     PCPUMCTX        pCtx  = pVCpu->iem.s.CTX_SUFF(pCtx);
     4919    PCPUMCTX        pCtx  = IEM_GET_CTX(pVCpu);
    49214920    VBOXSTRICTRC    rcStrict;
    49224921    int             rc;
     
    52335232    if (pVCpu->iem.s.uCpl != 0)
    52345233        return iemRaiseGeneralProtectionFault0(pVCpu);
    5235     Assert(!pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1VM);
     5234    Assert(!IEM_GET_CTX(pVCpu)->eflags.Bits.u1VM);
    52365235
    52375236    /*
     
    52545253IEM_CIMPL_DEF_1(iemCImpl_lmsw, uint16_t, u16NewMsw)
    52555254{
    5256     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5255    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    52575256
    52585257    if (pVCpu->iem.s.uCpl != 0)
     
    52775276        return iemRaiseGeneralProtectionFault0(pVCpu);
    52785277
    5279     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5278    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    52805279    uint64_t uNewCr0 = pCtx->cr0;
    52815280    uNewCr0 &= ~X86_CR0_TS;
     
    52925291IEM_CIMPL_DEF_2(iemCImpl_mov_Rd_Dd, uint8_t, iGReg, uint8_t, iDrReg)
    52935292{
    5294     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5293    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    52955294
    52965295    /*
     
    53605359IEM_CIMPL_DEF_2(iemCImpl_mov_Dd_Rd, uint8_t, iDrReg, uint8_t, iGReg)
    53615360{
    5362     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5361    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    53635362
    53645363    /*
     
    54595458    if (pVCpu->iem.s.uCpl != 0)
    54605459        return iemRaiseGeneralProtectionFault0(pVCpu);
    5461     Assert(!pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1VM);
     5460    Assert(!IEM_GET_CTX(pVCpu)->eflags.Bits.u1VM);
    54625461
    54635462    int rc = PGMInvalidatePage(pVCpu, GCPtrPage);
     
    54805479IEM_CIMPL_DEF_0(iemCImpl_rdtsc)
    54815480{
    5482     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5481    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    54835482
    54845483    /*
     
    55155514IEM_CIMPL_DEF_0(iemCImpl_rdmsr)
    55165515{
    5517     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5516    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    55185517
    55195518    /*
     
    55645563IEM_CIMPL_DEF_0(iemCImpl_wrmsr)
    55655564{
    5566     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5565    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    55675566
    55685567    /*
     
    56305629IEM_CIMPL_DEF_2(iemCImpl_in, uint16_t, u16Port, uint8_t, cbReg)
    56315630{
    5632     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5631    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    56335632
    56345633    /*
     
    56885687IEM_CIMPL_DEF_1(iemCImpl_in_eAX_DX, uint8_t, cbReg)
    56895688{
    5690     return IEM_CIMPL_CALL_2(iemCImpl_in, pVCpu->iem.s.CTX_SUFF(pCtx)->dx, cbReg);
     5689    return IEM_CIMPL_CALL_2(iemCImpl_in, IEM_GET_CTX(pVCpu)->dx, cbReg);
    56915690}
    56925691
     
    57005699IEM_CIMPL_DEF_2(iemCImpl_out, uint16_t, u16Port, uint8_t, cbReg)
    57015700{
    5702     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5701    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    57035702
    57045703    /*
     
    57575756IEM_CIMPL_DEF_1(iemCImpl_out_DX_eAX, uint8_t, cbReg)
    57585757{
    5759     return IEM_CIMPL_CALL_2(iemCImpl_out, pVCpu->iem.s.CTX_SUFF(pCtx)->dx, cbReg);
     5758    return IEM_CIMPL_CALL_2(iemCImpl_out, IEM_GET_CTX(pVCpu)->dx, cbReg);
    57605759}
    57615760
     
    57665765IEM_CIMPL_DEF_0(iemCImpl_cli)
    57675766{
    5768     PCPUMCTX        pCtx    = pVCpu->iem.s.CTX_SUFF(pCtx);
     5767    PCPUMCTX        pCtx    = IEM_GET_CTX(pVCpu);
    57695768    uint32_t        fEfl    = IEMMISC_GET_EFL(pVCpu, pCtx);
    57705769    uint32_t const  fEflOld = fEfl;
     
    58085807IEM_CIMPL_DEF_0(iemCImpl_sti)
    58095808{
    5810     PCPUMCTX        pCtx    = pVCpu->iem.s.CTX_SUFF(pCtx);
     5809    PCPUMCTX        pCtx    = IEM_GET_CTX(pVCpu);
    58115810    uint32_t        fEfl    = IEMMISC_GET_EFL(pVCpu, pCtx);
    58125811    uint32_t const  fEflOld = fEfl;
     
    58845883     * Gather the operands and validate them.
    58855884     */
    5886     PCPUMCTX pCtx       = pVCpu->iem.s.CTX_SUFF(pCtx);
     5885    PCPUMCTX pCtx       = IEM_GET_CTX(pVCpu);
    58875886    RTGCPTR  GCPtrMem   = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax;
    58885887    uint32_t uEcx       = pCtx->ecx;
     
    59405939     * Gather the operands and validate them.
    59415940     */
    5942     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5941    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    59435942    uint32_t uEax = pCtx->eax;
    59445943    uint32_t uEcx = pCtx->ecx;
     
    59915990     * Do the job.
    59925991     */
    5993     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     5992    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    59945993    uint64_t uOtherGsBase = pCtx->msrKERNELGSBASE;
    59955994    pCtx->msrKERNELGSBASE = pCtx->gs.u64Base;
     
    60066005IEM_CIMPL_DEF_0(iemCImpl_cpuid)
    60076006{
    6008     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6007    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    60096008
    60106009    CPUMGetGuestCpuId(pVCpu, pCtx->eax, pCtx->ecx, &pCtx->eax, &pCtx->ebx, &pCtx->ecx, &pCtx->edx);
     
    60266025IEM_CIMPL_DEF_1(iemCImpl_aad, uint8_t, bImm)
    60276026{
    6028     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6027    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    60296028
    60306029    uint16_t const ax = pCtx->ax;
     
    60476046IEM_CIMPL_DEF_1(iemCImpl_aam, uint8_t, bImm)
    60486047{
    6049     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6048    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    60506049    Assert(bImm != 0); /* #DE on 0 is handled in the decoder. */
    60516050
     
    60686067IEM_CIMPL_DEF_0(iemCImpl_daa)
    60696068{
    6070     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6069    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    60716070
    60726071    uint8_t const  al       = pCtx->al;
     
    61016100IEM_CIMPL_DEF_0(iemCImpl_das)
    61026101{
    6103     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6102    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    61046103
    61056104    uint8_t const  uInputAL = pCtx->al;
     
    61806179IEM_CIMPL_DEF_0(iemCImpl_xgetbv)
    61816180{
    6182     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6181    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    61836182    if (pCtx->cr4 & X86_CR4_OSXSAVE)
    61846183    {
     
    62116210IEM_CIMPL_DEF_0(iemCImpl_xsetbv)
    62126211{
    6213     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6212    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    62146213    if (pCtx->cr4 & X86_CR4_OSXSAVE)
    62156214    {
     
    62586257IEM_CIMPL_DEF_1(iemCImpl_finit, bool, fCheckXcpts)
    62596258{
    6260     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6259    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    62616260
    62626261    if (pCtx->cr0 & (X86_CR0_EM | X86_CR0_TS))
     
    62956294IEM_CIMPL_DEF_3(iemCImpl_fxsave, uint8_t, iEffSeg, RTGCPTR, GCPtrEff, IEMMODE, enmEffOpSize)
    62966295{
    6297     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6296    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    62986297
    62996298    /*
     
    63996398IEM_CIMPL_DEF_3(iemCImpl_fxrstor, uint8_t, iEffSeg, RTGCPTR, GCPtrEff, IEMMODE, enmEffOpSize)
    64006399{
    6401     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6400    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    64026401
    64036402    /*
     
    66476646IEM_CIMPL_DEF_3(iemCImpl_fnstenv, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffDst)
    66486647{
    6649     PCPUMCTX     pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6648    PCPUMCTX     pCtx = IEM_GET_CTX(pVCpu);
    66506649    RTPTRUNION   uPtr;
    66516650    VBOXSTRICTRC rcStrict = iemMemMap(pVCpu, &uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 14 : 28,
     
    66746673IEM_CIMPL_DEF_3(iemCImpl_fnsave, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffDst)
    66756674{
    6676     PCPUMCTX     pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6675    PCPUMCTX     pCtx = IEM_GET_CTX(pVCpu);
    66776676    RTPTRUNION   uPtr;
    66786677    VBOXSTRICTRC rcStrict = iemMemMap(pVCpu, &uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 94 : 108,
     
    67256724IEM_CIMPL_DEF_3(iemCImpl_fldenv, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffSrc)
    67266725{
    6727     PCPUMCTX     pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6726    PCPUMCTX     pCtx = IEM_GET_CTX(pVCpu);
    67286727    RTCPTRUNION  uPtr;
    67296728    VBOXSTRICTRC rcStrict = iemMemMap(pVCpu, (void **)&uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 14 : 28,
     
    67526751IEM_CIMPL_DEF_3(iemCImpl_frstor, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffSrc)
    67536752{
    6754     PCPUMCTX     pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6753    PCPUMCTX     pCtx = IEM_GET_CTX(pVCpu);
    67556754    RTCPTRUNION  uPtr;
    67566755    VBOXSTRICTRC rcStrict = iemMemMap(pVCpu, (void **)&uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 94 : 108,
     
    67876786IEM_CIMPL_DEF_1(iemCImpl_fldcw, uint16_t, u16Fcw)
    67886787{
    6789     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6788    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    67906789
    67916790    /** @todo Testcase: Check what happens when trying to load X86_FCW_PC_RSVD. */
     
    68136812IEM_CIMPL_DEF_1(iemCImpl_fxch_underflow, uint8_t, iStReg)
    68146813{
    6815     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6814    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    68166815
    68176816    PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87;
     
    68626861IEM_CIMPL_DEF_3(iemCImpl_fcomi_fucomi, uint8_t, iStReg, PFNIEMAIMPLFPUR80EFL, pfnAImpl, bool, fPop)
    68636862{
    6864     PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);
     6863    PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);
    68656864    Assert(iStReg < 8);
    68666865
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