|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86/emul: only emulate possibly operand sizes for POPA
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1352368352 -3600
# Node ID aa2074529eb0183257b6f5f29821b0cd6dfd991a
# Parent bd78e5630a5be55d439eb235627d52ebe8214524
x86/emul: only emulate possibly operand sizes for POPA
This opcode neither supports 1-byte operands, nor does it support
8-byte ones (since the opcode is undefined in 64-bit mode). Simplify
the code accordingly.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---
diff -r bd78e5630a5b -r aa2074529eb0 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c Fri Nov 02 17:15:30 2012 +0100
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c Thu Nov 08 10:52:32 2012 +0100
@@ -1996,13 +1996,10 @@ x86_emulate(
if ( (rc = read_ulong(x86_seg_ss, sp_post_inc(op_bytes),
&dst.val, op_bytes, ctxt, ops)) != 0 )
goto done;
- switch ( op_bytes )
- {
- case 1: *(uint8_t *)regs[i] = (uint8_t)dst.val; break;
- case 2: *(uint16_t *)regs[i] = (uint16_t)dst.val; break;
- case 4: *regs[i] = (uint32_t)dst.val; break; /* 64b: zero-ext */
- case 8: *regs[i] = dst.val; break;
- }
+ if ( op_bytes == 2 )
+ *(uint16_t *)regs[i] = (uint16_t)dst.val;
+ else
+ *regs[i] = dst.val; /* 64b: zero-ext done by read_ulong() */
}
break;
}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |