aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-07-26 07:37:51 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:50:00 -0400
commite071edd5ba8dd7a493eef229d495cf6232b09534 (patch)
treed9e1dc336f27d9f933903671b89c46159f584b9e
parentdfe11481d8f1b6a7354c34cb252ff1a8af233cfe (diff)
KVM: x86 emulator: unify the two Group 3 variants
Use just one group table for byte (F6) and word (F7) opcodes. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--arch/x86/kvm/emulate.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index bbe2d097c4ae..7f615c57cbad 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -105,8 +105,7 @@
105#define X16(x) X8(x), X8(x) 105#define X16(x) X8(x), X8(x)
106 106
107enum { 107enum {
108 Group1, Group1A, Group3_Byte, Group3, Group4, Group5, Group7, 108 Group1, Group1A, Group3, Group4, Group5, Group7, Group8, Group9,
109 Group8, Group9,
110}; 109};
111 110
112static u32 opcode_table[256] = { 111static u32 opcode_table[256] = {
@@ -217,7 +216,7 @@ static u32 opcode_table[256] = {
217 SrcNone | ByteOp | DstAcc, SrcNone | DstAcc, 216 SrcNone | ByteOp | DstAcc, SrcNone | DstAcc,
218 /* 0xF0 - 0xF7 */ 217 /* 0xF0 - 0xF7 */
219 0, 0, 0, 0, 218 0, 0, 0, 0,
220 ImplicitOps | Priv, ImplicitOps, Group | Group3_Byte, Group | Group3, 219 ImplicitOps | Priv, ImplicitOps, ByteOp | Group | Group3, Group | Group3,
221 /* 0xF8 - 0xFF */ 220 /* 0xF8 - 0xFF */
222 ImplicitOps, 0, ImplicitOps, ImplicitOps, 221 ImplicitOps, 0, ImplicitOps, ImplicitOps,
223 ImplicitOps, ImplicitOps, Group | Group4, Group | Group5, 222 ImplicitOps, ImplicitOps, Group | Group4, Group | Group5,
@@ -290,14 +289,10 @@ static u32 group_table[] = {
290 X7(Lock), 0, 289 X7(Lock), 0,
291 [Group1A*8] = 290 [Group1A*8] =
292 DstMem | SrcNone | ModRM | Mov | Stack, 0, 0, 0, 0, 0, 0, 0, 291 DstMem | SrcNone | ModRM | Mov | Stack, 0, 0, 0, 0, 0, 0, 0,
293 [Group3_Byte*8] =
294 ByteOp | SrcImm | DstMem | ModRM, ByteOp | SrcImm | DstMem | ModRM,
295 ByteOp | DstMem | SrcNone | ModRM | Lock, ByteOp | DstMem | SrcNone | ModRM | Lock,
296 0, 0, 0, 0,
297 [Group3*8] = 292 [Group3*8] =
298 DstMem | SrcImm | ModRM, DstMem | SrcImm | ModRM, 293 DstMem | SrcImm | ModRM, DstMem | SrcImm | ModRM,
299 DstMem | SrcNone | ModRM | Lock, DstMem | SrcNone | ModRM | Lock, 294 DstMem | SrcNone | ModRM | Lock, DstMem | SrcNone | ModRM | Lock,
300 0, 0, 0, 0, 295 X4(Undefined),
301 [Group4*8] = 296 [Group4*8] =
302 ByteOp | DstMem | SrcNone | ModRM | Lock, ByteOp | DstMem | SrcNone | ModRM | Lock, 297 ByteOp | DstMem | SrcNone | ModRM | Lock, ByteOp | DstMem | SrcNone | ModRM | Lock,
303 0, 0, 0, 0, 0, 0, 298 0, 0, 0, 0, 0, 0,