]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86_emulate: Disable writeback if BSF/BSR are passed zero input.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Apr 2008 10:59:39 +0000 (11:59 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Apr 2008 10:59:39 +0000 (11:59 +0100)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset:   17496:1cc4df5c7fe8b34de2a3258f1cafec94540d1712
xen-unstable date:        Tue Apr 22 11:44:56 2008 +0100

xen/arch/x86/x86_emulate.c

index a7870eca2dcc6ba935beb7721ccd43adceeed65e..8ddac67061d388af7957ef4179f13f23f046a605 100644 (file)
@@ -2206,7 +2206,11 @@ x86_emulate(
               : "=r" (dst.val), "=q" (zf)
               : "r" (src.val), "1" (0) );
         _regs.eflags &= ~EFLG_ZF;
-        _regs.eflags |= zf ? EFLG_ZF : 0;
+        if ( zf )
+        {
+            _regs.eflags |= EFLG_ZF;
+            dst.type = OP_NONE;
+        }
         break;
     }
 
@@ -2216,7 +2220,11 @@ x86_emulate(
               : "=r" (dst.val), "=q" (zf)
               : "r" (src.val), "1" (0) );
         _regs.eflags &= ~EFLG_ZF;
-        _regs.eflags |= zf ? EFLG_ZF : 0;
+        if ( zf )
+        {
+            _regs.eflags |= EFLG_ZF;
+            dst.type = OP_NONE;
+        }
         break;
     }