VirtualBox

Changeset 100050 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 2, 2023 2:19:37 PM (22 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
157729
Message:

VMM/IEM: Load full RSP in 64-bit RETF to same privilege level.

File:
1 edited

Legend:

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

    r100049 r100050  
    25722572
    25732573        /** @todo Testcase: Is this correct? */
     2574        bool f64BitCs = false;
    25742575        if (   DescCs.Legacy.Gen.u1Long
    25752576            && IEM_IS_LONG_MODE(pVCpu) )
     
    25812582            }
    25822583            u64Base = 0;
     2584            f64BitCs = true;
    25832585        }
    25842586        else
     
    26102612        /* commit */
    26112613        if (cbPop)
     2614/** @todo This cannot be right. We're using the old CS mode here, and iemRegAddToRspEx checks fExec. */
    26122615            iemRegAddToRspEx(pVCpu, &NewRsp, cbPop);
    2613         if (!pVCpu->cpum.GstCtx.ss.Attr.n.u1DefBig)
     2616        if (pVCpu->cpum.GstCtx.ss.Attr.n.u1DefBig || f64BitCs)
     2617            pVCpu->cpum.GstCtx.rsp       = NewRsp.u;
     2618        else
    26142619            pVCpu->cpum.GstCtx.sp        = (uint16_t)NewRsp.u;
    2615         else
    2616             pVCpu->cpum.GstCtx.rsp       = NewRsp.u;
    26172620        if (enmEffOpSize == IEMMODE_16BIT)
    26182621            pVCpu->cpum.GstCtx.rip       = uNewRip & UINT16_MAX; /** @todo Testcase: When exactly does this occur? With call it happens prior to the limit check according to Intel... */
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