ia64/xen-unstable

changeset 12573:91951de7592c

[XEN] Fix emulator EA calculation for LODS/STOS.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@localhost.localdomain
date Sun Nov 26 17:35:00 2006 +0000 (2006-11-26)
parents e4bb22422b50
children 4d07411c517a
files xen/arch/x86/x86_emulate.c
line diff
     1.1 --- a/xen/arch/x86/x86_emulate.c	Sun Nov 26 13:52:48 2006 +0000
     1.2 +++ b/xen/arch/x86/x86_emulate.c	Sun Nov 26 17:35:00 2006 +0000
     1.3 @@ -1007,23 +1007,25 @@ x86_emulate_memop(
     1.4                  goto done;
     1.5              ea = register_address(*seg, _regs.esi);
     1.6          }
     1.7 +        page_boundary_test();
     1.8          register_address_increment(
     1.9              _regs.esi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
    1.10          register_address_increment(
    1.11              _regs.edi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
    1.12 -        page_boundary_test();
    1.13          break;
    1.14      case 0xaa ... 0xab: /* stos */
    1.15 +        ea = register_address(_regs.es, _regs.edi);
    1.16 +        page_boundary_test();
    1.17          dst.type  = OP_MEM;
    1.18          dst.bytes = (d & ByteOp) ? 1 : op_bytes;
    1.19          dst.ptr   = (unsigned long *)cr2;
    1.20          dst.val   = _regs.eax;
    1.21          register_address_increment(
    1.22              _regs.edi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
    1.23 -        ea = register_address(_regs.es, _regs.edi);
    1.24 -        page_boundary_test();
    1.25          break;
    1.26      case 0xac ... 0xad: /* lods */
    1.27 +        ea = register_address(*seg, _regs.esi);
    1.28 +        page_boundary_test();
    1.29          dst.type  = OP_REG;
    1.30          dst.bytes = (d & ByteOp) ? 1 : op_bytes;
    1.31          dst.ptr   = (unsigned long *)&_regs.eax;
    1.32 @@ -1031,8 +1033,6 @@ x86_emulate_memop(
    1.33              goto done;
    1.34          register_address_increment(
    1.35              _regs.esi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
    1.36 -        ea = register_address(*seg, _regs.esi);
    1.37 -        page_boundary_test();
    1.38          break;
    1.39      }
    1.40      goto writeback;