VirtualBox

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


Ignore:
Timestamp:
Jul 22, 2013 1:17:28 AM (12 years ago)
Author:
vboxsync
Message:

IEM: More 64-bit fixes.

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

Legend:

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

    r47288 r47291  
    35833583DECLINLINE(RTGCPTR) iemRegGetEffRsp(PCCPUMCTX pCtx)
    35843584{
    3585     if (pCtx->ss.Attr.n.u1Long)
     3585    if (pCtx->ss.Attr.n.u1Long || pCtx->ss.Attr.n.u1Unusable)
    35863586        return pCtx->rsp;
    35873587    if (pCtx->ss.Attr.n.u1DefBig)
     
    36413641DECLINLINE(void) iemRegAddToRsp(PCPUMCTX pCtx, uint8_t cbToAdd)
    36423642{
    3643     if (pCtx->ss.Attr.n.u1Long)
     3643    if (pCtx->ss.Attr.n.u1Long || pCtx->ss.Attr.n.u1Unusable)
    36443644        pCtx->rsp += cbToAdd;
    36453645    else if (pCtx->ss.Attr.n.u1DefBig)
     
    36593659DECLINLINE(void) iemRegSubFromRsp(PCPUMCTX pCtx, uint8_t cbToSub)
    36603660{
    3661     if (pCtx->ss.Attr.n.u1Long)
     3661    if (pCtx->ss.Attr.n.u1Long || pCtx->ss.Attr.n.u1Unusable)
    36623662        pCtx->rsp -= cbToSub;
    36633663    else if (pCtx->ss.Attr.n.u1DefBig)
     
    36773677DECLINLINE(void) iemRegAddToRspEx(PRTUINT64U pTmpRsp, uint16_t cbToAdd, PCCPUMCTX pCtx)
    36783678{
    3679     if (pCtx->ss.Attr.n.u1Long)
     3679    if (pCtx->ss.Attr.n.u1Long || pCtx->ss.Attr.n.u1Unusable)
    36803680        pTmpRsp->u           += cbToAdd;
    36813681    else if (pCtx->ss.Attr.n.u1DefBig)
     
    36973697DECLINLINE(void) iemRegSubFromRspEx(PRTUINT64U pTmpRsp, uint16_t cbToSub, PCCPUMCTX pCtx)
    36983698{
    3699     if (pCtx->ss.Attr.n.u1Long)
     3699    if (pCtx->ss.Attr.n.u1Long || pCtx->ss.Attr.n.u1Unusable)
    37003700        pTmpRsp->u          -= cbToSub;
    37013701    else if (pCtx->ss.Attr.n.u1DefBig)
     
    37213721    uTmpRsp.u = pCtx->rsp;
    37223722
    3723     if (pCtx->ss.Attr.n.u1Long)
     3723    if (pCtx->ss.Attr.n.u1Long || pCtx->ss.Attr.n.u1Unusable)
    37243724        GCPtrTop = uTmpRsp.u            -= cbItem;
    37253725    else if (pCtx->ss.Attr.n.u1DefBig)
     
    37473747    uTmpRsp.u = pCtx->rsp;
    37483748
    3749     if (pCtx->ss.Attr.n.u1Long)
     3749    if (pCtx->ss.Attr.n.u1Long || pCtx->ss.Attr.n.u1Unusable)
    37503750    {
    37513751        GCPtrTop = uTmpRsp.u;
     
    37803780    RTGCPTR GCPtrTop;
    37813781
    3782     if (pCtx->ss.Attr.n.u1Long)
     3782    if (pCtx->ss.Attr.n.u1Long || pCtx->ss.Attr.n.u1Unusable)
    37833783        GCPtrTop = pTmpRsp->u          -= cbItem;
    37843784    else if (pCtx->ss.Attr.n.u1DefBig)
     
    38023802{
    38033803    RTGCPTR GCPtrTop;
    3804     if (pCtx->ss.Attr.n.u1Long)
     3804    if (pCtx->ss.Attr.n.u1Long || pCtx->ss.Attr.n.u1Unusable)
    38053805    {
    38063806        GCPtrTop = pTmpRsp->u;
     
    85458545            iemVerifyAssertRecord(pIemCpu, pIemRec, "Extra IEM record!");
    85468546        else if (pOtherRec != NULL)
    8547             iemVerifyAssertRecord(pIemCpu, pIemRec, "Extra Other record!");
     8547            iemVerifyAssertRecord(pIemCpu, pOtherRec, "Extra Other record!");
    85488548    }
    85498549    pIemCpu->CTX_SUFF(pCtx) = pOrgCtx;
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h

    r47285 r47291  
    33473347     */
    33483348    void *pvDesc;
    3349     rcStrict = iemMemMap(pIemCpu, &pvDesc, 8, UINT8_MAX, pCtx->gdtr.pGdt, IEM_ACCESS_DATA_RW);
     3349    rcStrict = iemMemMap(pIemCpu, &pvDesc, 8, UINT8_MAX, pCtx->gdtr.pGdt + (uNewTr & X86_SEL_MASK_OFF_RPL), IEM_ACCESS_DATA_RW);
    33503350    if (rcStrict != VINF_SUCCESS)
    33513351        return rcStrict;
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h

    r47284 r47291  
    130130                IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU32, pu32Dst, u32Src, pEFlags);
    131131
    132                 IEM_MC_CLEAR_HIGH_GREG_U64_BY_REF(pu32Dst);
     132                if (pImpl != &g_iemAImpl_test)
     133                    IEM_MC_CLEAR_HIGH_GREG_U64_BY_REF(pu32Dst);
    133134                IEM_MC_ADVANCE_RIP();
    134135                IEM_MC_END();
     
    483484            IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU32, pu32Dst, u32Src, pEFlags);
    484485
    485             IEM_MC_CLEAR_HIGH_GREG_U64_BY_REF(pu32Dst);
     486            if (pImpl != &g_iemAImpl_test)
     487                IEM_MC_CLEAR_HIGH_GREG_U64_BY_REF(pu32Dst);
    486488            IEM_MC_ADVANCE_RIP();
    487489            IEM_MC_END();
     
    1566215664    else
    1566315665    {
    15664         /* The new RIP is taken from a register. */
     15666        /* The new RIP is taken from a memory location. */
    1566515667        switch (pIemCpu->enmEffOpSize)
    1566615668        {
     
    1568715689            case IEMMODE_64BIT:
    1568815690                IEM_MC_BEGIN(0, 2);
    15689                 IEM_MC_LOCAL(uint32_t, u32Target);
     15691                IEM_MC_LOCAL(uint64_t, u64Target);
    1569015692                IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc);
    1569115693                IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0);
    15692                 IEM_MC_FETCH_MEM_U32(u32Target, pIemCpu->iEffSeg, GCPtrEffSrc);
    15693                 IEM_MC_SET_RIP_U32(u32Target);
     15694                IEM_MC_FETCH_MEM_U64(u64Target, pIemCpu->iEffSeg, GCPtrEffSrc);
     15695                IEM_MC_SET_RIP_U64(u64Target);
    1569415696                IEM_MC_END()
    1569515697                return VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette