All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86 emulator: Emulate cld and std instructions
@ 2008-07-30 21:08 Mohammed Gamal
  2008-07-30 21:20 ` Mohammed Gamal
  0 siblings, 1 reply; 2+ messages in thread
From: Mohammed Gamal @ 2008-07-30 21:08 UTC (permalink / raw)
  To: kvm; +Cc: avi, riel

This patch adds instructions 'cld' and 'std' to the emulator.

Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
---
>From 23c0868c6a48a5e75693bd4552255a89cf26bdc8 Mon Sep 17 00:00:00 2001
From: Mohammed Gamal <mohd@mohd-laptop.(none)>
Date: Thu, 31 Jul 2008 00:04:34 +0300
Subject: [PATCH] Emulate cld and std instructions

---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86 emulator: Emulate cld and std instructions
  2008-07-30 21:08 [PATCH] x86 emulator: Emulate cld and std instructions Mohammed Gamal
@ 2008-07-30 21:20 ` Mohammed Gamal
  0 siblings, 0 replies; 2+ messages in thread
From: Mohammed Gamal @ 2008-07-30 21:20 UTC (permalink / raw)
  To: kvm

On Thu, Jul 31, 2008 at 12:08 AM, Mohammed Gamal <m.gamal005@gmail.com> wrote:
> This patch adds instructions 'cld' and 'std' to the emulator.
>
> Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
> ---
> From 23c0868c6a48a5e75693bd4552255a89cf26bdc8 Mon Sep 17 00:00:00 2001
> From: Mohammed Gamal <mohd@mohd-laptop.(none)>
> Date: Thu, 31 Jul 2008 00:04:34 +0300
> Subject: [PATCH] Emulate cld and std instructions
>
> ---
>  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
>

Please ignore this patch due to format errors. I will resend it.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-30 21:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-30 21:08 [PATCH] x86 emulator: Emulate cld and std instructions Mohammed Gamal
2008-07-30 21:20 ` Mohammed Gamal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.