From: Mohammed Gamal <[email protected]>

This patch lets emulate_grp3() return X86EMUL_* return codes instead
of hardcoded ones.

Signed-off-by: Mohammed Gamal <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index bcc5998..8430b61 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1424,9 +1424,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,
@@ -3173,7 +3173,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 */
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to