Skip to content

Commit

Permalink
KVM: x86 emulator: Fix emulate_grp3 return values
Browse files Browse the repository at this point in the history
This patch lets emulate_grp3() return X86EMUL_* return codes instead
of hardcoded ones.

Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Mohammed Gamal authored and Avi Kivity committed Oct 24, 2010
1 parent 3f9f53b commit 8c5eee3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -3172,7 +3172,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
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 */
Expand Down

0 comments on commit 8c5eee3

Please sign in to comment.