]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Back out special handling for opcode 00 (VEX r2189).
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 23 Jul 2012 18:03:47 +0000 (18:03 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 23 Jul 2012 18:03:47 +0000 (18:03 +0000)
This was added based on the following analysis at the time:
(1) during decoding a sequence of insns we run into a 00 opcode (as that
    opcode is sometimes used on purpose to force an abort)
(2) #1 only happens when chasing through unconditional gotos
(3) the path that was decoded in #1 would not be executed because an earlier
    side exit in the super block was taken

But chasing through an unconditional branch should not reach an insn that is
not reached at execution time, because
(a) conditional gotos are supposed to terminate a superblock
(b) side exits that appear in the IR of complex insns will transfer control
    to the very same address (for insns that have implicit loops) and/or to
    the address that immediately follows the current insn (fall through)

Therefore, the special handling of opcode 00 was just fighting the
symptom but not the cause.
Most likely a super block was not correctly terminated.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2444

VEX/priv/guest_s390_defs.h
VEX/priv/guest_s390_helpers.c
VEX/priv/guest_s390_toIR.c

index 168ea364153baeb28cb0ef0263e14e281f8a6d29..573a0b7796ec3d658c24787fc80256c0eebed71f 100644 (file)
@@ -74,7 +74,6 @@ extern VexGuestLayout s390xGuest_layout;
 /*------------------------------------------------------------*/
 /*--- Helper functions.                                    ---*/
 /*------------------------------------------------------------*/
-void s390x_dirtyhelper_00(VexGuestS390XState *guest_state);
 void s390x_dirtyhelper_EX(ULong torun);
 ULong s390x_dirtyhelper_STCK(ULong *addr);
 ULong s390x_dirtyhelper_STCKF(ULong *addr);
index de52c3247c367733493f77bbaa66e0ea1e8d85aa..a4bebaf57c69508cda98baebfc8a54f37581da2f 100644 (file)
@@ -230,23 +230,6 @@ VexGuestLayout s390xGuest_layout = {
    }
 };
 
-/*------------------------------------------------------------*/
-/*--- Dirty helper for invalid opcode 00                   ---*/
-/*------------------------------------------------------------*/
-#if defined(VGA_s390x)
-void
-s390x_dirtyhelper_00(VexGuestS390XState *guest_state)
-{
-   /* Avoid infinite loop in case SIGILL is caught. See also
-      none/tests/s390x/op_exception.c */
-   guest_state->guest_IA += 2;
-
-   asm volatile(".hword 0\n");
-}
-#else
-void s390x_dirtyhelper_00(VexGuestS390XState *guest_state) { }
-#endif
-
 /*------------------------------------------------------------*/
 /*--- Dirty helper for EXecute                             ---*/
 /*------------------------------------------------------------*/
index 1b2ffe86fde1c8a1c113681dbc632303c69bf6bc..29315f61339f3310a05057c221b7fe8909044f3e 100644 (file)
@@ -2109,28 +2109,6 @@ s390_format_SIL_RDU(HChar *(*irgen)(UShort i2, IRTemp op1addr),
 /*--- Build IR for opcodes                                 ---*/
 /*------------------------------------------------------------*/
 
-static HChar *
-s390_irgen_00(UChar r1 __attribute__((unused)),
-              UChar r2 __attribute__((unused)))
-{
-   IRDirty *d;
-
-   d = unsafeIRDirty_0_N (0, "s390x_dirtyhelper_00", &s390x_dirtyhelper_00,
-                          mkIRExprVec_0());
-   d->needsBBP = 1;  /* Need to pass pointer to guest state to helper */
-
-   d->nFxState = 1;
-   vex_bzero(&d->fxState, sizeof(d->fxState));
-
-   d->fxState[0].fx     = Ifx_Modify;  /* read then write */
-   d->fxState[0].offset = S390X_GUEST_OFFSET(guest_IA);
-   d->fxState[0].size   = sizeof(ULong);
-
-   stmt(IRStmt_Dirty(d));
-
-   return "00";
-}
-
 static HChar *
 s390_irgen_AR(UChar r1, UChar r2)
 {
@@ -11509,8 +11487,6 @@ s390_decode_2byte_and_irgen(UChar *bytes)
    ((char *)(&ovl.value))[1] = bytes[1];
 
    switch (ovl.value & 0xffff) {
-   case 0x0000: /* invalid opcode */
-      s390_format_RR_RR(s390_irgen_00, 0, 0); goto ok;
    case 0x0101: /* PR */ goto unimplemented;
    case 0x0102: /* UPT */ goto unimplemented;
    case 0x0104: /* PTFF */ goto unimplemented;