VirtualBox

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


Ignore:
Timestamp:
May 24, 2023 2:47:30 PM (22 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
157616
Message:

IEM: Consistently use DONE_VEX_DECODING_EX macros to check for CPU feature bits. Removed the non-EX variants of the macros as they are no longer used.

File:
1 edited

Legend:

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

    r99686 r99958  
    453453/**
    454454 * Done decoding VEX instruction, raise \#UD exception if any lock, rex, repz,
    455  * repnz or size prefixes are present, or if in real or v8086 mode.
    456  */
    457 #define IEMOP_HLP_DONE_VEX_DECODING() \
    458     do \
    459     { \
    460         if (RT_LIKELY(   !(  pVCpu->iem.s.fPrefixes \
    461                            & (IEM_OP_PRF_LOCK | IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ | IEM_OP_PRF_SIZE_OP | IEM_OP_PRF_REX)) \
    462                       && !IEM_IS_REAL_OR_V86_MODE(pVCpu) )) \
    463         { /* likely */ } \
    464         else \
    465             return IEMOP_RAISE_INVALID_OPCODE(); \
    466     } while (0)
    467 
    468 /**
    469  * Done decoding VEX instruction, raise \#UD exception if any lock, rex, repz,
    470455 * repnz or size prefixes are present, if in real or v8086 mode, or if the
    471  * a_fFeature is present in the guest CPU.
     456 * a_fFeature is not present in the guest CPU.
    472457 */
    473458#define IEMOP_HLP_DONE_VEX_DECODING_EX(a_fFeature) \
     
    485470/**
    486471 * Done decoding VEX instruction, raise \#UD exception if any lock, rex, repz,
    487  * repnz or size prefixes are present, or if in real or v8086 mode.
    488  */
    489 #define IEMOP_HLP_DONE_VEX_DECODING_L0() \
    490     do \
    491     { \
    492         if (RT_LIKELY(   !(  pVCpu->iem.s.fPrefixes \
    493                            & (IEM_OP_PRF_LOCK | IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ | IEM_OP_PRF_SIZE_OP | IEM_OP_PRF_REX)) \
    494                       && !IEM_IS_REAL_OR_V86_MODE(pVCpu) \
    495                       && pVCpu->iem.s.uVexLength == 0)) \
    496         { /* likely */ } \
    497         else \
    498             return IEMOP_RAISE_INVALID_OPCODE(); \
    499     } while (0)
    500 
    501 /**
    502  * Done decoding VEX instruction, raise \#UD exception if any lock, rex, repz,
    503  * repnz or size prefixes are present, or if in real or v8086 mode.
     472 * repnz or size prefixes are present, or if in real or v8086 mode, or if the
     473 * a_fFeature is not present in the guest CPU.
    504474 */
    505475#define IEMOP_HLP_DONE_VEX_DECODING_L0_EX(a_fFeature) \
     
    516486    } while (0)
    517487
    518 
    519 /**
    520  * Done decoding VEX instruction, raise \#UD exception if any lock, rex, repz,
    521  * repnz or size prefixes are present, or if the VEX.VVVV field doesn't indicate
    522  * register 0, or if in real or v8086 mode.
    523  */
    524 #define IEMOP_HLP_DONE_VEX_DECODING_NO_VVVV() \
    525     do \
    526     { \
    527         if (RT_LIKELY(   !(  pVCpu->iem.s.fPrefixes \
    528                            & (IEM_OP_PRF_LOCK | IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ | IEM_OP_PRF_SIZE_OP | IEM_OP_PRF_REX)) \
    529                       && !pVCpu->iem.s.uVex3rdReg \
    530                       && !IEM_IS_REAL_OR_V86_MODE(pVCpu) )) \
    531         { /* likely */ } \
    532         else \
    533             return IEMOP_RAISE_INVALID_OPCODE(); \
    534     } while (0)
    535 
    536488/**
    537489 * Done decoding VEX instruction, raise \#UD exception if any lock, rex, repz,
     
    548500                      && !IEM_IS_REAL_OR_V86_MODE(pVCpu) \
    549501                      && IEM_GET_GUEST_CPU_FEATURES(pVCpu)->a_fFeature )) \
    550         { /* likely */ } \
    551         else \
    552             return IEMOP_RAISE_INVALID_OPCODE(); \
    553     } while (0)
    554 
    555 /**
    556  * Done decoding VEX, no V, L=0.
    557  * Raises \#UD exception if rex, rep, opsize or lock prefixes are present, if
    558  * we're in real or v8086 mode, if VEX.V!=0xf, or if VEX.L!=0.
    559  */
    560 #define IEMOP_HLP_DONE_VEX_DECODING_L0_AND_NO_VVVV() \
    561     do \
    562     { \
    563         if (RT_LIKELY(   !(  pVCpu->iem.s.fPrefixes \
    564                            & (IEM_OP_PRF_LOCK | IEM_OP_PRF_SIZE_OP | IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ | IEM_OP_PRF_REX)) \
    565                       && pVCpu->iem.s.uVexLength == 0 \
    566                       && pVCpu->iem.s.uVex3rdReg == 0 \
    567                       && !IEM_IS_REAL_OR_V86_MODE(pVCpu))) \
    568502        { /* likely */ } \
    569503        else \
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