|
From: <sv...@va...> - 2006-01-20 14:14:09
|
Author: sewardj
Date: 2006-01-20 14:13:55 +0000 (Fri, 20 Jan 2006)
New Revision: 1542
Log:
Add Ijk_EmFail, a new kind of IR block exit: an emulation failure
(fatal error) from which Vex (generated code) cannot recover. =20
Handle this in the ppc(64) backend.
Modified:
trunk/priv/host-ppc/hdefs.c
trunk/priv/ir/irdefs.c
trunk/priv/main/vex_main.c
trunk/pub/libvex_emwarn.h
trunk/pub/libvex_ir.h
trunk/pub/libvex_trc_values.h
Modified: trunk/priv/host-ppc/hdefs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-ppc/hdefs.c 2006-01-18 04:14:52 UTC (rev 1541)
+++ trunk/priv/host-ppc/hdefs.c 2006-01-20 14:13:55 UTC (rev 1542)
@@ -2939,6 +2939,7 @@
case Ijk_Sys_syscall: trc =3D VEX_TRC_JMP_SYS_SYSCALL; break;
case Ijk_Yield: trc =3D VEX_TRC_JMP_YIELD; break;
case Ijk_EmWarn: trc =3D VEX_TRC_JMP_EMWARN; break;
+ case Ijk_EmFail: trc =3D VEX_TRC_JMP_EMFAIL; break;
case Ijk_MapFail: trc =3D VEX_TRC_JMP_MAPFAIL; break;
case Ijk_NoDecode: trc =3D VEX_TRC_JMP_NODECODE; break;
case Ijk_TInval: trc =3D VEX_TRC_JMP_TINVAL; break;
Modified: trunk/priv/ir/irdefs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/ir/irdefs.c 2006-01-18 04:14:52 UTC (rev 1541)
+++ trunk/priv/ir/irdefs.c 2006-01-20 14:13:55 UTC (rev 1542)
@@ -681,6 +681,7 @@
case Ijk_ClientReq: vex_printf("ClientReq"); break;
case Ijk_Yield: vex_printf("Yield"); break;
case Ijk_EmWarn: vex_printf("EmWarn"); break;
+ case Ijk_EmFail: vex_printf("EmFail"); break;
case Ijk_NoDecode: vex_printf("NoDecode"); break;
case Ijk_MapFail: vex_printf("MapFail"); break;
case Ijk_TInval: vex_printf("Invalidate"); break;
Modified: trunk/priv/main/vex_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/main/vex_main.c 2006-01-18 04:14:52 UTC (rev 1541)
+++ trunk/priv/main/vex_main.c 2006-01-20 14:13:55 UTC (rev 1542)
@@ -664,8 +664,12 @@
return "Setting %mxcsr.daz (SSE treat-denormals-as-zero mode)";
case EmWarn_X86_acFlag:
return "Setting %eflags.ac (setting noted but ignored)";
- case EmWarn_PPC32exns:
- return "Unmasking PPC32 FP exceptions";
+ case EmWarn_PPCexns:
+ return "Unmasking PPC32/64 FP exceptions";
+ case EmWarn_PPC64_redir_overflow:
+ return "PPC64 function redirection stack overflow";
+ case EmWarn_PPC64_redir_underflow:
+ return "PPC64 function redirection stack underflow";
default:=20
vpanic("LibVEX_EmWarn_string: unknown warning");
}
Modified: trunk/pub/libvex_emwarn.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/pub/libvex_emwarn.h 2006-01-18 04:14:52 UTC (rev 1541)
+++ trunk/pub/libvex_emwarn.h 2006-01-20 14:13:55 UTC (rev 1542)
@@ -87,9 +87,13 @@
/* settings to %eflags.ac (alignment check) are noted but ignored =
*/
EmWarn_X86_acFlag,
=20
- /* unmasking PPC32 FP exceptions is not supported */
- EmWarn_PPC32exns,
+ /* unmasking PPC32/64 FP exceptions is not supported */
+ EmWarn_PPCexns,
=20
+ /* overflow/underflow of the PPC64 _REDIR stack (ppc64 only) */
+ EmWarn_PPC64_redir_overflow,
+ EmWarn_PPC64_redir_underflow,
+
EmWarn_NUMBER
}
VexEmWarn;
Modified: trunk/pub/libvex_ir.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/pub/libvex_ir.h 2006-01-18 04:14:52 UTC (rev 1541)
+++ trunk/pub/libvex_ir.h 2006-01-20 14:13:55 UTC (rev 1542)
@@ -843,6 +843,14 @@
the size of a guest word. It is the responsibility of the relevant
toIR.c to ensure that these are filled in with suitable values
before issuing a jump of kind Ijk_TInval. =20
+
+ Re Ijk_EmWarn and Ijk_EmFail: the guest state must have a
+ pseudo-register guest_EMWARN, which is 32-bits regardless of
+ the host or guest word size. That register should be made
+ to hold an EmWarn_* value to indicate the reason for the exit.
+
+ In the case of Ijk_EmFail, the exit is fatal (Vex-generated code
+ cannot continue) and so the jump destination can be anything.
*/
typedef
enum {=20
@@ -852,6 +860,7 @@
Ijk_ClientReq, /* do guest client req before continuing */
Ijk_Yield, /* client is yielding to thread scheduler */
Ijk_EmWarn, /* report emulation warning before continuing =
*/
+ Ijk_EmFail, /* emulation critical (FATAL) error; give up *=
/
Ijk_NoDecode, /* next instruction cannot be decoded */
Ijk_MapFail, /* Vex-provided address translation failed */
Ijk_TInval, /* Invalidate translations before continuing. =
*/
Modified: trunk/pub/libvex_trc_values.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/pub/libvex_trc_values.h 2006-01-18 04:14:52 UTC (rev 1541)
+++ trunk/pub/libvex_trc_values.h 2006-01-20 14:13:55 UTC (rev 1542)
@@ -54,6 +54,9 @@
=20
This file may get included in assembly code, so do not put
C-specific constructs in it.
+
+ These values should be 61 or above so as not to conflict
+ with Valgrind's VG_TRC_ values, which are 60 or below.
*/
=20
#define VEX_TRC_JMP_TINVAL 61 /* invalidate translations before
@@ -61,6 +64,8 @@
#define VEX_TRC_JMP_NOREDIR 81 /* jump to undirected guest addr */
#define VEX_TRC_JMP_EMWARN 63 /* deliver emulation warning before
continuing */
+#define VEX_TRC_JMP_EMFAIL 83 /* emulation fatal error; abort syste=
m */
+
#define VEX_TRC_JMP_CLIENTREQ 65 /* do a client req before continuing =
*/
#define VEX_TRC_JMP_YIELD 67 /* yield to thread sched=20
before continuing */
|