]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86_emulate: Fix MUL emulation.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 18 Feb 2008 14:21:11 +0000 (14:21 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 18 Feb 2008 14:21:11 +0000 (14:21 +0000)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset:   16995:445edf4089a3ccaca977665423e903b5300832cb
xen-unstable date:        Thu Feb 07 18:00:44 2008 +0000

xen/arch/x86/x86_emulate.c

index 84480e01c26275ecaf3822093c4ce69bafb5baee..3ec3e2e848165ad4250c56f0a8c61988ad3b9a8e 100644 (file)
@@ -1383,11 +1383,14 @@ x86_emulate(
             switch ( src.bytes )
             {
             case 1:
+                dst.val = (uint8_t)dst.val;
                 dst.val *= src.val;
                 if ( (uint8_t)dst.val != (uint16_t)dst.val )
                     _regs.eflags |= EFLG_OF|EFLG_CF;
+                dst.bytes = 2;
                 break;
             case 2:
+                dst.val = (uint16_t)dst.val;
                 dst.val *= src.val;
                 if ( (uint16_t)dst.val != (uint32_t)dst.val )
                     _regs.eflags |= EFLG_OF|EFLG_CF;
@@ -1395,6 +1398,7 @@ x86_emulate(
                 break;
 #ifdef __x86_64__
             case 4:
+                dst.val = (uint32_t)dst.val;
                 dst.val *= src.val;
                 if ( (uint32_t)dst.val != dst.val )
                     _regs.eflags |= EFLG_OF|EFLG_CF;