VirtualBox

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


Ignore:
Timestamp:
Jul 29, 2023 2:04:22 AM (20 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158604
Message:

VMM/IEM: Generate TBs for invalid instruction encodings as well. This involved special casing recompiler call generation for C instruction implementation function that doesn't take any extra arguments, so that we can catch all the deeply hidden IEMOP_RAISE_INVALID_OPCODE_RET invocations and similar. Also had to clean up hacky decoding of effective address related opcode bytes for undefined opcodes, introducing IEM_OPCODE_SKIP_RM_EFF_ADDR_BYTES(a_bRm) to hide the uglyness. bugref:10369

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

Legend:

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

    r100591 r100734  
    14561456# endif
    14571457
     1458/**
     1459 * For fetching the opcode bytes for an ModR/M effective address, but throw
     1460 * away the result.
     1461 *
     1462 * This is used when decoding undefined opcodes and such where we want to avoid
     1463 * unnecessary MC blocks.
     1464 *
     1465 * @note The recompiler code overrides this one so iemOpHlpCalcRmEffAddrJmpEx is
     1466 *       used instead.  At least for now...
     1467 */
     1468# ifndef IEM_WITH_SETJMP
     1469#  define IEM_OPCODE_SKIP_RM_EFF_ADDR_BYTES(a_bRm) do { \
     1470        RTGCPTR      GCPtrEff; \
     1471        VBOXSTRICTRC rcStrict = iemOpHlpCalcRmEffAddr(pVCpu, bRm, 0, &GCPtrEff); \
     1472        if (rcStrict != VINF_SUCCESS) \
     1473            return rcStrict; \
     1474    } while (0)
     1475# else
     1476#  define IEM_OPCODE_SKIP_RM_EFF_ADDR_BYTES(a_bRm) do { \
     1477        (void)iemOpHlpCalcRmEffAddrJmp(pVCpu, bRm, 0); \
     1478    } while (0)
     1479# endif
     1480
    14581481#endif /* !IEM_WITH_OPAQUE_DECODER_STATE */
    14591482
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r100731 r100734  
    34923492# define IEM_CIMPL_CALL_0(a_fn)            a_fn(pVCpu, cbInstr)
    34933493
     3494/** Type for a C instruction implementation function taking no extra
     3495 *  arguments. */
     3496typedef IEM_CIMPL_DECL_TYPE_0(FNIEMCIMPL0);
     3497/** Function pointer type for a C instruction implementation function taking
     3498 *  no extra arguments. */
     3499typedef FNIEMCIMPL0 *PFNIEMCIMPL0;
     3500
    34943501/**
    34953502 * For typedef'ing or declaring a C instruction implementation function taking
     
    43994406 * Macro for calling iemCImplRaiseDivideError().
    44004407 *
    4401  * This enables us to add/remove arguments and force different levels of
    4402  * inlining as we wish.
     4408 * This is for things that will _always_ decode to an \#DE, taking the
     4409 * recompiler into consideration and everything.
    44034410 *
    44044411 * @return  Strict VBox status code.
     
    44094416 * Macro for calling iemCImplRaiseInvalidLockPrefix().
    44104417 *
    4411  * This enables us to add/remove arguments and force different levels of
    4412  * inlining as we wish.
     4418 * This is for things that will _always_ decode to an \#UD, taking the
     4419 * recompiler into consideration and everything.
    44134420 *
    44144421 * @return  Strict VBox status code.
     
    49434950void            iemThreadedTbObsolete(PVMCPUCC pVCpu, PIEMTB pTb);
    49444951
     4952IEM_DECL_IMPL_PROTO(VBOXSTRICTRC, iemThreadedFunc_BltIn_DeferToCImpl0,
     4953                    (PVMCPU pVCpu, uint64_t uParam0, uint64_t uParam1, uint64_t uParam2));
     4954
    49454955IEM_DECL_IMPL_PROTO(VBOXSTRICTRC, iemThreadedFunc_BltIn_CheckMode,
    49464956                    (PVMCPU pVCpu, uint64_t uParam0, uint64_t uParam1, uint64_t uParam2));
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