xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86emul: correct direction of FPU insn emulations
@ 2016-11-09  8:25 Jan Beulich
  2016-11-09 12:13 ` Andrew Cooper
  2016-11-10 14:19 ` Wei Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2016-11-09  8:25 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

There are two cases where this was wrong, albeit in a benign way (the
compiler - according to my checking - didn't leverage the wrongness
for any optimizations affecting overall outcome).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3683,7 +3683,7 @@ x86_emulate(
                 if ( (rc = ops->read(src.mem.seg, src.mem.off,
                                      &src.val, src.bytes, ctxt)) != 0 )
                     goto done;
-                emulate_fpu_insn_memdst("fldt", src.val);
+                emulate_fpu_insn_memsrc("fldt", src.val);
                 break;
             case 7: /* fstp m80fp */
                 ea.bytes = 10;
@@ -3780,7 +3780,7 @@ x86_emulate(
                 ea.bytes = 8;
                 dst = ea;
                 dst.type = OP_MEM;
-                emulate_fpu_insn_memsrc("fstl", dst.val);
+                emulate_fpu_insn_memdst("fstl", dst.val);
                 break;
             case 3: /* fstp m64fp */
                 ea.bytes = 8;




[-- Attachment #2: x86emul-FPU-mem-direction.patch --]
[-- Type: text/plain, Size: 1162 bytes --]

x86emul: correct direction of FPU insn emulations

There are two cases where this was wrong, albeit in a benign way (the
compiler - according to my checking - didn't leverage the wrongness
for any optimizations affecting overall outcome).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3683,7 +3683,7 @@ x86_emulate(
                 if ( (rc = ops->read(src.mem.seg, src.mem.off,
                                      &src.val, src.bytes, ctxt)) != 0 )
                     goto done;
-                emulate_fpu_insn_memdst("fldt", src.val);
+                emulate_fpu_insn_memsrc("fldt", src.val);
                 break;
             case 7: /* fstp m80fp */
                 ea.bytes = 10;
@@ -3780,7 +3780,7 @@ x86_emulate(
                 ea.bytes = 8;
                 dst = ea;
                 dst.type = OP_MEM;
-                emulate_fpu_insn_memsrc("fstl", dst.val);
+                emulate_fpu_insn_memdst("fstl", dst.val);
                 break;
             case 3: /* fstp m64fp */
                 ea.bytes = 8;

[-- Attachment #3: Type: text/plain, Size: 127 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-10 14:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-09  8:25 [PATCH] x86emul: correct direction of FPU insn emulations Jan Beulich
2016-11-09 12:13 ` Andrew Cooper
2016-11-10 14:19 ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).