KVM: x86 emulator: Add stc instruction (opcode 0xf9)
authorMohammed Gamal <m.gamal005@gmail.com>
Thu, 5 Aug 2010 12:42:49 +0000 (15:42 +0300)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:51:01 +0000 (10:51 +0200)
Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/emulate.c

index d711d6aa8165acaefcccbf656c9d2ea24715a37f..175b41690d6fb5566eb64001d82335ef2619ed23 100644 (file)
@@ -2269,7 +2269,7 @@ static struct opcode opcode_table[256] = {
        N, N, N, N,
        D(ImplicitOps | Priv), D(ImplicitOps), G(ByteOp, group3), G(0, group3),
        /* 0xF8 - 0xFF */
-       D(ImplicitOps), N, D(ImplicitOps), D(ImplicitOps),
+       D(ImplicitOps), D(ImplicitOps), D(ImplicitOps), D(ImplicitOps),
        D(ImplicitOps), D(ImplicitOps), G(0, group4), G(0, group5),
 };
 
@@ -3124,6 +3124,9 @@ special_insn:
        case 0xf8: /* clc */
                ctxt->eflags &= ~EFLG_CF;
                break;
+       case 0xf9: /* stc */
+               ctxt->eflags |= EFLG_CF;
+               break;
        case 0xfa: /* cli */
                if (emulator_bad_iopl(ctxt, ops)) {
                        emulate_gp(ctxt, 0);