ia64/xen-unstable

changeset 16703:c86025f569cb

x86_emulate: Certain opcodes are only valid with a memory operand.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 10 22:52:40 2008 +0000 (2008-01-10)
parents 850ec55df0dc
children 56b42d68518e
files xen/arch/x86/x86_emulate.c
line diff
     1.1 --- a/xen/arch/x86/x86_emulate.c	Thu Jan 10 15:30:46 2008 +0000
     1.2 +++ b/xen/arch/x86/x86_emulate.c	Thu Jan 10 22:52:40 2008 +0000
     1.3 @@ -1751,6 +1751,8 @@ x86_emulate(
     1.4          case 5: /* jmp (far, absolute indirect) */ {
     1.5              unsigned long sel;
     1.6  
     1.7 +            generate_exception_if(dst.type != OP_MEM, EXC_UD);
     1.8 +
     1.9              if ( (rc = ops->read(dst.mem.seg, dst.mem.off+dst.bytes,
    1.10                                   &sel, 2, ctxt)) )
    1.11                  goto done;
    1.12 @@ -2981,6 +2983,7 @@ x86_emulate(
    1.13      {
    1.14          unsigned long old_lo, old_hi;
    1.15          generate_exception_if((modrm_reg & 7) != 1, EXC_UD);
    1.16 +        generate_exception_if(ea.type != OP_MEM, EXC_UD);
    1.17          if ( (rc = ops->read(ea.mem.seg, ea.mem.off+0, &old_lo, 4, ctxt)) ||
    1.18               (rc = ops->read(ea.mem.seg, ea.mem.off+4, &old_hi, 4, ctxt)) )
    1.19              goto done;
    1.20 @@ -3008,6 +3011,7 @@ x86_emulate(
    1.21      {
    1.22          unsigned long old, new;
    1.23          generate_exception_if((modrm_reg & 7) != 1, EXC_UD);
    1.24 +        generate_exception_if(ea.type != OP_MEM, EXC_UD);
    1.25          if ( (rc = ops->read(ea.mem.seg, ea.mem.off, &old, 8, ctxt)) != 0 )
    1.26              goto done;
    1.27          if ( ((uint32_t)(old>>0) != (uint32_t)_regs.eax) ||