aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/x86_emulate.c
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2007-06-19 04:16:04 -0400
committerAvi Kivity <avi@qumranet.com>2007-07-16 05:05:47 -0400
commit7f0aaee07b6afcf5a4ee8a1132447621d768076b (patch)
tree3eb2b7e51898db9ee355b2b4e07294ebf5bc44c0 /drivers/kvm/x86_emulate.c
parent7700270ee3c1324c18f5b7c36ee5ba1a4165919a (diff)
KVM: Implement emulation of "pop reg" instruction (opcode 0x58-0x5f)
For use in real mode. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/x86_emulate.c')
-rw-r--r--drivers/kvm/x86_emulate.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index a4a84817b27..46c38063a10 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -98,8 +98,11 @@ static u8 opcode_table[256] = {
98 0, 0, 0, 0, 98 0, 0, 0, 0,
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 - 0x5F */ 101 /* 0x50 - 0x57 */
102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102 0, 0, 0, 0, 0, 0, 0, 0,
103 /* 0x58 - 0x5F */
104 ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
105 ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
103 /* 0x60 - 0x6F */ 106 /* 0x60 - 0x6F */
104 0, 0, 0, DstReg | SrcMem32 | ModRM | Mov /* movsxd (x86/64) */ , 107 0, 0, 0, DstReg | SrcMem32 | ModRM | Mov /* movsxd (x86/64) */ ,
105 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1153,6 +1156,16 @@ special_insn:
1153 case 0xf4: /* hlt */ 1156 case 0xf4: /* hlt */
1154 ctxt->vcpu->halt_request = 1; 1157 ctxt->vcpu->halt_request = 1;
1155 goto done; 1158 goto done;
1159 case 0x58 ... 0x5f: /* pop reg */
1160 dst.ptr = (unsigned long *)&_regs[b & 0x7];
1161
1162 if ((rc = ops->read_std(register_address(ctxt->ss_base,
1163 _regs[VCPU_REGS_RSP]), dst.ptr, op_bytes, ctxt)) != 0)
1164 goto done;
1165
1166 register_address_increment(_regs[VCPU_REGS_RSP], dst.bytes);
1167 dst.orig_val = dst.val; /* Disable writeback. */
1168 break;
1156 } 1169 }
1157 goto writeback; 1170 goto writeback;
1158 1171