VirtualBox

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


Ignore:
Timestamp:
Jun 10, 2018 4:08:44 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
122978
Message:

IEM,REM,++: Removed code related IEM_VERIFICATION_MODE and friends because it (1) adds aditional complexity and mess, (2) suffers bit rot as it's infrequently used, and (3) prevents using pVCpu->cpum.GstCtx directly.

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

Legend:

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

    r72488 r72493  
    5757 * Includes the VEX decoding. */
    5858#define IEM_WITH_VEX
    59 
    60 
    61 /** @def IEM_VERIFICATION_MODE_FULL
    62  * Shorthand for:
    63  *    defined(IEM_VERIFICATION_MODE) && !defined(IEM_VERIFICATION_MODE_MINIMAL)
    64  */
    65 #if (defined(IEM_VERIFICATION_MODE) && !defined(IEM_VERIFICATION_MODE_MINIMAL) && !defined(IEM_VERIFICATION_MODE_FULL)) \
    66   || defined(DOXYGEN_RUNNING)
    67 # define IEM_VERIFICATION_MODE_FULL
    68 #endif
    69 
    7059
    7160/** @def IEM_CFG_TARGET_CPU
     
    191180/** Pointer to a const FPU result consisting of two output values and FSW. */
    192181typedef IEMFPURESULTTWO const *PCIEMFPURESULTTWO;
    193 
    194 
    195 
    196 #ifdef IEM_VERIFICATION_MODE_FULL
    197 
    198 /**
    199  * Verification event type.
    200  */
    201 typedef enum IEMVERIFYEVENT
    202 {
    203     IEMVERIFYEVENT_INVALID = 0,
    204     IEMVERIFYEVENT_IOPORT_READ,
    205     IEMVERIFYEVENT_IOPORT_WRITE,
    206     IEMVERIFYEVENT_IOPORT_STR_READ,
    207     IEMVERIFYEVENT_IOPORT_STR_WRITE,
    208     IEMVERIFYEVENT_RAM_WRITE,
    209     IEMVERIFYEVENT_RAM_READ
    210 } IEMVERIFYEVENT;
    211 
    212 /** Checks if the event type is a RAM read or write. */
    213 # define IEMVERIFYEVENT_IS_RAM(a_enmType)    ((a_enmType) == IEMVERIFYEVENT_RAM_WRITE || (a_enmType) == IEMVERIFYEVENT_RAM_READ)
    214 
    215 /**
    216  * Verification event record.
    217  */
    218 typedef struct IEMVERIFYEVTREC
    219 {
    220     /** Pointer to the next record in the list. */
    221     struct IEMVERIFYEVTREC *pNext;
    222     /** The event type. */
    223     IEMVERIFYEVENT          enmEvent;
    224     /** The event data. */
    225     union
    226     {
    227         /** IEMVERIFYEVENT_IOPORT_READ */
    228         struct
    229         {
    230             RTIOPORT    Port;
    231             uint8_t     cbValue;
    232         } IOPortRead;
    233 
    234         /** IEMVERIFYEVENT_IOPORT_WRITE */
    235         struct
    236         {
    237             RTIOPORT    Port;
    238             uint8_t     cbValue;
    239             uint32_t    u32Value;
    240         } IOPortWrite;
    241 
    242         /** IEMVERIFYEVENT_IOPORT_STR_READ */
    243         struct
    244         {
    245             RTIOPORT    Port;
    246             uint8_t     cbValue;
    247             RTGCUINTREG cTransfers;
    248         } IOPortStrRead;
    249 
    250         /** IEMVERIFYEVENT_IOPORT_STR_WRITE */
    251         struct
    252         {
    253             RTIOPORT    Port;
    254             uint8_t     cbValue;
    255             RTGCUINTREG cTransfers;
    256         } IOPortStrWrite;
    257 
    258         /** IEMVERIFYEVENT_RAM_READ */
    259         struct
    260         {
    261             RTGCPHYS    GCPhys;
    262             uint32_t    cb;
    263         } RamRead;
    264 
    265         /** IEMVERIFYEVENT_RAM_WRITE */
    266         struct
    267         {
    268             RTGCPHYS    GCPhys;
    269             uint32_t    cb;
    270             uint8_t     ab[512];
    271         } RamWrite;
    272     } u;
    273 } IEMVERIFYEVTREC;
    274 /** Pointer to an IEM event verification records. */
    275 typedef IEMVERIFYEVTREC *PIEMVERIFYEVTREC;
    276 
    277 #endif /* IEM_VERIFICATION_MODE_FULL */
    278182
    279183
     
    674578    uint32_t                cLongJumps;
    675579    uint32_t                uAlignment6; /**< Alignment padding. */
    676 #ifdef IEM_VERIFICATION_MODE_FULL
    677     /** The Number of I/O port reads that has been performed. */
    678     uint32_t                cIOReads;
    679     /** The Number of I/O port writes that has been performed. */
    680     uint32_t                cIOWrites;
    681     /** Set if no comparison to REM is currently performed.
    682      * This is used to skip past really slow bits.  */
    683     bool                    fNoRem;
    684     /** Saved fNoRem flag used by #iemInitExec and #iemUninitExec. */
    685     bool                    fNoRemSavedByExec;
    686     /** Indicates that RAX and RDX differences should be ignored since RDTSC
    687      *  and RDTSCP are timing sensitive.  */
    688     bool                    fIgnoreRaxRdx;
    689     /** Indicates that a MOVS instruction with overlapping source and destination
    690      *  was executed, causing the memory write records to be incorrrect. */
    691     bool                    fOverlappingMovs;
    692     /** Set if there are problematic memory accesses (MMIO, write monitored, ++). */
    693     bool                    fProblematicMemory;
    694     /** This is used to communicate a CPL changed caused by IEMInjectTrap that
    695      * CPUM doesn't yet reflect. */
    696     uint8_t                 uInjectCpl;
    697     /** To prevent EMR3HmSingleInstruction from triggering endless recursion via
    698      *  emR3ExecuteInstruction and iemExecVerificationModeCheck. */
    699     uint8_t                 cVerifyDepth;
    700     bool                    afAlignment7[2];
    701     /** Mask of undefined eflags.
    702      * The verifier will any difference in these flags. */
    703     uint32_t                fUndefinedEFlags;
    704     /** The CS of the instruction being interpreted. */
    705     RTSEL                   uOldCs;
    706     /** The RIP of the instruction being interpreted. */
    707     uint64_t                uOldRip;
    708     /** The physical address corresponding to abOpcodes[0]. */
    709     RTGCPHYS                GCPhysOpcodes;
    710 #endif
    711580    /** @} */
    712581
     
    754623    /** Pointer to instruction statistics for ring-3 context. */
    755624    R3PTRTYPE(PIEMINSTRSTATS) pStatsR3;
    756 
    757 #ifdef IEM_VERIFICATION_MODE_FULL
    758     /** The event verification records for what IEM did (LIFO). */
    759     R3PTRTYPE(PIEMVERIFYEVTREC)     pIemEvtRecHead;
    760     /** Insertion point for pIemEvtRecHead. */
    761     R3PTRTYPE(PIEMVERIFYEVTREC *)   ppIemEvtRecNext;
    762     /** The event verification records for what the other party did (FIFO). */
    763     R3PTRTYPE(PIEMVERIFYEVTREC)     pOtherEvtRecHead;
    764     /** Insertion point for pOtherEvtRecHead. */
    765     R3PTRTYPE(PIEMVERIFYEVTREC *)   ppOtherEvtRecNext;
    766     /** List of free event records. */
    767     R3PTRTYPE(PIEMVERIFYEVTREC)     pFreeEvtRec;
    768 #endif
    769625} IEMCPU;
    770626AssertCompileMemberOffset(IEMCPU, fCurXcpt, 0x48);
     
    782638 * @param   a_pVCpu The cross context virtual CPU structure of the calling thread.
    783639 */
    784 #if !defined(IEM_VERIFICATION_MODE_FULL) && !defined(IEM_VERIFICATION_MODE) \
    785  && !defined(IEM_VERIFICATION_MODE_MINIMAL) && defined(VMCPU_INCL_CPUM_GST_CTX)
    786 # define IEM_GET_CTX(a_pVCpu)           (&(a_pVCpu)->cpum.GstCtx)
    787 #else
    788 # define IEM_GET_CTX(a_pVCpu)           ((a_pVCpu)->iem.s.CTX_SUFF(pCtx))
    789 #endif
     640#define IEM_GET_CTX(a_pVCpu)                    (&(a_pVCpu)->cpum.GstCtx)
    790641
    791642/** @def IEM_CTX_ASSERT
     
    1074925} IEMACCESSCRX;
    1075926
    1076 /**
    1077  * Tests if verification mode is enabled.
    1078  *
    1079  * This expands to @c false when IEM_VERIFICATION_MODE is not defined and
    1080  * should therefore cause the compiler to eliminate the verification branch
    1081  * of an if statement.  */
    1082 #ifdef IEM_VERIFICATION_MODE_FULL
    1083 # define IEM_VERIFICATION_ENABLED(a_pVCpu)      (!(a_pVCpu)->iem.s.fNoRem)
    1084 #elif defined(IEM_VERIFICATION_MODE_MINIMAL)
    1085 # define IEM_VERIFICATION_ENABLED(a_pVCpu)      (true)
    1086 #else
    1087 # define IEM_VERIFICATION_ENABLED(a_pVCpu)      (false)
    1088 #endif
    1089 
    1090 /**
    1091  * Tests if full verification mode is enabled.
    1092  *
    1093  * This expands to @c false when IEM_VERIFICATION_MODE_FULL is not defined and
    1094  * should therefore cause the compiler to eliminate the verification branch
    1095  * of an if statement.  */
    1096 #ifdef IEM_VERIFICATION_MODE_FULL
    1097 # define IEM_FULL_VERIFICATION_ENABLED(a_pVCpu) (!(a_pVCpu)->iem.s.fNoRem)
    1098 #else
    1099 # define IEM_FULL_VERIFICATION_ENABLED(a_pVCpu) (false)
    1100 #endif
    1101 
    1102 /**
    1103  * Tests if full verification mode is enabled again REM.
    1104  *
    1105  * This expands to @c false when IEM_VERIFICATION_MODE_FULL is not defined and
    1106  * should therefore cause the compiler to eliminate the verification branch
    1107  * of an if statement.  */
    1108 #ifdef IEM_VERIFICATION_MODE_FULL
    1109 # ifdef IEM_VERIFICATION_MODE_FULL_HM
    1110 #  define IEM_FULL_VERIFICATION_REM_ENABLED(a_pVCpu)    (!(a_pVCpu)->iem.s.fNoRem && !HMIsEnabled((a_pVCpu)->CTX_SUFF(pVM)))
    1111 # else
    1112 #  define IEM_FULL_VERIFICATION_REM_ENABLED(a_pVCpu)    (!(a_pVCpu)->iem.s.fNoRem)
    1113 # endif
    1114 #else
    1115 # define IEM_FULL_VERIFICATION_REM_ENABLED(a_pVCpu)     (false)
    1116 #endif
    1117 
    1118 /** @def IEM_VERIFICATION_MODE
    1119  * Indicates that one of the verfication modes are enabled.
    1120  */
    1121 #if (defined(IEM_VERIFICATION_MODE_FULL) || defined(IEM_VERIFICATION_MODE_MINIMAL)) && !defined(IEM_VERIFICATION_MODE) \
    1122  || defined(DOXYGEN_RUNNING)
    1123 # define IEM_VERIFICATION_MODE
    1124 #endif
    1125927
    1126928/**
     
    1130932 *
    1131933 * This is a NOOP if the verifier isn't compiled in.
    1132  */
    1133 #ifdef IEM_VERIFICATION_MODE_FULL
    1134 # define IEMOP_VERIFICATION_UNDEFINED_EFLAGS(a_fEfl) do { pVCpu->iem.s.fUndefinedEFlags |= (a_fEfl); } while (0)
    1135 #else
    1136 # define IEMOP_VERIFICATION_UNDEFINED_EFLAGS(a_fEfl) do { } while (0)
    1137 #endif
     934 *
     935 * @note We're temporarily keeping this until code is converted to new
     936 *       disassembler style opcode handling.
     937 */
     938#define IEMOP_VERIFICATION_UNDEFINED_EFLAGS(a_fEfl) do { } while (0)
    1138939
    1139940
  • trunk/src/VBox/VMM/include/PDMInternal.h

    r69474 r72493  
    5757/** @def PDMCRITSECT_STRICT
    5858 * Enables/disables PDM critsect strictness like deadlock detection. */
    59 #if (defined(RT_LOCK_STRICT) && defined(IN_RING3) && !defined(IEM_VERIFICATION_MODE) && !defined(PDMCRITSECT_STRICT)) \
     59#if (defined(RT_LOCK_STRICT) && defined(IN_RING3) && !defined(PDMCRITSECT_STRICT)) \
    6060  || defined(DOXYGEN_RUNNING)
    6161# define PDMCRITSECT_STRICT
     
    6565 * Enables/disables PDM read/write critsect strictness like deadlock
    6666 * detection. */
    67 #if (defined(RT_LOCK_STRICT) && defined(IN_RING3) && !defined(IEM_VERIFICATION_MODE) && !defined(PDMCRITSECTRW_STRICT)) \
     67#if (defined(RT_LOCK_STRICT) && defined(IN_RING3) && !defined(PDMCRITSECTRW_STRICT)) \
    6868  || defined(DOXYGEN_RUNNING)
    6969# define PDMCRITSECTRW_STRICT
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