From: Mohammed Gamal Subject: Re: [PATCH][RESEND] x86_emulator: Emulate cld and std instruction Date: Thu, 31 Jul 2008 16:27:14 +0300 Message-ID: <20080731132714.GA8990@mohd-laptop> References: <20080730212727.GA7708@mohd-laptop> <48918C6C.1000408@qumranet.com> <52d4a3890807310325r208b7943h89df5490e2af0131@mail.gmail.com> <4891990C.7000202@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, riel@surriel.com To: Avi Kivity Return-path: Received: from fg-out-1718.google.com ([72.14.220.155]:18712 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbYGaN1W (ORCPT ); Thu, 31 Jul 2008 09:27:22 -0400 Received: by fg-out-1718.google.com with SMTP id 19so270726fgg.17 for ; Thu, 31 Jul 2008 06:27:19 -0700 (PDT) Content-Disposition: inline In-Reply-To: <4891990C.7000202@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: Here is an update patch. This adds 'cld' and 'std' instructions. The group table entries are added. Signed-off-by: Mohammed Gamal --- arch/x86/kvm/x86_emulate.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 07a277c..4c7ca7f 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c @@ -182,7 +182,7 @@ static u16 opcode_table[256] = { ImplicitOps, ImplicitOps, Group | Group3_Byte, Group | Group3, /* 0xF8 - 0xFF */ ImplicitOps, 0, ImplicitOps, ImplicitOps, - 0, 0, Group | Group4, Group | Group5, + ImplicitOps, ImplicitOps, Group | Group4, Group | Group5, }; static u16 twobyte_table[256] = { @@ -1757,6 +1757,14 @@ special_insn: ctxt->eflags |= X86_EFLAGS_IF; c->dst.type = OP_NONE; /* Disable writeback. */ break; + case 0xfc: /* cld */ + ctxt->eflags &= ~EFLG_DF; + c->dst.type = OP_NONE; /* Disable writeback. */ + break; + case 0xfd: /* std */ + ctxt->eflags |= EFLG_DF; + c->dst.type = OP_NONE; /* Disable writeback. */ + break; case 0xfe ... 0xff: /* Grp4/Grp5 */ rc = emulate_grp45(ctxt, ops); if (rc != 0) -- 1.5.4.3