[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] x86_emulate: fix emulation of CMPXCHG



>>> Eugene Korenevsky <ekorenevsky@xxxxxxxxx> 04/28/15 11:54 PM >>>
>--- a/xen/arch/x86/x86_emulate/x86_emulate.c
>+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>@@ -4343,7 +4343,8 @@ x86_emulate(
>/* Save real source value, then compare EAX against destination. */
>src.orig_val = src.val;
>src.val = _regs.eax;
>-        emulate_2op_SrcV("cmp", src, dst, _regs.eflags);
>+        /* EAX must be a minuend, dst must be a subtrahend. */
>+        emulate_2op_SrcV("cmp", dst, src, _regs.eflags);

Thanks, operands indeed need to be the other way around. The comment,
however, doesn't really look that helpful to me, and hence I intend to alter
it before committing (also getting it closer to what CMPS and SCAS have).

Should you submit further patches in the future, please also remember to
Cc relevant maintainers.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.