aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/x86_emulate.c
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2007-10-16 21:23:27 -0400
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:52:53 -0500
commitb284be576471b1521dd04c0845beedb790cbb9d7 (patch)
tree12449fe425d72c15d2664956cd8a718e9429d44f /drivers/kvm/x86_emulate.c
parent42bf3f0a1f5a25be26e6bb53162cdee82410310d (diff)
KVM: x86 emulator: cmc, clc, cli, sti
Instruction: cmc, clc, cli, sti opcodes: 0xf5, 0xf8, 0xfa, 0xfb respectively. [avi: fix reference to EFLG_IF which is not defined anywhere] 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.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 988c6498640f..e962de331606 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -161,10 +161,10 @@ static u8 opcode_table[256] = {
161 ImplicitOps, SrcImm|ImplicitOps, 0, SrcImmByte|ImplicitOps, 0, 0, 0, 0, 161 ImplicitOps, SrcImm|ImplicitOps, 0, SrcImmByte|ImplicitOps, 0, 0, 0, 0,
162 /* 0xF0 - 0xF7 */ 162 /* 0xF0 - 0xF7 */
163 0, 0, 0, 0, 163 0, 0, 0, 0,
164 ImplicitOps, 0, 164 ImplicitOps, ImplicitOps,
165 ByteOp | DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM, 165 ByteOp | DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM,
166 /* 0xF8 - 0xFF */ 166 /* 0xF8 - 0xFF */
167 0, 0, 0, 0, 167 ImplicitOps, 0, ImplicitOps, ImplicitOps,
168 0, 0, ByteOp | DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM 168 0, 0, ByteOp | DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM
169}; 169};
170 170
@@ -1476,6 +1476,23 @@ special_insn:
1476 case 0xf4: /* hlt */ 1476 case 0xf4: /* hlt */
1477 ctxt->vcpu->halt_request = 1; 1477 ctxt->vcpu->halt_request = 1;
1478 goto done; 1478 goto done;
1479 case 0xf5: /* cmc */
1480 /* complement carry flag from eflags reg */
1481 ctxt->eflags ^= EFLG_CF;
1482 c->dst.type = OP_NONE; /* Disable writeback. */
1483 break;
1484 case 0xf8: /* clc */
1485 ctxt->eflags &= ~EFLG_CF;
1486 c->dst.type = OP_NONE; /* Disable writeback. */
1487 break;
1488 case 0xfa: /* cli */
1489 ctxt->eflags &= ~X86_EFLAGS_IF;
1490 c->dst.type = OP_NONE; /* Disable writeback. */
1491 break;
1492 case 0xfb: /* sti */
1493 ctxt->eflags |= X86_EFLAGS_IF;
1494 c->dst.type = OP_NONE; /* Disable writeback. */
1495 break;
1479 } 1496 }
1480 if (c->rep_prefix) { 1497 if (c->rep_prefix) {
1481 if (c->regs[VCPU_REGS_RCX] == 0) { 1498 if (c->regs[VCPU_REGS_RCX] == 0) {