From: Mohammed Gamal Subject: [PATCH 2/2] x86 emulator: Fix emulate_grp3 return values Date: Sun, 8 Aug 2010 05:27:39 +0300 Message-ID: <1281234459-9248-2-git-send-email-m.gamal005@gmail.com> References: <1281234459-9248-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-ww0-f44.google.com ([74.125.82.44]:53723 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750699Ab0HHC2D (ORCPT ); Sat, 7 Aug 2010 22:28:03 -0400 Received: by wwj40 with SMTP id 40so10473630wwj.1 for ; Sat, 07 Aug 2010 19:28:01 -0700 (PDT) In-Reply-To: <1281234459-9248-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 6d1ec53..11489a4 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_src("idiv", c->src, *eax, *edx, 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