diff options
author | Keir Fraser <keir@xen.org> | 2012-03-23 20:51:48 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2012-03-23 20:51:48 +0000 |
commit | ebe5e562487f3f3bc814463ac42043fc0074b0f3 (patch) | |
tree | 7fa41aac337270360942a1ea46532b05020fa9fe /xen/arch/x86/x86_emulate | |
parent | 47fb6fb49f65295c4cc1feead64657cb20363ab2 (diff) | |
download | xen-ebe5e562487f3f3bc814463ac42043fc0074b0f3.tar.gz xen-ebe5e562487f3f3bc814463ac42043fc0074b0f3.tar.bz2 xen-ebe5e562487f3f3bc814463ac42043fc0074b0f3.zip |
x86_emulate: Do not push an error code onto a #UD exception stack
Signed-off-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 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 7f842ce0af..b894d807d5 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_UD, 0); + generate_exception_if((d & Mov) && lock_prefix, EXC_UD, -1); /* 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_UD, 0); + EXC_UD, -1); dst.type = OP_NONE; break; case DstReg: - generate_exception_if(lock_prefix, EXC_UD, 0); + generate_exception_if(lock_prefix, EXC_UD, -1); 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_UD, 0); + generate_exception_if(lock_prefix, EXC_UD, -1); switch ( dst.bytes ) { case 1: dst.val = *(uint8_t *)dst.reg; break; @@ -3785,14 +3785,14 @@ x86_emulate( struct segment_register cs = { 0 }, ss = { 0 }; int rc; - generate_exception_if(in_realmode(ctxt, ops), EXC_UD, 0); - generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, 0); + generate_exception_if(in_realmode(ctxt, ops), EXC_UD, -1); + generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1); /* Inject #UD if syscall/sysret are disabled. */ fail_if(ops->read_msr == NULL); if ( (rc = ops->read_msr(MSR_EFER, &msr_content, ctxt)) != 0 ) goto done; - generate_exception_if((msr_content & EFER_SCE) == 0, EXC_UD, 0); + generate_exception_if((msr_content & EFER_SCE) == 0, EXC_UD, -1); if ( (rc = ops->read_msr(MSR_STAR, &msr_content, ctxt)) != 0 ) goto done; |