VirtualBox

Changeset 105098 in vbox


Ignore:
Timestamp:
Jul 2, 2024 12:46:06 PM (5 months ago)
Author:
vboxsync
Message:

VMM/IEM: iret logging. bugref:10715

File:
1 edited

Legend:

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

    r105094 r105098  
    34513451    if (pVCpu->cpum.GstCtx.eflags.Bits.u1NT)
    34523452    {
    3453         Log(("iretq with NT=1 (eflags=%#x) -> #GP(0)\n", pVCpu->cpum.GstCtx.eflags.u));
     3453        Log(("iret/64 with NT=1 (eflags=%#x) -> #GP(0)\n", pVCpu->cpum.GstCtx.eflags.u));
    34543454        return iemRaiseGeneralProtectionFault0(pVCpu);
    34553455    }
     
    35083508    else
    35093509        return rcStrict;
    3510     Log7(("iretq stack: cs:rip=%04x:%016RX64 rflags=%016RX64 ss:rsp=%04x:%016RX64\n", uNewCs, uNewRip, uNewFlags, uNewSs, uNewRsp));
     3510    Log7(("iret/64 stack: cs:rip=%04x:%016RX64 rflags=%016RX64 ss:rsp=%04x:%016RX64\n", uNewCs, uNewRip, uNewFlags, uNewSs, uNewRsp));
    35113511
    35123512    /*
     
    35163516    if (!(uNewCs & X86_SEL_MASK_OFF_RPL))
    35173517    {
    3518         Log(("iret %04x:%016RX64/%04x:%016RX64 -> invalid CS selector, #GP(0)\n", uNewCs, uNewRip, uNewSs, uNewRsp));
     3518        Log(("iret/64 %04x:%016RX64/%04x:%016RX64 -> invalid CS selector, #GP(0)\n", uNewCs, uNewRip, uNewSs, uNewRsp));
    35193519        return iemRaiseGeneralProtectionFault0(pVCpu);
    35203520    }
     
    35243524    if (rcStrict != VINF_SUCCESS)
    35253525    {
    3526         Log(("iret %04x:%016RX64/%04x:%016RX64 - rcStrict=%Rrc when fetching CS\n",
     3526        Log(("iret/64 %04x:%016RX64/%04x:%016RX64 - rcStrict=%Rrc when fetching CS\n",
    35273527             uNewCs, uNewRip, uNewSs, uNewRsp, VBOXSTRICTRC_VAL(rcStrict)));
    35283528        return rcStrict;
     
    35333533        || !(DescCS.Legacy.Gen.u4Type & X86_SEL_TYPE_CODE))
    35343534    {
    3535         Log(("iret %04x:%016RX64/%04x:%016RX64 - CS is not a code segment T=%u T=%#xu -> #GP\n",
     3535        Log(("iret/64 %04x:%016RX64/%04x:%016RX64 - CS is not a code segment T=%u T=%#xu -> #GP\n",
    35363536             uNewCs, uNewRip, uNewSs, uNewRsp, DescCS.Legacy.Gen.u1DescType, DescCS.Legacy.Gen.u4Type));
    35373537        return iemRaiseGeneralProtectionFaultBySelector(pVCpu, uNewCs);
     
    35443544        if ((uNewCs & X86_SEL_RPL) != DescCS.Legacy.Gen.u2Dpl)
    35453545        {
    3546             Log(("iret %04x:%016RX64 - RPL != DPL (%d) -> #GP\n", uNewCs, uNewRip, DescCS.Legacy.Gen.u2Dpl));
     3546            Log(("iret/64 %04x:%016RX64 - RPL != DPL (%d) -> #GP\n", uNewCs, uNewRip, DescCS.Legacy.Gen.u2Dpl));
    35473547            return iemRaiseGeneralProtectionFaultBySelector(pVCpu, uNewCs);
    35483548        }
     
    35503550    else if ((uNewCs & X86_SEL_RPL) < DescCS.Legacy.Gen.u2Dpl)
    35513551    {
    3552         Log(("iret %04x:%016RX64 - RPL < DPL (%d) -> #GP\n", uNewCs, uNewRip, DescCS.Legacy.Gen.u2Dpl));
     3552        Log(("iret/64 %04x:%016RX64 - RPL < DPL (%d) -> #GP\n", uNewCs, uNewRip, DescCS.Legacy.Gen.u2Dpl));
    35533553        return iemRaiseGeneralProtectionFaultBySelector(pVCpu, uNewCs);
    35543554    }
    35553555    if ((uNewCs & X86_SEL_RPL) < IEM_GET_CPL(pVCpu))
    35563556    {
    3557         Log(("iret %04x:%016RX64 - RPL < CPL (%d) -> #GP\n", uNewCs, uNewRip, IEM_GET_CPL(pVCpu)));
     3557        Log(("iret/64 %04x:%016RX64 - RPL < CPL (%d) -> #GP\n", uNewCs, uNewRip, IEM_GET_CPL(pVCpu)));
    35583558        return iemRaiseGeneralProtectionFaultBySelector(pVCpu, uNewCs);
    35593559    }
     
    35623562    if (!DescCS.Legacy.Gen.u1Present)
    35633563    {
    3564         Log(("iret %04x:%016RX64/%04x:%016RX64 - CS not present -> #NP\n", uNewCs, uNewRip, uNewSs, uNewRsp));
     3564        Log(("iret/64 %04x:%016RX64/%04x:%016RX64 - CS not present -> #NP\n", uNewCs, uNewRip, uNewSs, uNewRsp));
    35653565        return iemRaiseSelectorNotPresentBySelector(pVCpu, uNewCs);
    35663566    }
     
    35763576            || uNewCpl > 2) /** @todo verify SS=0 impossible for ring-3. */
    35773577        {
    3578             Log(("iret %04x:%016RX64/%04x:%016RX64 -> invalid SS selector, #GP(0)\n", uNewCs, uNewRip, uNewSs, uNewRsp));
     3578            Log(("iret/64 %04x:%016RX64/%04x:%016RX64 -> invalid SS selector, #GP(0)\n", uNewCs, uNewRip, uNewSs, uNewRsp));
    35793579            return iemRaiseGeneralProtectionFault0(pVCpu);
    35803580        }
     
    35873587        if (rcStrict != VINF_SUCCESS)
    35883588        {
    3589             Log(("iret %04x:%016RX64/%04x:%016RX64 - %Rrc when fetching SS\n",
     3589            Log(("iret/64 %04x:%016RX64/%04x:%016RX64 - %Rrc when fetching SS\n",
    35903590                 uNewCs, uNewRip, uNewSs, uNewRsp, VBOXSTRICTRC_VAL(rcStrict)));
    35913591            return rcStrict;
     
    35963596    if ((uNewSs & X86_SEL_RPL) != (uNewCs & X86_SEL_RPL))
    35973597    {
    3598         Log(("iret %04x:%016RX64/%04x:%016RX64 -> SS.RPL != CS.RPL -> #GP\n", uNewCs, uNewRip, uNewSs, uNewRsp));
     3598        Log(("iret/64 %04x:%016RX64/%04x:%016RX64 -> SS.RPL != CS.RPL -> #GP\n", uNewCs, uNewRip, uNewSs, uNewRsp));
    35993599        return iemRaiseGeneralProtectionFaultBySelector(pVCpu, uNewSs);
    36003600    }
     
    36073607        if (DescSS.Legacy.Gen.u2Dpl != (uNewCs & X86_SEL_RPL))
    36083608        {
    3609             Log(("iret %04x:%016RX64/%04x:%016RX64 -> SS.DPL (%d) != CS.RPL -> #GP\n",
     3609            Log(("iret/64 %04x:%016RX64/%04x:%016RX64 -> SS.DPL (%d) != CS.RPL -> #GP\n",
    36103610                 uNewCs, uNewRip, uNewSs, uNewRsp, DescSS.Legacy.Gen.u2Dpl));
    36113611            return iemRaiseGeneralProtectionFaultBySelector(pVCpu, uNewSs);
     
    36153615        if (!DescSS.Legacy.Gen.u1DescType)
    36163616        {
    3617             Log(("iret %04x:%016RX64/%04x:%016RX64 -> SS is system segment (%#x) -> #GP\n",
     3617            Log(("iret/64 %04x:%016RX64/%04x:%016RX64 -> SS is system segment (%#x) -> #GP\n",
    36183618                 uNewCs, uNewRip, uNewSs, uNewRsp, DescSS.Legacy.Gen.u4Type));
    36193619            return iemRaiseGeneralProtectionFaultBySelector(pVCpu, uNewSs);
     
    36213621        if ((DescSS.Legacy.Gen.u4Type & (X86_SEL_TYPE_CODE | X86_SEL_TYPE_WRITE)) != X86_SEL_TYPE_WRITE)
    36223622        {
    3623             Log(("iret %04x:%016RX64/%04x:%016RX64 - not writable data segment (%#x) -> #GP\n",
     3623            Log(("iret/64 %04x:%016RX64/%04x:%016RX64 - not writable data segment (%#x) -> #GP\n",
    36243624                 uNewCs, uNewRip, uNewSs, uNewRsp, DescSS.Legacy.Gen.u4Type));
    36253625            return iemRaiseGeneralProtectionFaultBySelector(pVCpu, uNewSs);
     
    36293629        if (!DescSS.Legacy.Gen.u1Present)
    36303630        {
    3631             Log(("iret %04x:%016RX64/%04x:%016RX64 -> SS not present -> #SS\n", uNewCs, uNewRip, uNewSs, uNewRsp));
     3631            Log(("iret/64 %04x:%016RX64/%04x:%016RX64 -> SS not present -> #SS\n", uNewCs, uNewRip, uNewSs, uNewRsp));
    36323632            return iemRaiseStackSelectorNotPresentBySelector(pVCpu, uNewSs);
    36333633        }
     
    36403640        if (!IEM_IS_CANONICAL(uNewRip))
    36413641        {
    3642             Log(("iret %04x:%016RX64/%04x:%016RX64 -> RIP is not canonical -> #GP(0)\n",
    3643                  uNewCs, uNewRip, uNewSs, uNewRsp));
     3642            Log(("iret/64 %04x:%016RX64/%04x:%016RX64 -> RIP is not canonical -> #GP(0)\n", uNewCs, uNewRip, uNewSs, uNewRsp));
    36443643            return iemRaiseNotCanonical(pVCpu);
    36453644        }
     
    36493648        else
    36503649        {
    3651             Log(("iret %04x:%016RX64/%04x:%016RX64 -> both L and D are set -> #GP(0)\n", uNewCs, uNewRip, uNewSs, uNewRsp));
     3650            Log(("iret/64 %04x:%016RX64/%04x:%016RX64 -> both L and D are set -> #GP(0)\n", uNewCs, uNewRip, uNewSs, uNewRsp));
    36523651            return iemRaiseGeneralProtectionFault0(pVCpu);
    36533652        }
     
    36573656        if (uNewRip > cbLimitCS)
    36583657        {
    3659             Log(("iret %04x:%016RX64/%04x:%016RX64 -> EIP is out of bounds (%#x) -> #GP(0)\n",
     3658            Log(("iret/64 %04x:%016RX64/%04x:%016RX64 -> EIP is out of bounds (%#x) -> #GP(0)\n",
    36603659                 uNewCs, uNewRip, uNewSs, uNewRsp, cbLimitCS));
    36613660            /** @todo Which is it, \#GP(0) or \#GP(sel)? */
     
    36963695    fEFlagsNew         |= uNewFlags & fEFlagsMask;
    36973696#ifdef DBGFTRACE_ENABLED
    3698     RTTraceBufAddMsgF(pVCpu->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf), "iret/%ul%u %08llx -> %04x:%04llx %llx %04x:%04llx",
     3697    RTTraceBufAddMsgF(pVCpu->CTX_SUFF(pVM)->CTX_SUFF(hTraceBuf), "iret/64/%ul%u %08llx -> %04x:%04llx %llx %04x:%04llx",
    36993698                      IEM_GET_CPL(pVCpu), uNewCpl, pVCpu->cpum.GstCtx.rip, uNewCs, uNewRip, uNewFlags, uNewSs, uNewRsp);
    37003699#endif
     
    37203719        pVCpu->cpum.GstCtx.ss.u32Limit   = UINT32_MAX;
    37213720        pVCpu->cpum.GstCtx.ss.u64Base    = 0;
    3722         Log2(("iretq new SS: NULL\n"));
     3721        Log2(("iret/64 new SS: NULL\n"));
    37233722    }
    37243723    else
     
    37283727        pVCpu->cpum.GstCtx.ss.u32Limit   = cbLimitSs;
    37293728        pVCpu->cpum.GstCtx.ss.u64Base    = X86DESC_BASE(&DescSS.Legacy);
    3730         Log2(("iretq new SS: base=%#RX64 lim=%#x attr=%#x\n", pVCpu->cpum.GstCtx.ss.u64Base, pVCpu->cpum.GstCtx.ss.u32Limit, pVCpu->cpum.GstCtx.ss.Attr.u));
     3729        Log2(("iret/64 new SS: base=%#RX64 lim=%#x attr=%#x\n", pVCpu->cpum.GstCtx.ss.u64Base, pVCpu->cpum.GstCtx.ss.u32Limit, pVCpu->cpum.GstCtx.ss.Attr.u));
    37313730    }
    37323731
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