From: Mohammed Gamal Subject: [PATCH] x86 emulator: Add stc instruction (opcode 0xf9) Date: Thu, 5 Aug 2010 15:42:49 +0300 Message-ID: <1281012169-22001-1-git-send-email-m.gamal005@gmail.com> Cc: mtosatti@redhat.com, kvm@vger.kernel.org, Mohammed Gamal To: avi@redhat.com Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:48274 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755620Ab0HEMm4 (ORCPT ); Thu, 5 Aug 2010 08:42:56 -0400 Received: by wyb39 with SMTP id 39so6596434wyb.19 for ; Thu, 05 Aug 2010 05:42:55 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Mohammed Gamal --- arch/x86/kvm/emulate.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index f0f4a43..f345df0 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -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), }; @@ -3129,6 +3129,10 @@ special_insn: ctxt->eflags &= ~EFLG_CF; c->dst.type = OP_NONE; /* Disable writeback. */ break; + case 0xf9: /* stc */ + ctxt->eflags |= EFLG_CF; + c->dst.type = OP_NONE; /* Disable writeback */ + break; case 0xfa: /* cli */ if (emulator_bad_iopl(ctxt, ops)) { emulate_gp(ctxt, 0); -- 1.7.0.4