|
From: <sv...@va...> - 2009-01-22 20:40:33
|
Author: sewardj
Date: 2009-01-22 20:40:22 +0000 (Thu, 22 Jan 2009)
New Revision: 1881
Log:
Handle both %gs and %fs prefixes on amd64 a bit more "properly".
Modified:
trunk/priv/guest-amd64/toIR.c
Modified: trunk/priv/guest-amd64/toIR.c
===================================================================
--- trunk/priv/guest-amd64/toIR.c 2009-01-03 17:35:15 UTC (rev 1880)
+++ trunk/priv/guest-amd64/toIR.c 2009-01-22 20:40:22 UTC (rev 1881)
@@ -8813,9 +8813,15 @@
if (n > 1)
goto decode_failure; /* multiple seg overrides == illegal */
- if (pfx & PFX_GS)
- goto decode_failure; /* legal, but unsupported right now */
+ /* We have a %fs prefix. Reject it if there's no evidence in 'vbi'
+ that we should accept it. */
+ if ((pfx & PFX_FS) && !vbi->guest_amd64_assume_fs_is_zero)
+ goto decode_failure;
+ /* Ditto for %gs prefixes. */
+ if ((pfx & PFX_GS) && !vbi->guest_amd64_assume_gs_is_0x60)
+ goto decode_failure;
+
/* Set up sz. */
sz = 4;
if (pfx & PFX_66) sz = 2;
|