]> xenbits.xensource.com Git - xen.git/commitdiff
x86: emulate lea with two register operands correctly
authorDavid Vrabel <david.vrabel@citrix.com>
Tue, 17 Jan 2012 11:35:03 +0000 (11:35 +0000)
committerDavid Vrabel <david.vrabel@citrix.com>
Tue, 17 Jan 2012 11:35:03 +0000 (11:35 +0000)
An lea instruction with two register operands should raise an
undefined instruction exception.

Skype does such a instruction and will crash when starting if it does
not get the exception.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24456:03781de56c31
xen-unstable date:        Thu Jan 05 15:47:16 2012 +0000

xen/arch/x86/x86_emulate/x86_emulate.c

index 1e5c41bdd1b950452adb79da2974eee99b82a342..aa491f1de455b58c15164a9bd31da96491c747d2 100644 (file)
@@ -2056,6 +2056,7 @@ x86_emulate(
     }
 
     case 0x8d: /* lea */
+        generate_exception_if(ea.type != OP_MEM, EXC_UD, -1);
         dst.val = ea.mem.off;
         break;