]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
On s390: Terminate the superblock with Ijk_EmFail if an stckf insn
authorFlorian Krohm <florian@eich-krohm.de>
Sun, 26 Aug 2012 14:32:28 +0000 (14:32 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sun, 26 Aug 2012 14:32:28 +0000 (14:32 +0000)
is encountered but not supported on the host.

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

VEX/priv/guest_s390_toIR.c
VEX/priv/main_main.c
VEX/pub/libvex_emnote.h

index f9ec22cacadd840a621891df1cbdac6d72e0179b..3612f0567109322808d3b383356140db8cf32ba3 100644 (file)
@@ -10774,18 +10774,25 @@ s390_irgen_STCK(IRTemp op2addr)
 static HChar *
 s390_irgen_STCKF(IRTemp op2addr)
 {
-   IRDirty *d;
-   IRTemp cc = newTemp(Ity_I64);
+   if (! s390_host_has_stckf) {
+      stmt(IRStmt_Put(S390X_GUEST_OFFSET(guest_EMNOTE),
+           mkU32(EmFail_S390X_stckf)));
+      put_IA(mkaddr_expr(guest_IA_next_instr));
+      dis_res->whatNext = Dis_StopHere;
+      dis_res->jk_StopHere = Ijk_EmFail;
+   } else {
+      IRTemp cc = newTemp(Ity_I64);
 
-   d = unsafeIRDirty_1_N(cc, 0, "s390x_dirtyhelper_STCKF",
-                         &s390x_dirtyhelper_STCKF,
-                         mkIRExprVec_1(mkexpr(op2addr)));
-   d->mFx   = Ifx_Write;
-   d->mAddr = mkexpr(op2addr);
-   d->mSize = 8;
-   stmt(IRStmt_Dirty(d));
-   s390_cc_thunk_fill(mkU64(S390_CC_OP_SET),
-                      mkexpr(cc), mkU64(0), mkU64(0));
+      IRDirty *d = unsafeIRDirty_1_N(cc, 0, "s390x_dirtyhelper_STCKF",
+                                     &s390x_dirtyhelper_STCKF,
+                                     mkIRExprVec_1(mkexpr(op2addr)));
+      d->mFx   = Ifx_Write;
+      d->mAddr = mkexpr(op2addr);
+      d->mSize = 8;
+      stmt(IRStmt_Dirty(d));
+      s390_cc_thunk_fill(mkU64(S390_CC_OP_SET),
+                         mkexpr(cc), mkU64(0), mkU64(0));
+   }
    return "stckf";
 }
 
index 12946d817296c2353a85d510c4a939ff54113dbb..26f259efb4197bd572baa5c9922c04e954c63639 100644 (file)
@@ -1028,6 +1028,8 @@ HChar* LibVEX_EmNote_string ( VexEmNote ew )
         return "PPC64 function redirection stack underflow";
    case EmFail_S390X_stfle:
         return "Instruction stfle is not supported on this host";
+   case EmFail_S390X_stckf:
+        return "Instruction stckf is not supported on this host";
      default: 
         vpanic("LibVEX_EmNote_string: unknown warning");
    }
index cdedfe2e78a427d3e55afe675717fa9c83d2548b..5f02bba1fe7f79f6e6b81dff0febdece42cf3a48 100644 (file)
@@ -88,6 +88,9 @@ typedef
       /* stfle insn is not supported on this host */
       EmFail_S390X_stfle,
 
+      /* stckf insn is not supported on this host */
+      EmFail_S390X_stckf,
+
       EmNote_NUMBER
    }
    VexEmNote;