aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorMohammed Gamal <m.gamal005@gmail.com>2008-08-26 22:02:56 -0400
committerAvi Kivity <avi@qumranet.com>2008-10-15 04:15:23 -0400
commita5e2e82b8b62acd24a44b851e6bb4fd0793ead01 (patch)
tree252bcdcf7284ae23872d80aa174748c0b8b66c35 /arch/x86
parentd657c7335b97d746aa6123c56504b46c20e37df3 (diff)
KVM: x86 emulator: Add mov r, imm instructions (opcodes 0xb0-0xbf)
The emulator only supported one instance of mov r, imm instruction (opcode 0xb8), this adds the rest of these instructions. Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/x86_emulate.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index ae30435ad331..66e0bd6c628b 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -154,9 +154,16 @@ static u16 opcode_table[256] = {
154 0, 0, ByteOp | ImplicitOps | Mov | String, ImplicitOps | Mov | String, 154 0, 0, ByteOp | ImplicitOps | Mov | String, ImplicitOps | Mov | String,
155 ByteOp | ImplicitOps | Mov | String, ImplicitOps | Mov | String, 155 ByteOp | ImplicitOps | Mov | String, ImplicitOps | Mov | String,
156 ByteOp | ImplicitOps | String, ImplicitOps | String, 156 ByteOp | ImplicitOps | String, ImplicitOps | String,
157 /* 0xB0 - 0xBF */ 157 /* 0xB0 - 0xB7 */
158 0, 0, 0, 0, 0, 0, 0, 0, 158 ByteOp | DstReg | SrcImm | Mov, ByteOp | DstReg | SrcImm | Mov,
159 DstReg | SrcImm | Mov, 0, 0, 0, 0, 0, 0, 0, 159 ByteOp | DstReg | SrcImm | Mov, ByteOp | DstReg | SrcImm | Mov,
160 ByteOp | DstReg | SrcImm | Mov, ByteOp | DstReg | SrcImm | Mov,
161 ByteOp | DstReg | SrcImm | Mov, ByteOp | DstReg | SrcImm | Mov,
162 /* 0xB8 - 0xBF */
163 DstReg | SrcImm | Mov, DstReg | SrcImm | Mov,
164 DstReg | SrcImm | Mov, DstReg | SrcImm | Mov,
165 DstReg | SrcImm | Mov, DstReg | SrcImm | Mov,
166 DstReg | SrcImm | Mov, DstReg | SrcImm | Mov,
160 /* 0xC0 - 0xC7 */ 167 /* 0xC0 - 0xC7 */
161 ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImmByte | ModRM, 168 ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImmByte | ModRM,
162 0, ImplicitOps | Stack, 0, 0, 169 0, ImplicitOps | Stack, 0, 0,
@@ -1660,7 +1667,7 @@ special_insn:
1660 case 0xae ... 0xaf: /* scas */ 1667 case 0xae ... 0xaf: /* scas */
1661 DPRINTF("Urk! I don't handle SCAS.\n"); 1668 DPRINTF("Urk! I don't handle SCAS.\n");
1662 goto cannot_emulate; 1669 goto cannot_emulate;
1663 case 0xb8: /* mov r, imm */ 1670 case 0xb0 ... 0xbf: /* mov r, imm */
1664 goto mov; 1671 goto mov;
1665 case 0xc0 ... 0xc1: 1672 case 0xc0 ... 0xc1:
1666 emulate_grp2(ctxt); 1673 emulate_grp2(ctxt);