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

[Xen-changelog] [xen-unstable] [XEN] Fix emulator EA calculation for LODS/STOS.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxxx
# Node ID 91951de7592c0a553dd5bacef6b481cab2e9fac5
# Parent  e4bb22422b50871e26120d39b5667c9091d49f62
[XEN] Fix emulator EA calculation for LODS/STOS.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/x86_emulate.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff -r e4bb22422b50 -r 91951de7592c xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c        Sun Nov 26 13:52:48 2006 +0000
+++ b/xen/arch/x86/x86_emulate.c        Sun Nov 26 17:35:00 2006 +0000
@@ -1007,23 +1007,25 @@ x86_emulate_memop(
                 goto done;
             ea = register_address(*seg, _regs.esi);
         }
+        page_boundary_test();
         register_address_increment(
             _regs.esi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
         register_address_increment(
             _regs.edi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
+        break;
+    case 0xaa ... 0xab: /* stos */
+        ea = register_address(_regs.es, _regs.edi);
         page_boundary_test();
-        break;
-    case 0xaa ... 0xab: /* stos */
         dst.type  = OP_MEM;
         dst.bytes = (d & ByteOp) ? 1 : op_bytes;
         dst.ptr   = (unsigned long *)cr2;
         dst.val   = _regs.eax;
         register_address_increment(
             _regs.edi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
-        ea = register_address(_regs.es, _regs.edi);
+        break;
+    case 0xac ... 0xad: /* lods */
+        ea = register_address(*seg, _regs.esi);
         page_boundary_test();
-        break;
-    case 0xac ... 0xad: /* lods */
         dst.type  = OP_REG;
         dst.bytes = (d & ByteOp) ? 1 : op_bytes;
         dst.ptr   = (unsigned long *)&_regs.eax;
@@ -1031,8 +1033,6 @@ x86_emulate_memop(
             goto done;
         register_address_increment(
             _regs.esi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
-        ea = register_address(*seg, _regs.esi);
-        page_boundary_test();
         break;
     }
     goto writeback;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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