public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RESEND] x86_emulator: Emulate cld and std instruction
@ 2008-07-30 21:27 Mohammed Gamal
  2008-07-31  9:57 ` Avi Kivity
  0 siblings, 1 reply; 6+ messages in thread
From: Mohammed Gamal @ 2008-07-30 21:27 UTC (permalink / raw)
  To: kvm; +Cc: avi, riel

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

Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>

---
 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] 6+ messages in thread

end of thread, other threads:[~2008-07-31 18:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-30 21:27 [PATCH][RESEND] x86_emulator: Emulate cld and std instruction Mohammed Gamal
2008-07-31  9:57 ` Avi Kivity
2008-07-31 10:25   ` Mohammed Gamal
2008-07-31 10:50     ` Avi Kivity
2008-07-31 13:27       ` Mohammed Gamal
2008-07-31 18:16     ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox