aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2007-08-19 04:07:06 -0400
committerAvi Kivity <avi@qumranet.com>2007-10-13 04:18:24 -0400
commit7e778161fb4612d2ceac9604f10e1061f5f4cf48 (patch)
treef669f337eba6f18e4aded150caa7979ff9326659 /drivers/kvm
parentc53ce170a9e8531f293e402c7d8c65e38452a551 (diff)
KVM: x86 emulator: implement 'push reg' (opcodes 0x50-0x57)
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/x86_emulate.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 1036e0224aaa..cf895aab51d6 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -99,7 +99,8 @@ static u8 opcode_table[256] = {
99 /* 0x40 - 0x4F */ 99 /* 0x40 - 0x4F */
100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
101 /* 0x50 - 0x57 */ 101 /* 0x50 - 0x57 */
102 0, 0, 0, 0, 0, 0, 0, 0, 102 ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
103 ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
103 /* 0x58 - 0x5F */ 104 /* 0x58 - 0x5F */
104 ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, 105 ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
105 ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps, 106 ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
@@ -1151,6 +1152,19 @@ special_insn:
1151 if (twobyte) 1152 if (twobyte)
1152 goto twobyte_special_insn; 1153 goto twobyte_special_insn;
1153 switch(b) { 1154 switch(b) {
1155 case 0x50 ... 0x57: /* push reg */
1156 if (op_bytes == 2)
1157 src.val = (u16) _regs[b & 0x7];
1158 else
1159 src.val = (u32) _regs[b & 0x7];
1160 dst.type = OP_MEM;
1161 dst.bytes = op_bytes;
1162 dst.val = src.val;
1163 register_address_increment(_regs[VCPU_REGS_RSP], -op_bytes);
1164 dst.ptr = (void *) register_address(
1165 ctxt->ss_base, _regs[VCPU_REGS_RSP]);
1166 no_wb = 1; /* force writeback */
1167 break;
1154 case 0x6c: /* insb */ 1168 case 0x6c: /* insb */
1155 case 0x6d: /* insw/insd */ 1169 case 0x6d: /* insw/insd */
1156 if (kvm_emulate_pio_string(ctxt->vcpu, NULL, 1170 if (kvm_emulate_pio_string(ctxt->vcpu, NULL,