|
[Valgrind-developers] vex: r2487: On s390: Terminate the superblock
with Ijk_EmFail if an stckf insn
From: <sv...@va...> - 2012-08-26 14:32:37
|
florian 2012-08-26 15:32:28 +0100 (Sun, 26 Aug 2012)
New Revision: 2487
Log:
On s390: Terminate the superblock with Ijk_EmFail if an stckf insn
is encountered but not supported on the host.
Modified files:
trunk/priv/guest_s390_toIR.c
trunk/priv/main_main.c
trunk/pub/libvex_emnote.h
Modified: trunk/priv/main_main.c (+2 -0)
===================================================================
--- trunk/priv/main_main.c 2012-08-26 05:22:33 +01:00 (rev 2486)
+++ trunk/priv/main_main.c 2012-08-26 15:32:28 +01:00 (rev 2487)
@@ -1028,6 +1028,8 @@
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");
}
Modified: trunk/pub/libvex_emnote.h (+3 -0)
===================================================================
--- trunk/pub/libvex_emnote.h 2012-08-26 05:22:33 +01:00 (rev 2486)
+++ trunk/pub/libvex_emnote.h 2012-08-26 15:32:28 +01:00 (rev 2487)
@@ -88,6 +88,9 @@
/* 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;
Modified: trunk/priv/guest_s390_toIR.c (+18 -11)
===================================================================
--- trunk/priv/guest_s390_toIR.c 2012-08-26 05:22:33 +01:00 (rev 2486)
+++ trunk/priv/guest_s390_toIR.c 2012-08-26 15:32:28 +01:00 (rev 2487)
@@ -10774,18 +10774,25 @@
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";
}
|