diff options
author | Avi Kivity <avi@qumranet.com> | 2008-01-23 15:26:09 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-04-27 04:53:16 -0400 |
commit | 1d6ad2073e5354912291277c606a57fd37330f04 (patch) | |
tree | cdd755cff23797f15cdc9474c0eef1a7179b8273 /arch | |
parent | 09566765efd034feba45611f9d0ae9a702f8bb1d (diff) |
KVM: x86 emulator: group decoding for group 1 instructions
Opcodes 0x80-0x83
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/x86_emulate.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index ef6de16bb597..22900f70172b 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c | |||
@@ -70,6 +70,7 @@ | |||
70 | #define GroupMask 0xff /* Group number stored in bits 0:7 */ | 70 | #define GroupMask 0xff /* Group number stored in bits 0:7 */ |
71 | 71 | ||
72 | enum { | 72 | enum { |
73 | Group1_80, Group1_81, Group1_82, Group1_83, | ||
73 | Group1A, Group3_Byte, Group3, Group4, Group5, Group7, | 74 | Group1A, Group3_Byte, Group3, Group4, Group5, Group7, |
74 | }; | 75 | }; |
75 | 76 | ||
@@ -130,8 +131,8 @@ static u16 opcode_table[256] = { | |||
130 | ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, | 131 | ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, |
131 | ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, | 132 | ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, |
132 | /* 0x80 - 0x87 */ | 133 | /* 0x80 - 0x87 */ |
133 | ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImm | ModRM, | 134 | Group | Group1_80, Group | Group1_81, |
134 | ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImmByte | ModRM, | 135 | Group | Group1_82, Group | Group1_83, |
135 | ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, | 136 | ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, |
136 | ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, | 137 | ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, |
137 | /* 0x88 - 0x8F */ | 138 | /* 0x88 - 0x8F */ |
@@ -236,6 +237,26 @@ static u16 twobyte_table[256] = { | |||
236 | }; | 237 | }; |
237 | 238 | ||
238 | static u16 group_table[] = { | 239 | static u16 group_table[] = { |
240 | [Group1_80*8] = | ||
241 | ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, | ||
242 | ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, | ||
243 | ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, | ||
244 | ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, | ||
245 | [Group1_81*8] = | ||
246 | DstMem | SrcImm | ModRM, DstMem | SrcImm | ModRM, | ||
247 | DstMem | SrcImm | ModRM, DstMem | SrcImm | ModRM, | ||
248 | DstMem | SrcImm | ModRM, DstMem | SrcImm | ModRM, | ||
249 | DstMem | SrcImm | ModRM, DstMem | SrcImm | ModRM, | ||
250 | [Group1_82*8] = | ||
251 | ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, | ||
252 | ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, | ||
253 | ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, | ||
254 | ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, | ||
255 | [Group1_83*8] = | ||
256 | DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM, | ||
257 | DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM, | ||
258 | DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM, | ||
259 | DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM, | ||
239 | [Group1A*8] = | 260 | [Group1A*8] = |
240 | DstMem | SrcNone | ModRM | Mov | Stack, 0, 0, 0, 0, 0, 0, 0, | 261 | DstMem | SrcNone | ModRM | Mov | Stack, 0, 0, 0, 0, 0, 0, 0, |
241 | [Group3_Byte*8] = | 262 | [Group3_Byte*8] = |