diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2012-03-23 20:45:16 +0000 |
---|---|---|
committer | Andrew Cooper <andrew.cooper3@citrix.com> | 2012-03-23 20:45:16 +0000 |
commit | 47fb6fb49f65295c4cc1feead64657cb20363ab2 (patch) | |
tree | dbf59c8341b635724604f261ce26440ef9817c3f /xen/arch/x86/x86_emulate | |
parent | 0f049e6e2b4919250b1c66fabdbf8d812aa43880 (diff) | |
download | xen-47fb6fb49f65295c4cc1feead64657cb20363ab2.tar.gz xen-47fb6fb49f65295c4cc1feead64657cb20363ab2.tar.bz2 xen-47fb6fb49f65295c4cc1feead64657cb20363ab2.zip |
x86_emulate: raise #UD rather than #GP on invalid use of LOCK prefix
From: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/x86_emulate')
-rw-r--r-- | xen/arch/x86/x86_emulate/x86_emulate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index acefad30b1..7f842ce0af 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -1429,7 +1429,7 @@ x86_emulate( } /* Lock prefix is allowed only on RMW instructions. */ - generate_exception_if((d & Mov) && lock_prefix, EXC_GP, 0); + generate_exception_if((d & Mov) && lock_prefix, EXC_UD, 0); /* ModRM and SIB bytes. */ if ( d & ModRM ) @@ -1712,12 +1712,12 @@ x86_emulate( lock_prefix && ((b < 0x20) || (b > 0x23)) && /* MOV CRn/DRn */ (b != 0xc7), /* CMPXCHG{8,16}B */ - EXC_GP, 0); + EXC_UD, 0); dst.type = OP_NONE; break; case DstReg: - generate_exception_if(lock_prefix, EXC_GP, 0); + generate_exception_if(lock_prefix, EXC_UD, 0); dst.type = OP_REG; if ( d & ByteOp ) { @@ -1773,7 +1773,7 @@ x86_emulate( dst = ea; if ( dst.type == OP_REG ) { - generate_exception_if(lock_prefix, EXC_GP, 0); + generate_exception_if(lock_prefix, EXC_UD, 0); switch ( dst.bytes ) { case 1: dst.val = *(uint8_t *)dst.reg; break; |