ia64/xen-unstable

changeset 14579:b685bb321d1e

Fix push/jmp/call <reg/mem> to check whether the operand is register
or memory when expanding the operand to 8 bytes on x86/64.

Based on original patch by Dexuan Cui <dexuan.cui@intel.com>

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Mar 27 11:20:55 2007 +0100 (2007-03-27)
parents 70f4d99d1aed
children 2c1556c893e7
files xen/arch/x86/x86_emulate.c
line diff
     1.1 --- a/xen/arch/x86/x86_emulate.c	Mon Mar 26 17:22:45 2007 +0100
     1.2 +++ b/xen/arch/x86/x86_emulate.c	Tue Mar 27 11:20:55 2007 +0100
     1.3 @@ -1565,8 +1565,10 @@ x86_emulate(
     1.4              if ( ((op_bytes = dst.bytes) != 8) && mode_64bit() )
     1.5              {
     1.6                  dst.bytes = op_bytes = 8;
     1.7 -                if ( (rc = ops->read(dst.mem.seg, dst.mem.off,
     1.8 -                                     &dst.val, 8, ctxt)) != 0 )
     1.9 +                if ( dst.type == OP_REG )
    1.10 +                    dst.val = *dst.reg;
    1.11 +                else if ( (rc = ops->read(dst.mem.seg, dst.mem.off,
    1.12 +                                          &dst.val, 8, ctxt)) != 0 )
    1.13                      goto done;
    1.14              }
    1.15              src.val = _regs.eip;
    1.16 @@ -1579,8 +1581,10 @@ x86_emulate(
    1.17              if ( mode_64bit() && (dst.bytes == 4) )
    1.18              {
    1.19                  dst.bytes = 8;
    1.20 -                if ( (rc = ops->read(dst.mem.seg, dst.mem.off,
    1.21 -                                     &dst.val, 8, ctxt)) != 0 )
    1.22 +                if ( dst.type == OP_REG )
    1.23 +                    dst.val = *dst.reg;
    1.24 +                else if ( (rc = ops->read(dst.mem.seg, dst.mem.off,
    1.25 +                                          &dst.val, 8, ctxt)) != 0 )
    1.26                      goto done;
    1.27              }
    1.28              if ( (rc = ops->write(x86_seg_ss, sp_pre_dec(dst.bytes),