VirtualBox

Changeset 65207 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jan 9, 2017 1:54:22 PM (8 years ago)
Author:
vboxsync
Message:

iemCImpl_BranchCallGate: Added @todo on workaround from r112681, fixed style and added two testcase suggestions.

File:
1 edited

Legend:

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

    r65192 r65207  
    13801380            {
    13811381                /* Just grab the new (NULL) SS descriptor. */
     1382                /** @todo testcase: Check whether the zero GDT entry is actually loaded here
     1383                 *        like we do... */
    13821384                rcStrict = iemMemFetchSelDesc(pVCpu, &DescSS, uNewSS, X86_XCPT_SS);
    13831385                if (rcStrict != VINF_SUCCESS)
     
    14171419            GCPtrParmWds = pCtx->ss.u64Base + uOldRsp;
    14181420
    1419             /* Probe if the write to the new stack will succeed. May #SS(NewSS) or #PF. */
    1420             void     *pvNewFrame;
     1421            /* HACK ALERT! Probe if the write to the new stack will succeed. May #SS(NewSS)
     1422                           or #PF, the former is not implemented in this workaround. */
     1423            /** @todo Proper fix callgate target stack exceptions. */
     1424            /** @todo testcase: Cover callgates with partially or fully inaccessible
     1425             *        target stacks. */
     1426            void    *pvNewFrame;
    14211427            RTGCPTR  GCPtrNewStack = X86DESC_BASE(&DescSS.Legacy) + uNewRsp - cbNewStack;
    14221428            rcStrict = iemMemMap(pVCpu, &pvNewFrame, cbNewStack, UINT8_MAX, GCPtrNewStack, IEM_ACCESS_SYS_RW);
     
    14461452
    14471453            /* At this point the stack access must not fail because new state was already committed. */
     1454            /** @todo this can still fail due to SS.LIMIT not check.   */
    14481455            rcStrict = iemMemStackPushBeginSpecial(pVCpu, cbNewStack,
    14491456                                                   &uPtrRet.pv, &uNewRsp);
    14501457            AssertMsgReturn(rcStrict == VINF_SUCCESS, ("BranchCallGate: New stack mapping failed (%Rrc)\n", VBOXSTRICTRC_VAL(rcStrict)),
    1451                             VERR_IPE_UNEXPECTED_STATUS);
     1458                            VERR_INTERNAL_ERROR_5);
    14521459
    14531460            if (!IEM_IS_LONG_MODE(pVCpu))
     
    14591466                    uPtrRet.pu32[1] = pCtx->cs.Sel; /** @todo Testcase: What is written to the high word when pushing CS? */
    14601467
    1461                     if (cbWords) {
     1468                    if (cbWords)
     1469                    {
    14621470                        /* Map the relevant chunk of the old stack. */
    14631471                        rcStrict = iemMemMap(pVCpu, &uPtrParmWds.pv, cbWords * 4, UINT8_MAX, GCPtrParmWds, IEM_ACCESS_DATA_R);
     
    14931501                    uPtrRet.pu16[1] = pCtx->cs.Sel;
    14941502
    1495                     if (cbWords) {
     1503                    if (cbWords)
     1504                    {
    14961505                        /* Map the relevant chunk of the old stack. */
    14971506                        rcStrict = iemMemMap(pVCpu, &uPtrParmWds.pv, cbWords * 2, UINT8_MAX, GCPtrParmWds, IEM_ACCESS_DATA_R);
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