VirtualBox

Changeset 62422 in vbox for trunk/src


Ignore:
Timestamp:
Jul 22, 2016 11:10:49 AM (8 years ago)
Author:
vboxsync
Message:

iemTaskSwitch: Fixed X86_DESC_DB check and faked up DescSS for V8086 mode (MSC complained).

File:
1 edited

Legend:

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

    r62421 r62422  
    40514051        iemHlpLoadSelectorInV86Mode(pVCpu, &pCtx->fs, uNewFS);
    40524052        iemHlpLoadSelectorInV86Mode(pVCpu, &pCtx->gs, uNewGS);
     4053
     4054        /* quick fix: fake DescSS. */ /** @todo fix the code further down? */
     4055        DescSS.Legacy.u = 0;
     4056        DescSS.Legacy.Gen.u16LimitLow = (uint16_t)pCtx->ss.u32Limit;
     4057        DescSS.Legacy.Gen.u4LimitHigh = pCtx->ss.u32Limit >> 16;
     4058        DescSS.Legacy.Gen.u16BaseLow  = (uint16_t)pCtx->ss.u64Base;
     4059        DescSS.Legacy.Gen.u8BaseHigh1 = (uint8_t)(pCtx->ss.u64Base >> 16);
     4060        DescSS.Legacy.Gen.u8BaseHigh2 = (uint8_t)(pCtx->ss.u64Base >> 24);
     4061        DescSS.Legacy.Gen.u4Type      = X86_SEL_TYPE_RW_ACC;
     4062        DescSS.Legacy.Gen.u2Dpl       = 3;
    40534063    }
    40544064    else
     
    42494259            {
    42504260                /** @todo Intel says \#SS(EXT) for INT/XCPT, I couldn't figure out AMD yet. */
    4251                 Log(("iemTaskSwitch: SS=%#x ESP=%#x cbStackFrame=%#x is out of bounds -> #SS\n", pCtx->ss.Sel, pCtx->esp,
    4252                      cbStackFrame));
     4261                Log(("iemTaskSwitch: SS=%#x ESP=%#x cbStackFrame=%#x is out of bounds -> #SS\n",
     4262                     pCtx->ss.Sel, pCtx->esp, cbStackFrame));
    42534263                return iemRaiseStackSelectorNotPresentWithErr(pVCpu, uExt);
    42544264            }
     
    42564266        else
    42574267        {
    4258             if (   pCtx->esp - 1 > (DescSS.Legacy.Gen.u4Type & X86_DESC_DB ? UINT32_MAX : UINT32_C(0xffff))
     4268            if (   pCtx->esp - 1 > (DescSS.Legacy.Gen.u1DefBig ? UINT32_MAX : UINT32_C(0xffff))
    42594269                || pCtx->esp - cbStackFrame < cbLimitSS + UINT32_C(1))
    42604270            {
    4261                 Log(("iemTaskSwitch: SS=%#x ESP=%#x cbStackFrame=%#x (expand down) is out of bounds -> #SS\n", pCtx->ss.Sel, pCtx->esp,
    4262                      cbStackFrame));
     4271                Log(("iemTaskSwitch: SS=%#x ESP=%#x cbStackFrame=%#x (expand down) is out of bounds -> #SS\n",
     4272                     pCtx->ss.Sel, pCtx->esp, cbStackFrame));
    42634273                return iemRaiseStackSelectorNotPresentWithErr(pVCpu, uExt);
    42644274            }
     
    42724282        if (rcStrict != VINF_SUCCESS)
    42734283        {
    4274             Log(("iemTaskSwitch: Can't push error code to new task's stack. %s-bit TSS. rc=%Rrc\n", fIsNewTSS386 ? "32" : "16",
    4275                  VBOXSTRICTRC_VAL(rcStrict)));
     4284            Log(("iemTaskSwitch: Can't push error code to new task's stack. %s-bit TSS. rc=%Rrc\n",
     4285                 fIsNewTSS386 ? "32" : "16", VBOXSTRICTRC_VAL(rcStrict)));
    42764286            return rcStrict;
    42774287        }
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