ia64/xen-unstable

changeset 16699:7e400607cdd8

x86_emulate: Fix handling of RIP-relative addressing.
The handling of SHLD/SHRD introduced in 16696:b5b3e27f1af3f7 was
incorrect; thanks to Gary Grebus @ Virtual Iron for spotting it.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jan 09 22:21:28 2008 +0000 (2008-01-09)
parents f983aa8e4b26
children 36bb2ab47227
files xen/arch/x86/x86_emulate.c
line diff
     1.1 --- a/xen/arch/x86/x86_emulate.c	Wed Jan 09 10:35:52 2008 +0000
     1.2 +++ b/xen/arch/x86/x86_emulate.c	Wed Jan 09 22:21:28 2008 +0000
     1.3 @@ -1059,12 +1059,12 @@ x86_emulate(
     1.4                          ((op_bytes == 8) ? 4 : op_bytes);
     1.5                  else if ( (d & SrcMask) == SrcImmByte )
     1.6                      ea.mem.off += 1;
     1.7 -                else if ( ((b == 0xf6) || (b == 0xf7)) &&
     1.8 +                else if ( !twobyte && ((b & 0xfe) == 0xf6) &&
     1.9                            ((modrm_reg & 7) <= 1) )
    1.10                      /* Special case in Grp3: test has immediate operand. */
    1.11                      ea.mem.off += (d & ByteOp) ? 1
    1.12                          : ((op_bytes == 8) ? 4 : op_bytes);
    1.13 -                else if ( (b == 0xf7) == 0xa4 )
    1.14 +                else if ( twobyte && ((b & 0xf7) == 0xa4) )
    1.15                      /* SHLD/SHRD with immediate byte third operand. */
    1.16                      ea.mem.off++;
    1.17                  break;