VirtualBox

Changeset 104034 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Mar 25, 2024 10:07:26 AM (11 months ago)
Author:
vboxsync
Message:

VMM/IEM: Implement experimental (disabled by default) delaying writeback of dirty guest registers (for GPRs only at the moment), bugref:10629

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r104019 r104034  
    10501050        /* kIemTbDbgEntryType_GuestRegShadowing. */
    10511051        uint32_t    uType         : 4;
    1052         uint32_t    uUnused       : 4;
     1052        /** Flag whether the register is marked as dirty. */
     1053        uint32_t    fDirty        : 1;
     1054        uint32_t    uUnused       : 3;
    10531055        /** The guest register being shadowed (IEMNATIVEGSTREG). */
    10541056        uint32_t    idxGstReg     : 8;
  • trunk/src/VBox/VMM/include/IEMN8veRecompiler.h

    r104021 r104034  
    7070#endif
    7171
     72/** @def IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK
     73 * Delay the writeback or dirty registers as long as possible. */
     74#ifdef DEBUG_aeichner
     75# define IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK
     76#endif
    7277
    7378/** @name Stack Frame Layout
     
    11371142    /** Bitmap marking valid entries in aidxGstRegShadows. */
    11381143    uint64_t                    bmGstRegShadows;
     1144#ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK
     1145    /** Bitmap marking the shadowed guest register as dirty and needing writeback when flushing. */
     1146    uint64_t                    bmGstRegShadowDirty;
     1147#endif
    11391148
    11401149#ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR
     
    15481557#ifdef IEMNATIVE_WITH_DELAYED_PC_UPDATING
    15491558DECL_HIDDEN_THROW(uint32_t) iemNativeEmitPcWritebackSlow(PIEMRECOMPILERSTATE pReNative, uint32_t off);
     1559#endif
     1560#ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK
     1561DECL_HIDDEN_THROW(uint32_t) iemNativeRegFlushPendingWrite(PIEMRECOMPILERSTATE pReNative, uint32_t off, IEMNATIVEGSTREG enmGstReg);
     1562DECL_HIDDEN_THROW(uint32_t) iemNativeRegFlushDirtyGuest(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint64_t fFlushGstReg = UINT64_MAX);
     1563DECL_HIDDEN_THROW(uint32_t) iemNativeRegFlushDirtyGuestByHostRegShadow(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxHstReg);
    15501564#endif
    15511565
     
    21102124    Assert(   RT_BOOL(pReNative->Core.bmHstRegsWithGstShadow & RT_BIT_32(idxHstReg))
    21112125           == RT_BOOL(pReNative->Core.aHstRegs[idxHstReg].fGstRegShadows));
     2126#ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK
     2127    Assert(!(pReNative->Core.aHstRegs[idxHstReg].fGstRegShadows & pReNative->Core.bmGstRegShadowDirty));
     2128#endif
    21122129
    21132130#ifdef IEMNATIVE_WITH_TB_DEBUG_INFO
     
    21482165    Assert(pReNative->Core.aHstRegs[idxHstReg].fGstRegShadows & RT_BIT_64(enmGstReg));
    21492166    Assert(pReNative->Core.bmHstRegsWithGstShadow             & RT_BIT_32(idxHstReg));
     2167#ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK
     2168    Assert(!(pReNative->Core.aHstRegs[idxHstReg].fGstRegShadows & pReNative->Core.bmGstRegShadowDirty));
     2169#endif
    21502170
    21512171#ifdef IEMNATIVE_WITH_TB_DEBUG_INFO
     
    22642284#endif
    22652285
    2266 #ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR
     2286#if defined(IEMNATIVE_WITH_SIMD_REG_ALLOCATOR) || defined(IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK)
    22672287    /** @todo r=bird: There must be a quicker way to check if anything needs doing here!  */
    22682288    /** @todo This doesn't mix well with fGstShwExcept but we ignore this for now and just flush everything. */
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