From: Keir Fraser Date: Thu, 10 Jan 2008 22:58:05 +0000 (+0000) Subject: x86_emulate: Certain opcodes are only valid with a memory operand. X-Git-Tag: 3.1.3-rc1~17 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7301893eb09705b54e01923f1020a97cb149deea;p=people%2Fvhanquez%2Fxen.git x86_emulate: Certain opcodes are only valid with a memory operand. Signed-off-by: Keir Fraser xen-unstable changeset: 16703:c86025f569cb xen-unstable date: Thu Jan 10 22:52:40 2008 +0000 --- diff --git a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c index 7d1a77864..5f119597e 100644 --- a/xen/arch/x86/x86_emulate.c +++ b/xen/arch/x86/x86_emulate.c @@ -2348,6 +2348,7 @@ x86_emulate( { unsigned long old_lo, old_hi; generate_exception_if((modrm_reg & 7) != 1, EXC_UD); + generate_exception_if(ea.type != OP_MEM, EXC_UD); if ( (rc = ops->read(ea.mem.seg, ea.mem.off+0, &old_lo, 4, ctxt)) || (rc = ops->read(ea.mem.seg, ea.mem.off+4, &old_hi, 4, ctxt)) ) goto done; @@ -2375,6 +2376,7 @@ x86_emulate( { unsigned long old, new; generate_exception_if((modrm_reg & 7) != 1, EXC_UD); + generate_exception_if(ea.type != OP_MEM, EXC_UD); if ( (rc = ops->read(ea.mem.seg, ea.mem.off, &old, 8, ctxt)) != 0 ) goto done; if ( ((uint32_t)(old>>0) != (uint32_t)_regs.eax) ||