aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-01-09 22:21:28 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-01-09 22:21:28 +0000
commit48647b523d3ae31aeb42e45fac616eeee343046d (patch)
tree5701de61d47f64e7bb718ca6cf64d55269cb58bc
parent450bd7f584bc03c6f01555339aafe68ebaf8f115 (diff)
downloadxen-48647b523d3ae31aeb42e45fac616eeee343046d.tar.gz
xen-48647b523d3ae31aeb42e45fac616eeee343046d.tar.bz2
xen-48647b523d3ae31aeb42e45fac616eeee343046d.zip
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>
-rw-r--r--xen/arch/x86/x86_emulate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c
index 07bc21f4ed..679754c7a8 100644
--- a/xen/arch/x86/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate.c
@@ -1059,12 +1059,12 @@ x86_emulate(
((op_bytes == 8) ? 4 : op_bytes);
else if ( (d & SrcMask) == SrcImmByte )
ea.mem.off += 1;
- else if ( ((b == 0xf6) || (b == 0xf7)) &&
+ else if ( !twobyte && ((b & 0xfe) == 0xf6) &&
((modrm_reg & 7) <= 1) )
/* Special case in Grp3: test has immediate operand. */
ea.mem.off += (d & ByteOp) ? 1
: ((op_bytes == 8) ? 4 : op_bytes);
- else if ( (b == 0xf7) == 0xa4 )
+ else if ( twobyte && ((b & 0xf7) == 0xa4) )
/* SHLD/SHRD with immediate byte third operand. */
ea.mem.off++;
break;