public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mohammed Gamal <m.gamal005@gmail.com>
To: avi@redhat.com
Cc: mtosatti@redhat.com, kvm@vger.kernel.org,
	Mohammed Gamal <m.gamal005@gmail.com>
Subject: [PATCH v2 2/2] x86 emulator: Fix emulate_grp3 return values
Date: Sun,  8 Aug 2010 21:11:38 +0300	[thread overview]
Message-ID: <1281291098-4658-2-git-send-email-m.gamal005@gmail.com> (raw)
In-Reply-To: <1281291098-4658-1-git-send-email-m.gamal005@gmail.com>

This patch let's emulate_grp3() return X86EMUL_* return codes instead of hardcoded ones

Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
---
 arch/x86/kvm/emulate.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 790f700..32498e3 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1405,9 +1405,9 @@ static inline int emulate_grp3(struct x86_emulate_ctxt *ctxt,
 		emulate_1op_rax_rdx("idiv", c->src, *rax, *rdx, ctxt->eflags);
 		break;
 	default:
-		return 0;
+		return X86EMUL_UNHANDLEABLE;
 	}
-	return 1;
+	return X86EMUL_CONTINUE;
 }
 
 static inline int emulate_grp45(struct x86_emulate_ctxt *ctxt,
@@ -3158,7 +3158,7 @@ special_insn:
 		ctxt->eflags ^= EFLG_CF;
 		break;
 	case 0xf6 ... 0xf7:	/* Grp3 */
-		if (!emulate_grp3(ctxt, ops))
+		if (emulate_grp3(ctxt, ops) != X86EMUL_CONTINUE)
 			goto cannot_emulate;
 		break;
 	case 0xf8: /* clc */
-- 
1.7.0.4


  reply	other threads:[~2010-08-08 18:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-08 18:11 [PATCH v2 1/2] x86 emulator: Add unary mul, imul, div, and idiv instructions Mohammed Gamal
2010-08-08 18:11 ` Mohammed Gamal [this message]
2010-08-10  2:52 ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281291098-4658-2-git-send-email-m.gamal005@gmail.com \
    --to=m.gamal005@gmail.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox