ia64/xen-unstable

changeset 13276:16b0e0f250f4

[XEN] Fix EA calculation for POP <rm> when stack pointer is used as
base of the EA calculation. It should be used *post* increment.

Original patch from Jan Beulich <jbeulich@novell.com>

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Jan 05 14:44:58 2007 +0000 (2007-01-05)
parents 58efd34d0837
children efbfcc3b9f38
files xen/arch/x86/x86_emulate.c
line diff
     1.1 --- a/xen/arch/x86/x86_emulate.c	Fri Jan 05 12:33:23 2007 +0000
     1.2 +++ b/xen/arch/x86/x86_emulate.c	Fri Jan 05 14:44:58 2007 +0000
     1.3 @@ -616,6 +616,11 @@ x86_emulate(
     1.4                  ea.mem.off <<= (sib >> 6) & 3;
     1.5                  if ( (modrm_mod == 0) && ((sib_base & 7) == 5) )
     1.6                      ea.mem.off += insn_fetch_type(int32_t);
     1.7 +                else if ( (sib_base == 4) && !twobyte && (b == 0x8f) )
     1.8 +                    /* POP <rm> must have its EA calculated post increment. */
     1.9 +                    ea.mem.off += _regs.esp +
    1.10 +                        (((mode == X86EMUL_MODE_PROT64) && (op_bytes == 4))
    1.11 +                         ? 8 : op_bytes);
    1.12                  else
    1.13                      ea.mem.off += *(long*)decode_register(sib_base, &_regs, 0);
    1.14              }