x86: emulate lea with two register operands correctly
authorDavid Vrabel <david.vrabel@citrix.com>
Thu, 5 Jan 2012 15:47:16 +0000 (15:47 +0000)
committerDavid Vrabel <david.vrabel@citrix.com>
Thu, 5 Jan 2012 15:47:16 +0000 (15:47 +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/arch/x86/x86_emulate/x86_emulate.c

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