# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1250694095 -3600
# Node ID 090e394202d0bb0089abc5e5276ed7fda283567d
# Parent daf1ff2c7dbd59b2ab31e6427be58ffdc14e10fd
x86_emulate: Fixes for 'mov rm16,sreg'
1. Memory reads should be 16 bits only
2. Attempt to load %cs should result in #UD
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset: 20035:3fe64f43944f
xen-unstable date: Fri Aug 07 10:53:22 2009 +0100
---
xen/arch/x86/x86_emulate/x86_emulate.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
diff -r daf1ff2c7dbd -r 090e394202d0 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c Wed Aug 19 16:01:08 2009 +0100
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c Wed Aug 19 16:01:35 2009 +0100
@@ -113,7 +113,7 @@ static uint8_t opcode_table[256] = {
ByteOp|DstMem|SrcReg|ModRM|Mov, DstMem|SrcReg|ModRM|Mov,
ByteOp|DstReg|SrcMem|ModRM|Mov, DstReg|SrcMem|ModRM|Mov,
DstMem|SrcReg|ModRM|Mov, DstReg|SrcNone|ModRM,
- DstReg|SrcMem|ModRM|Mov, DstMem|SrcNone|ModRM|Mov,
+ DstReg|SrcMem16|ModRM|Mov, DstMem|SrcNone|ModRM|Mov,
/* 0x90 - 0x97 */
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
@@ -2017,6 +2017,7 @@ x86_emulate(
case 0x8e: /* mov r/m,Sreg */ {
enum x86_segment seg = decode_segment(modrm_reg);
generate_exception_if(seg == decode_segment_failed, EXC_UD, -1);
+ generate_exception_if(seg == x86_seg_cs, EXC_UD, -1);
if ( (rc = load_seg(seg, (uint16_t)src.val, ctxt, ops)) != 0 )
goto done;
if ( seg == x86_seg_ss )
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|