VirtualBox

Changeset 61640 in vbox


Ignore:
Timestamp:
Jun 9, 2016 8:31:02 PM (9 years ago)
Author:
vboxsync
Message:

IEM: unbreak long mode excption dispatching. cleanups

File:
1 edited

Legend:

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

    r61635 r61640  
    35363536
    35373537        /* Set the new CPL so that stack accesses use it. */
     3538        uint8_t const uOldCpl = pIemCpu->uCpl;
    35383539        pIemCpu->uCpl = uNewCpl;
    35393540
     
    35503551                *uStackFrame.pu32++ = uErr;
    35513552            uStackFrame.pu32[0] = (fFlags & IEM_XCPT_FLAGS_T_SOFT_INT) ? pCtx->eip + cbInstr : pCtx->eip;
    3552             uStackFrame.pu32[1] = (pCtx->cs.Sel & ~X86_SEL_RPL) | (pCtx->ss.Sel & X86_SEL_RPL);
     3553            uStackFrame.pu32[1] = (pCtx->cs.Sel & ~X86_SEL_RPL) | uOldCpl;
    35533554            uStackFrame.pu32[2] = fEfl;
    35543555            uStackFrame.pu32[3] = pCtx->esp;
     
    35683569                *uStackFrame.pu16++ = uErr;
    35693570            uStackFrame.pu16[0] = (fFlags & IEM_XCPT_FLAGS_T_SOFT_INT) ? pCtx->ip + cbInstr : pCtx->ip;
    3570             uStackFrame.pu16[1] = (pCtx->cs.Sel & ~X86_SEL_RPL) | (pCtx->ss.Sel & X86_SEL_RPL);
     3571            uStackFrame.pu16[1] = (pCtx->cs.Sel & ~X86_SEL_RPL) | uOldCpl;
    35713572            uStackFrame.pu16[2] = fEfl;
    35723573            uStackFrame.pu16[3] = pCtx->sp;
     
    36243625        else
    36253626            pCtx->rsp           = uNewEsp - cbStackFrame;
    3626         pIemCpu->uCpl           = uNewCpl;
    36273627
    36283628        if (fEfl & X86_EFL_VM)
     
    38793879     */
    38803880    /* Set the new CPL so that stack accesses use it. */
     3881    uint8_t const uOldCpl = pIemCpu->uCpl;
    38813882    pIemCpu->uCpl = uNewCpl;
    38823883
     
    38933894        *uStackFrame.pu64++ = uErr;
    38943895    uStackFrame.pu64[0] = fFlags & IEM_XCPT_FLAGS_T_SOFT_INT ? pCtx->rip + cbInstr : pCtx->rip;
    3895     uStackFrame.pu64[1] = (pCtx->cs.Sel & ~X86_SEL_RPL) | pIemCpu->uCpl; /* CPL paranoia */
     3896    uStackFrame.pu64[1] = (pCtx->cs.Sel & ~X86_SEL_RPL) | uOldCpl; /* CPL paranoia */
    38963897    uStackFrame.pu64[2] = fEfl;
    38973898    uStackFrame.pu64[3] = pCtx->rsp;
     
    39183919    /** @todo research/testcase: Figure out what VT-x and AMD-V loads into the
    39193920     *        hidden registers when interrupting 32-bit or 16-bit code! */
    3920     if (uNewCpl != pIemCpu->uCpl)
     3921    if (uNewCpl != uOldCpl)
    39213922    {
    39223923        pCtx->ss.Sel        = 0 | uNewCpl;
     
    39353936    pCtx->cs.Attr.u     = X86DESC_GET_HID_ATTR(&DescCS.Legacy);
    39363937    pCtx->rip           = uNewRip;
    3937     pIemCpu->uCpl       = uNewCpl;
    39383938
    39393939    fEfl &= ~fEflToClear;
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