From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mohammed Gamal Subject: [PATCH v2 2/2] x86 emulator: Fix emulate_grp3 return values Date: Sun, 8 Aug 2010 21:11:38 +0300 Message-ID: <1281291098-4658-2-git-send-email-m.gamal005@gmail.com> References: <1281291098-4658-1-git-send-email-m.gamal005@gmail.com> Cc: mtosatti@redhat.com, kvm@vger.kernel.org, Mohammed Gamal To: avi@redhat.com Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:65533 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753553Ab0HHSL4 (ORCPT ); Sun, 8 Aug 2010 14:11:56 -0400 Received: by wyb39 with SMTP id 39so9255684wyb.19 for ; Sun, 08 Aug 2010 11:11:54 -0700 (PDT) In-Reply-To: <1281291098-4658-1-git-send-email-m.gamal005@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: This patch let's emulate_grp3() return X86EMUL_* return codes instead of hardcoded ones Signed-off-by: Mohammed Gamal --- 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