|
From: <sv...@va...> - 2005-12-27 16:39:41
|
Author: sewardj
Date: 2005-12-27 16:39:36 +0000 (Tue, 27 Dec 2005)
New Revision: 1517
Log:
Redesign and simplify function-wrapping support.
Modified:
branches/FNWRAP/priv/guest-amd64/ghelpers.c
branches/FNWRAP/priv/guest-generic/bb_to_IR.c
branches/FNWRAP/priv/guest-generic/bb_to_IR.h
branches/FNWRAP/priv/guest-ppc32/ghelpers.c
branches/FNWRAP/priv/guest-x86/ghelpers.c
branches/FNWRAP/priv/guest-x86/toIR.c
branches/FNWRAP/priv/main/vex_main.c
branches/FNWRAP/pub/libvex.h
branches/FNWRAP/pub/libvex_guest_amd64.h
branches/FNWRAP/pub/libvex_guest_ppc32.h
branches/FNWRAP/pub/libvex_guest_ppc64.h
branches/FNWRAP/pub/libvex_guest_x86.h
Modified: branches/FNWRAP/priv/guest-amd64/ghelpers.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
--- branches/FNWRAP/priv/guest-amd64/ghelpers.c 2005-12-27 14:35:15 UTC (=
rev 1516)
+++ branches/FNWRAP/priv/guest-amd64/ghelpers.c 2005-12-27 16:39:36 UTC (=
rev 1517)
@@ -1931,7 +1931,6 @@
vex_state->guest_TISTART =3D 0;
vex_state->guest_TILEN =3D 0;
=20
- vex_state->guest_NRFLAG =3D 0;
vex_state->guest_NRADDR =3D 0;
}
=20
Modified: branches/FNWRAP/priv/guest-generic/bb_to_IR.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
--- branches/FNWRAP/priv/guest-generic/bb_to_IR.c 2005-12-27 14:35:15 UTC=
(rev 1516)
+++ branches/FNWRAP/priv/guest-generic/bb_to_IR.c 2005-12-27 16:39:36 UTC=
(rev 1517)
@@ -61,37 +61,6 @@
=20
static Bool const_False ( Addr64 a ) { return False; }
=20
-static IRExpr* mkAnd1 ( IRType ty, IRExpr* x, IRExpr* y )
-{
- vassert(ty =3D=3D Ity_I32 || ty =3D=3D Ity_I64);
- return=20
- ty =3D=3D Ity_I32
- ? IRExpr_Unop(Iop_32to1,
- IRExpr_Binop(Iop_And32,
- IRExpr_Unop(Iop_1Uto32,x),
- IRExpr_Unop(Iop_1Uto32,y)))
- : IRExpr_Unop(Iop_64to1,
- IRExpr_Binop(Iop_And64,
- IRExpr_Unop(Iop_1Uto64,x),
- IRExpr_Unop(Iop_1Uto64,y)));
-}
-
-static IRExpr* mkOr1 ( IRType ty, IRExpr* x, IRExpr* y )
-{
- vassert(ty =3D=3D Ity_I32 || ty =3D=3D Ity_I64);
- return=20
- ty =3D=3D Ity_I32
- ? IRExpr_Unop(Iop_32to1,
- IRExpr_Binop(Iop_Or32,
- IRExpr_Unop(Iop_1Uto32,x),
- IRExpr_Unop(Iop_1Uto32,y)))
- : IRExpr_Unop(Iop_64to1,
- IRExpr_Binop(Iop_Or64,
- IRExpr_Unop(Iop_1Uto64,x),
- IRExpr_Unop(Iop_1Uto64,y)));
-}
-
-
/* Disassemble a complete basic block, starting at guest_IP_start,=20
returning a new IRBB. The disassembler may chase across basic
block boundaries if it wishes and if chase_into_ok allows it.
@@ -121,10 +90,9 @@
/*IN*/ VexArchInfo* archinfo_guest,
/*IN*/ IRType guest_word_type,
/*IN*/ Bool do_self_check,
- /*IN*/ Bool do_noredir_check,
+ /*IN*/ Bool do_set_NRADDR,
/*IN*/ Int offB_TISTART,
/*IN*/ Int offB_TILEN,
- /*IN*/ Int offB_NRFLAG,
/*IN*/ Int offB_NRADDR )
{
Long delta;
@@ -179,68 +147,13 @@
: IRConst_U64(guest_IP_bbstart);
}
=20
- if (do_noredir_check) {
+ if (do_set_NRADDR) {
guest_IP_bbstart_noredir_IRConst
=3D guest_word_type=3D=3DIty_I32=20
? IRConst_U32(toUInt(guest_IP_bbstart_noredir))
: IRConst_U64(guest_IP_bbstart_noredir);
}
=20
- /* If asked to make a noredir-check, put it before the self-check.
- The noredir-check checks whether we should be running code at
- this guest address at all, whereas the self-check establishes
- whether the translation is still valid once we've decided we
- should be here. So the noredir check comes first. */
- if (do_noredir_check) {
- /* Create this:
- tmp =3D _NRFLAG;
- _NRFLAG =3D tmp-1;
- if ( (tmp =3D=3D 1 && _NRADDR =3D=3D guest_IP_bbstart_noredir=
)
- || tmp =3D=3D 2)
- exit, request noredir xfer to guest_IP_bbstart_noredir
- _NRFLAG =3D tmp -- restores _NRFLAG to whatever it was
- */
- IRTemp tmp =3D newIRTemp(irbb->tyenv, guest_word_type);
- IRExpr* one =3D guest_word_type=3D=3DIty_I32=20
- ? IRExpr_Const(IRConst_U32(1))=20
- : IRExpr_Const(IRConst_U64(1));
- IRExpr* two =3D guest_word_type=3D=3DIty_I32=20
- ? IRExpr_Const(IRConst_U32(2))=20
- : IRExpr_Const(IRConst_U64(2));
- IROp cmpEQ =3D guest_word_type=3D=3DIty_I32 ? Iop_CmpEQ32 : Iop_Cm=
pEQ64;
- IROp opSUB =3D guest_word_type=3D=3DIty_I32 ? Iop_Sub32 : Iop_Sub6=
4;
-
- /* fetch old flag */
- addStmtToIRBB( irbb,=20
- IRStmt_Tmp( tmp,=20
- IRExpr_Get(offB_NRFLAG, guest_word_type)));
- /* flag-- */
- addStmtToIRBB( irbb,
- IRStmt_Put( offB_NRFLAG, IRExpr_Binop(opSUB, IRExpr_Tmp(tmp), o=
ne) ));
- /* exit, maybe */
- addStmtToIRBB( irbb,
- IRStmt_Exit(
- mkOr1(
- guest_word_type,
- mkAnd1( guest_word_type,
- IRExpr_Binop( cmpEQ, IRExpr_Tmp(tmp), one ),
- IRExpr_Binop(=20
- cmpEQ,=20
- IRExpr_Get(offB_NRADDR, guest_word_type),
- IRExpr_Const(guest_IP_bbstart_noredir_IRConst)
- )
- ),
- IRExpr_Binop( cmpEQ, IRExpr_Tmp(tmp), two )
- ),
- Ijk_NoRedir,
- guest_IP_bbstart_noredir_IRConst=20
- ));
- /* if we didn't exit, now need to restore the flag */
- addStmtToIRBB( irbb,
- IRStmt_Put( offB_NRFLAG, IRExpr_Tmp(tmp) ));
-
- }
-
/* If asked to make a self-checking translation, leave 5 spaces
in which to put the check statements. We'll fill them in later
when we know the length and adler32 of the area to check. */
@@ -253,6 +166,18 @@
addStmtToIRBB( irbb, IRStmt_NoOp() );
}
=20
+ /* Set guest_NRADDR if asked to. This records the unredirected
+ guest address of this bb, so that it can later be read (and so
+ used by a function wrapper to get to the function itself. */
+ if (do_set_NRADDR) {
+ /* set guest_NRADDR to guest_IP_bbstart_noredir */
+ addStmtToIRBB(=20
+ irbb,
+ IRStmt_Put( offB_NRADDR,=20
+ IRExpr_Const(guest_IP_bbstart_noredir_IRConst))
+ );
+ }
+
/* Process instructions. */
while (True) {
vassert(n_instrs < vex_control.guest_max_insns);
@@ -307,7 +232,7 @@
vassert(dres.whatNext =3D=3D Dis_StopHere
|| dres.whatNext =3D=3D Dis_Continue
|| dres.whatNext =3D=3D Dis_Resteer);
- vassert(dres.len >=3D 0 && dres.len <=3D 18);
+ vassert(dres.len >=3D 0 && dres.len <=3D 20);
if (dres.whatNext !=3D Dis_Resteer)
vassert(dres.continueAt =3D=3D 0);
=20
Modified: branches/FNWRAP/priv/guest-generic/bb_to_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
--- branches/FNWRAP/priv/guest-generic/bb_to_IR.h 2005-12-27 14:35:15 UTC=
(rev 1516)
+++ branches/FNWRAP/priv/guest-generic/bb_to_IR.h 2005-12-27 16:39:36 UTC=
(rev 1517)
@@ -160,10 +160,9 @@
/*IN*/ VexArchInfo* archinfo_guest,
/*IN*/ IRType guest_word_type,
/*IN*/ Bool do_self_check,
- /*IN*/ Bool do_noredir_check,
+ /*IN*/ Bool do_set_NRADDR,
/*IN*/ Int offB_TISTART,
/*IN*/ Int offB_TILEN,
- /*IN*/ Int offB_NRFLAG,
/*IN*/ Int offB_NRADDR );
=20
=20
Modified: branches/FNWRAP/priv/guest-ppc32/ghelpers.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
--- branches/FNWRAP/priv/guest-ppc32/ghelpers.c 2005-12-27 14:35:15 UTC (=
rev 1516)
+++ branches/FNWRAP/priv/guest-ppc32/ghelpers.c 2005-12-27 16:39:36 UTC (=
rev 1517)
@@ -418,7 +418,6 @@
vex_state->guest_TISTART =3D 0;
vex_state->guest_TILEN =3D 0;
=20
- vex_state->guest_NRFLAG =3D 0;
vex_state->guest_NRADDR =3D 0;
}
=20
@@ -569,8 +568,7 @@
vex_state->guest_TISTART =3D 0;
vex_state->guest_TILEN =3D 0;
=20
- // vex_state->guest_NRFLAG =3D 0;
- //vex_state->guest_NRADDR =3D 0;
+ vex_state->guest_NRADDR =3D 0;
}
=20
=20
Modified: branches/FNWRAP/priv/guest-x86/ghelpers.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
--- branches/FNWRAP/priv/guest-x86/ghelpers.c 2005-12-27 14:35:15 UTC (re=
v 1516)
+++ branches/FNWRAP/priv/guest-x86/ghelpers.c 2005-12-27 16:39:36 UTC (re=
v 1517)
@@ -2226,7 +2226,6 @@
vex_state->guest_TISTART =3D 0;
vex_state->guest_TILEN =3D 0;
=20
- vex_state->guest_NRFLAG =3D 0;
vex_state->guest_NRADDR =3D 0;
}
=20
Modified: branches/FNWRAP/priv/guest-x86/toIR.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
--- branches/FNWRAP/priv/guest-x86/toIR.c 2005-12-27 14:35:15 UTC (rev 15=
16)
+++ branches/FNWRAP/priv/guest-x86/toIR.c 2005-12-27 16:39:36 UTC (rev 15=
17)
@@ -7031,6 +7031,42 @@
}
}
=20
+ /* Spot the even-more-magical "call-noredir *%eax" sequence, and
+ treat it as a normal "call *%eax", except that the jump itself
+ is marked NoRedir. */
+ {
+ UChar* code =3D (UChar*)(guest_code + delta);
+ /* Spot this:
+ C1C81C rorl $28, %eax
+ C1C804 rorl $4, %eax
+ C1C01A roll $26, %eax
+ C1C006 roll $6, %eax
+ C1C80C rorl $12, %eax
+ C1C814 rorl $20, %eax
+ FFD0 call *%eax
+ */
+ if (code[ 0] =3D=3D 0xC1 && code[ 1] =3D=3D 0xC8 && code[ 2] =3D=3D=
0x1C &&
+ code[ 3] =3D=3D 0xC1 && code[ 4] =3D=3D 0xC8 && code[ 5] =3D=3D=
0x04 &&
+ code[ 6] =3D=3D 0xC1 && code[ 7] =3D=3D 0xC0 && code[ 8] =3D=3D=
0x1A &&
+ code[ 9] =3D=3D 0xC1 && code[10] =3D=3D 0xC0 && code[11] =3D=3D=
0x06 &&
+ code[12] =3D=3D 0xC1 && code[13] =3D=3D 0xC8 && code[14] =3D=3D=
0x0C &&
+ code[15] =3D=3D 0xC1 && code[16] =3D=3D 0xC8 && code[17] =3D=3D=
0x14 &&
+ code[18] =3D=3D 0xFF && code[19] =3D=3D 0xD0
+ ) {
+ DIP("call-noredir *%%eax\n");
+ delta +=3D 20;
+ t1 =3D newTemp(Ity_I32);
+ assign(t1, getIReg(4,R_EAX));
+ t2 =3D newTemp(Ity_I32);
+ assign(t2, binop(Iop_Sub32, getIReg(4,R_ESP), mkU32(4)));
+ putIReg(4, R_ESP, mkexpr(t2));
+ storeLE( mkexpr(t2), mkU32(guest_EIP_bbstart+delta));
+ jmp_treg(Ijk_NoRedir,t1);
+ dres.whatNext =3D Dis_StopHere;
+ goto decode_success;
+ }
+ }
+
/* Skip a LOCK prefix. */
/* 2005 Jan 06: the following insns are observed to sometimes
have a LOCK prefix:
Modified: branches/FNWRAP/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
--- branches/FNWRAP/priv/main/vex_main.c 2005-12-27 14:35:15 UTC (rev 151=
6)
+++ branches/FNWRAP/priv/main/vex_main.c 2005-12-27 16:39:36 UTC (rev 151=
7)
@@ -208,8 +208,8 @@
Bool (*byte_accessible) ( Addr64 ),
/* IN: debug: trace vex activity at various points */
Int traceflags,
- /* IN: should this translation do a check of guest_NOREDIR ? */
- Bool do_noredir_check
+ /* IN: should this translation set guest_NRADDR? */
+ Bool do_set_NRADDR
)
{
/* This the bundle of functions we need to do the back-end stuff
@@ -237,8 +237,7 @@
HInstrArray* vcode;
HInstrArray* rcode;
Int i, j, k, out_used, guest_sizeB;
- Int offB_TISTART, offB_TILEN;
- Int offB_NRFLAG, offB_NRADDR;
+ Int offB_TISTART, offB_TILEN, offB_NRADDR;
UChar insn_bytes[32];
IRType guest_word_type;
IRType host_word_type;
@@ -262,7 +261,6 @@
host_word_type =3D Ity_INVALID;
offB_TISTART =3D 0;
offB_TILEN =3D 0;
- offB_NRFLAG =3D 0;
offB_NRADDR =3D 0;
=20
vex_traceflags =3D traceflags;
@@ -347,7 +345,6 @@
guest_layout =3D &x86guest_layout;
offB_TISTART =3D offsetof(VexGuestX86State,guest_TISTART);
offB_TILEN =3D offsetof(VexGuestX86State,guest_TILEN);
- offB_NRFLAG =3D offsetof(VexGuestX86State,guest_NRFLAG);
offB_NRADDR =3D offsetof(VexGuestX86State,guest_NRADDR);
vassert(archinfo_guest->subarch =3D=3D VexSubArchX86_sse0
|| archinfo_guest->subarch =3D=3D VexSubArchX86_sse1
@@ -355,7 +352,6 @@
vassert(0 =3D=3D sizeof(VexGuestX86State) % 8);
vassert(sizeof( ((VexGuestX86State*)0)->guest_TISTART) =3D=3D 4=
);
vassert(sizeof( ((VexGuestX86State*)0)->guest_TILEN ) =3D=3D 4=
);
- vassert(sizeof( ((VexGuestX86State*)0)->guest_NRFLAG ) =3D=3D 4=
);
vassert(sizeof( ((VexGuestX86State*)0)->guest_NRADDR ) =3D=3D 4=
);
break;
=20
@@ -368,13 +364,11 @@
guest_layout =3D &amd64guest_layout;
offB_TISTART =3D offsetof(VexGuestAMD64State,guest_TISTART)=
;
offB_TILEN =3D offsetof(VexGuestAMD64State,guest_TILEN);
- offB_NRFLAG =3D offsetof(VexGuestAMD64State,guest_NRFLAG);
offB_NRADDR =3D offsetof(VexGuestAMD64State,guest_NRADDR);
vassert(archinfo_guest->subarch =3D=3D VexSubArch_NONE);
vassert(0 =3D=3D sizeof(VexGuestAMD64State) % 8);
vassert(sizeof( ((VexGuestAMD64State*)0)->guest_TISTART ) =3D=3D=
8);
vassert(sizeof( ((VexGuestAMD64State*)0)->guest_TILEN ) =3D=3D=
8);
- vassert(sizeof( ((VexGuestAMD64State*)0)->guest_NRFLAG ) =3D=3D=
8);
vassert(sizeof( ((VexGuestAMD64State*)0)->guest_NRADDR ) =3D=3D=
8);
break;
=20
@@ -387,7 +381,6 @@
guest_layout =3D &armGuest_layout;
offB_TISTART =3D 0; /* hack ... arm has bitrot */
offB_TILEN =3D 0; /* hack ... arm has bitrot */
- offB_NRFLAG =3D 0; /* hack ... arm has bitrot */
offB_NRADDR =3D 0; /* hack ... arm has bitrot */
vassert(archinfo_guest->subarch =3D=3D VexSubArchARM_v4);
break;
@@ -401,7 +394,6 @@
guest_layout =3D &ppc32Guest_layout;
offB_TISTART =3D offsetof(VexGuestPPC32State,guest_TISTART)=
;
offB_TILEN =3D offsetof(VexGuestPPC32State,guest_TILEN);
- offB_NRFLAG =3D offsetof(VexGuestPPC32State,guest_NRFLAG);
offB_NRADDR =3D offsetof(VexGuestPPC32State,guest_NRADDR);
vassert(archinfo_guest->subarch =3D=3D VexSubArchPPC32_I
|| archinfo_guest->subarch =3D=3D VexSubArchPPC32_FI
@@ -409,7 +401,6 @@
vassert(0 =3D=3D sizeof(VexGuestPPC32State) % 8);
vassert(sizeof( ((VexGuestPPC32State*)0)->guest_TISTART ) =3D=3D=
4);
vassert(sizeof( ((VexGuestPPC32State*)0)->guest_TILEN ) =3D=3D=
4);
- vassert(sizeof( ((VexGuestPPC32State*)0)->guest_NRFLAG ) =3D=3D=
4);
vassert(sizeof( ((VexGuestPPC32State*)0)->guest_NRADDR ) =3D=3D=
4);
break;
=20
@@ -442,10 +433,9 @@
archinfo_guest,
guest_word_type,
do_self_check,
- do_noredir_check,
+ do_set_NRADDR,
offB_TISTART,
offB_TILEN,
- offB_NRFLAG,
offB_NRADDR );
=20
vexAllocSanityCheck();
Modified: branches/FNWRAP/pub/libvex.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
--- branches/FNWRAP/pub/libvex.h 2005-12-27 14:35:15 UTC (rev 1516)
+++ branches/FNWRAP/pub/libvex.h 2005-12-27 16:39:36 UTC (rev 1517)
@@ -338,8 +338,8 @@
Bool (*byte_accessible) ( Addr64 ),
/* IN: debug: trace vex activity at various points */
Int traceflags,
- /* IN: should this translation do a check of guest_NOREDIR ? */
- Bool do_noredir_check
+ /* IN: should this translation set guest_NRADDR? */
+ Bool do_set_NRADDR
);
=20
/* A subtlety re interaction between self-checking translations and
@@ -396,18 +396,19 @@
=20
ALL GUEST ARCHITECTURES
~~~~~~~~~~~~~~~~~~~~~~~
- The architecture must contain two pseudo-registers, guest_TISTART
+ The guest state must contain two pseudo-registers, guest_TISTART
and guest_TILEN. These are used to pass the address of areas of
guest code, translations of which are to be invalidated, back to
the despatcher. Both pseudo-regs must have size equal to the guest
word size.
=20
- The architecture must contain a two more pseudo-registers,
- guest_NRFLAG and guest_NRADDR, which are both guest-word-sized.
- These are tested and zeroed at the start of translations of
- redirected blocks (under LibVEX's client's control). If _NRFLAG is
- nonzero and _NRADDR equals the unredirected guest address of the
- block, then _NRFLAG is zeroed, and the block immediately exited.
+ The architecture must a third pseudo-register, guest_NRADDR, also
+ guest-word-sized. This is used to record the unredirected guest
+ address at the start of a translation whose start has been
+ redirected. By reading this pseudo-register shortly afterwards,
+ the translation can find out what the corresponding no-redirection
+ address was. Note, this is only set for wrap-style redirects, not
+ for replace-style ones.
*/
#endif /* ndef __LIBVEX_H */
=20
Modified: branches/FNWRAP/pub/libvex_guest_amd64.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
--- branches/FNWRAP/pub/libvex_guest_amd64.h 2005-12-27 14:35:15 UTC (rev=
1516)
+++ branches/FNWRAP/pub/libvex_guest_amd64.h 2005-12-27 16:39:36 UTC (rev=
1517)
@@ -145,14 +145,12 @@
ULong guest_TISTART;
ULong guest_TILEN;
=20
- /* Affects behaviour on entry to redirected translations: if
- _NRFLAG ("NR", no-redirect) is nonzero and _NRADDR equals the
- unredirected guest address for this translation, will cause
- an immediate exit, requesting to execute the unredirected
- version instead. Such an exit "uses up" the setting, in that
- _NRFLAG must be reset to zero if the exit occurs, and
- unchanged if it doesn't. */
- ULong guest_NRFLAG;
+ /* Used to record the unredirected guest address at the start of
+ a translation whose start has been redirected. By reading
+ this pseudo-register shortly afterwards, the translation can
+ find out what the corresponding no-redirection address was.
+ Note, this is only set for wrap-style redirects, not for
+ replace-style ones. */
ULong guest_NRADDR;
=20
/* Padding to make it have an 8-aligned size */
Modified: branches/FNWRAP/pub/libvex_guest_ppc32.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
--- branches/FNWRAP/pub/libvex_guest_ppc32.h 2005-12-27 14:35:15 UTC (rev=
1516)
+++ branches/FNWRAP/pub/libvex_guest_ppc32.h 2005-12-27 16:39:36 UTC (rev=
1517)
@@ -207,15 +207,13 @@
/* 948 */ UInt guest_TISTART;
/* 952 */ UInt guest_TILEN;
=20
- /* Affects behaviour on entry to redirected translations: if
- _NRFLAG ("NR", no-redirect) is nonzero and _NRADDR equals the
- unredirected guest address for this translation, will cause
- an immediate exit, requesting to execute the unredirected
- version instead. Such an exit "uses up" the setting, in that
- _NRFLAG must be reset to zero if the exit occurs, and
- unchanged if it doesn't. */
- /* 956 */ UInt guest_NRFLAG;
- /* 960 */ UInt guest_NRADDR;
+ /* Used to record the unredirected guest address at the start of
+ a translation whose start has been redirected. By reading
+ this pseudo-register shortly afterwards, the translation can
+ find out what the corresponding no-redirection address was.
+ Note, this is only set for wrap-style redirects, not for
+ replace-style ones. */
+ /* 956 */ UInt guest_NRADDR;
=20
/* Padding to make it have an 8-aligned size */
UInt padding;
Modified: branches/FNWRAP/pub/libvex_guest_ppc64.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
--- branches/FNWRAP/pub/libvex_guest_ppc64.h 2005-12-27 14:35:15 UTC (rev=
1516)
+++ branches/FNWRAP/pub/libvex_guest_ppc64.h 2005-12-27 16:39:36 UTC (rev=
1517)
@@ -243,8 +243,16 @@
=20
/* For lwarx/stwcx.: 0 =3D=3D no reservation exists, non-0 =3D=3D =
a
reservation exists. */
- /* 2000 */ ULong guest_RESVN;
+ /* 1100 */ ULong guest_RESVN;
=20
+ /* Used to record the unredirected guest address at the start of
+ a translation whose start has been redirected. By reading
+ this pseudo-register shortly afterwards, the translation can
+ find out what the corresponding no-redirection address was.
+ Note, this is only set for wrap-style redirects, not for
+ replace-style ones. */
+ /* 1108 */ ULong guest_NRADDR;
+
/* Padding to make it have an 8-aligned size */
//UInt padding;
}
Modified: branches/FNWRAP/pub/libvex_guest_x86.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
--- branches/FNWRAP/pub/libvex_guest_x86.h 2005-12-27 14:35:15 UTC (rev 1=
516)
+++ branches/FNWRAP/pub/libvex_guest_x86.h 2005-12-27 16:39:36 UTC (rev 1=
517)
@@ -208,28 +208,20 @@
/* Emulation warnings */
UInt guest_EMWARN;
=20
- /* Translation-invalidation area description. Not used on x86
- (there is no invalidate-icache insn), but needed so as to
- allow users of the library to uniformly assume that the guest
- state contains these two fields -- otherwise there is
- compilation breakage. On x86, these two fields are set to
- zero by LibVEX_GuestX86_initialise and then should be ignored
- forever thereafter. */
+ /* For clflush: record start and length of area to invalidate */
UInt guest_TISTART;
UInt guest_TILEN;
=20
- /* Affects behaviour on entry to redirected translations: if
- _NRFLAG ("NR", no-redirect) is nonzero and _NRADDR equals the
- unredirected guest address for this translation, will cause
- an immediate exit, requesting to execute the unredirected
- version instead. Such an exit "uses up" the setting, in that
- _NRFLAG must be reset to zero if the exit occurs, and
- unchanged if it doesn't. */
- UInt guest_NRFLAG;
+ /* Used to record the unredirected guest address at the start of
+ a translation whose start has been redirected. By reading
+ this pseudo-register shortly afterwards, the translation can
+ find out what the corresponding no-redirection address was.
+ Note, this is only set for wrap-style redirects, not for
+ replace-style ones. */
UInt guest_NRADDR;
=20
/* Padding to make it have an 8-aligned size */
- /*UInt padding;*/
+ UInt padding;
}
VexGuestX86State;
=20
|