From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mohammed Gamal Subject: [PATCH][RESEND] x86_emulator: Emulate cld and std instruction Date: Thu, 31 Jul 2008 00:27:27 +0300 Message-ID: <20080730212727.GA7708@mohd-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@qumranet.com, riel@surriel.com To: kvm@vger.kernel.org Return-path: Received: from fg-out-1718.google.com ([72.14.220.159]:2386 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753578AbYG3V1g (ORCPT ); Wed, 30 Jul 2008 17:27:36 -0400 Received: by fg-out-1718.google.com with SMTP id 19so126703fgg.17 for ; Wed, 30 Jul 2008 14:27:35 -0700 (PDT) Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: This patch adds 'cld' and 'std' instructions to the emulator Signed-off-by: Mohammed Gamal --- arch/x86/kvm/x86_emulate.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index d5da7f1..9c72a77 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c @@ -1755,6 +1755,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