|
From: <sv...@va...> - 2006-01-03 18:41:04
|
Author: sewardj
Date: 2006-01-03 18:41:00 +0000 (Tue, 03 Jan 2006)
New Revision: 1530
Log:
Fix magic-sequence spotting in 64-bit mode.
Modified:
trunk/priv/guest-ppc/toIR.c
Modified: trunk/priv/guest-ppc/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
--- trunk/priv/guest-ppc/toIR.c 2006-01-03 18:40:18 UTC (rev 1529)
+++ trunk/priv/guest-ppc/toIR.c 2006-01-03 18:41:00 UTC (rev 1530)
@@ -8361,11 +8361,39 @@
=20
/* Spot the client-request magic sequence. */
// Essentially a v. unlikely sequence of noops that we can catch
- {
+ if (mode64) {
+ /* Spot the magic sequence, 64-bit mode */
UChar* code =3D (UChar*)(&guest_code[delta]);
=20
/* Spot this: =20
0x7C03D808 tw 0,3,27 =3D> trap word if (0) =3D> no=
p
+ 0x7800E802 rotldi 0,0,61 =3D> ro =3D rotl(r0,61)
+ 0x78001800 rotldi 0,0,3 =3D> ro =3D rotl(r0,3)
+ 0x78006800 rotldi 0,0,13 =3D> ro =3D rotl(r0,13)
+ 0x78009802 rotldi 0,0,51 =3D> ro =3D rotl(r0,51)
+ 0x60000000 nop
+ */
+ if (getUIntBigendianly(code+ 0) =3D=3D 0x7C03D808 &&
+ getUIntBigendianly(code+ 4) =3D=3D 0x7800E802 &&
+ getUIntBigendianly(code+ 8) =3D=3D 0x78001800 &&
+ getUIntBigendianly(code+12) =3D=3D 0x78006800 &&
+ getUIntBigendianly(code+16) =3D=3D 0x78009802 &&
+ getUIntBigendianly(code+20) =3D=3D 0x60000000) {
+ DIP("%%r3 =3D client_request ( %%r31 )\n");
+ dres.len =3D 24;
+ delta +=3D 24;
+
+ irbb->next =3D mkSzImm( ty, guest_CIA_bbstart + delta );
+ irbb->jumpkind =3D Ijk_ClientReq;
+ dres.whatNext =3D Dis_StopHere;
+ goto decode_success;
+ }
+ } else {
+ /* Spot the magic sequence, 32-bit mode */
+ UChar* code =3D (UChar*)(&guest_code[delta]);
+
+ /* Spot this: =20
+ 0x7C03D808 tw 0,3,27 =3D> trap word if (0) =3D> no=
p
0x5400E800 rlwinm 0,0,29,0,0 =3D> r0 =3D rotl(r0,29)
0x54001800 rlwinm 0,0, 3,0,0 =3D> r0 =3D rotl(r0, 3)
0x54006800 rlwinm 0,0,13,0,0 =3D> r0 =3D rotl(r0,13)
|