VirtualBox

Changeset 106196 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 1, 2024 1:50:48 PM (6 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164980
Message:

VMM/IEM: Added missing skipped eflags tracking in iemNativeEmitModifyEFlagsBit. More logging. bugref:10720

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

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

    r106187 r106196  
    60586058    {
    60596059        Assert(!(pReNative->fSkippingEFlags & fElfInput)); RT_NOREF(fElfInput);
     6060        if (pReNative->fSkippingEFlags)
     6061            Log5(("EFLAGS: fSkippingEFlags %#x -> %#x (iemNativeEmitCommitEFlags)\n",
     6062                  pReNative->fSkippingEFlags, pReNative->fSkippingEFlags & ~(a_fEflOutput & X86_EFL_STATUS_BITS) ));
    60606063        if RT_CONSTEXPR_IF((a_fEflOutput & X86_EFL_STATUS_BITS) == X86_EFL_STATUS_BITS)
    60616064            pReNative->fSkippingEFlags  = 0;
     
    61216124    /* Free but don't flush the EFLAGS register. */
    61226125    iemNativeRegFreeTmp(pReNative, idxEflReg);
     6126
     6127#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
     6128    /* Clear the bit in the skipped mask if we're clobbering and it's a status bit. */
     6129    if RT_CONSTEXPR_IF(   (a_enmOp == kIemNativeEmitEflOp_Set || a_enmOp == kIemNativeEmitEflOp_Clear)
     6130                       && (a_fEflBit & X86_EFL_STATUS_BITS))
     6131    {
     6132        if (pReNative->fSkippingEFlags)
     6133            Log5(("EFLAGS: fSkippingEFlags %#x -> %#x (iemNativeEmitModifyEFlagsBit)\n",
     6134                  pReNative->fSkippingEFlags, pReNative->fSkippingEFlags & ~a_fEflBit ));
     6135        pReNative->fSkippingEFlags &= ~a_fEflBit;
     6136# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
     6137        off = iemNativeEmitAndImmIntoVCpuU32(pReNative, off, ~a_fEflBit, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
     6138# endif
     6139    }
     6140#endif
    61236141
    61246142    return off;
     
    62696287    IEMNATIVE_ASSERT_EFLAGS_SKIPPING_AND_POSTPONING(pReNative,  fEflInput);
    62706288    IEMNATIVE_STRICT_EFLAGS_SKIPPING_EMIT_CHECK(pReNative, off, fEflInput);
     6289    if (pReNative->fSkippingEFlags)
     6290        Log5(("EFLAGS: fSkippingEFlags %#x -> %#x (iemNativeEmitRefEFlags)\n",
     6291              pReNative->fSkippingEFlags, pReNative->fSkippingEFlags & ~a_fEflOutput ));
    62716292    pReNative->fSkippingEFlags &= ~a_fEflOutput;
    62726293# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
  • trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h

    r106192 r106196  
    237237            else
    238238            {
    239                 Log5(("iemNativeClearPostponedEFlags: Clobbering %#x: %#x -> %#x (op=%d bits=%u)\n", a_fEflClobbered,
     239                Log5(("EFLAGS: Clobbering %#x: %#x -> %#x (op=%d bits=%u) - iemNativeClearPostponedEFlags\n", a_fEflClobbered,
    240240                      pReNative->PostponedEfl.fEFlags, fEFlags, pReNative->PostponedEfl.enmOp, pReNative->PostponedEfl.cOpBits));
    241241                pReNative->PostponedEfl.fEFlags = fEFlags;
     
    245245
    246246        /* Do cleanup.  */
    247         Log5(("iemNativeClearPostponedEFlags: Cleanup of op=%u bits=%u efl=%#x upon clobbering %#x\n",
     247        Log5(("EFLAGS: Cleanup of op=%u bits=%u efl=%#x upon clobbering %#x - iemNativeClearPostponedEFlags\n",
    248248              pReNative->PostponedEfl.enmOp, pReNative->PostponedEfl.cOpBits, pReNative->PostponedEfl.fEFlags, a_fEflClobbered));
    249249        pReNative->PostponedEfl.fEFlags = 0;
     
    548548    {
    549549        STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflSkippedLogical);
    550         pReNative->fSkippingEFlags |= X86_EFL_STATUS_BITS;
     550        pReNative->fSkippingEFlags = X86_EFL_STATUS_BITS;
    551551# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
    552552        off = iemNativeEmitOrImmIntoVCpuU32(pReNative, off, X86_EFL_STATUS_BITS, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
    553553# endif
    554         Log5(("iemNativeEmitEFlagsForLogical: Skipping %#x\n", X86_EFL_STATUS_BITS));
     554        Log5(("EFLAGS: Skipping %#x - iemNativeEmitEFlagsForLogical\n", X86_EFL_STATUS_BITS));
    555555        return off;
    556556    }
     
    570570         *        doesn't modify it.  That'll save a register move and allocation. */
    571571        off = iemNativeEmitLoadGprFromGpr(pReNative, off, pReNative->PostponedEfl.idxReg1, idxRegResult);
    572         Log5(("iemNativeEmitEFlagsForLogical: Postponing %#x op=%u bits=%u reg1=%u\n", X86_EFL_STATUS_BITS,
     572        Log5(("EFLAGS: Postponing %#x op=%u bits=%u reg1=%u - iemNativeEmitEFlagsForLogical\n", X86_EFL_STATUS_BITS,
    573573              kIemNativePostponedEflOp_Logical, cOpBits, pReNative->PostponedEfl.idxReg1));
    574574    }
     
    645645
    646646#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
     647    if (pReNative->fSkippingEFlags)
     648        Log5(("EFLAGS: fSkippingEFlags %#x -> 0 (iemNativeEmitEFlagsForLogical)\n", pReNative->fSkippingEFlags));
    647649    pReNative->fSkippingEFlags = 0;
    648650# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
     
    679681    {
    680682        STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflSkippedArithmetic);
    681         pReNative->fSkippingEFlags |= X86_EFL_STATUS_BITS;
     683        pReNative->fSkippingEFlags = X86_EFL_STATUS_BITS;
     684        Log5(("EFLAGS: Skipping %#x - iemNativeEmitEFlagsForArithmetic\n", X86_EFL_STATUS_BITS));
    682685# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
    683686        off = iemNativeEmitOrImmIntoVCpuU32(pReNative, off, X86_EFL_STATUS_BITS, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
     
    687690#endif
    688691    {
    689 #ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
    690         uint32_t fSkipped = 0;
    691 #endif
    692692#ifdef RT_ARCH_AMD64
    693693        /*
     
    845845
    846846#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
    847         pReNative->fSkippingEFlags = fSkipped;
     847        if (pReNative->fSkippingEFlags)
     848            Log5(("EFLAGS: fSkippingEFlags %#x -> 0 (iemNativeEmitEFlagsForArithmetic)\n", pReNative->fSkippingEFlags));
     849        pReNative->fSkippingEFlags = 0;
    848850# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
    849         off = iemNativeEmitStoreImmToVCpuU32(pReNative, off, fSkipped, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
     851        off = iemNativeEmitStoreImmToVCpuU32(pReNative, off, 0, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
    850852# endif
    851853#endif
     
    21062108
    21072109#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
     2110        if (pReNative->fSkippingEFlags)
     2111            Log5(("EFLAGS: fSkippingEFlags %#x -> 0 (iemNativeEmitEFlagsForShift)\n", pReNative->fSkippingEFlags));
    21082112        pReNative->fSkippingEFlags = 0;
    21092113# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
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