Skip to content

Commit

Permalink
KVM: x86 emulator: convert a few freestanding emulations to fastop
Browse files Browse the repository at this point in the history
Reviewed-by: Gleb Natapov <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
avikivity authored and matosatti committed Jan 24, 2013
1 parent 34b7765 commit 158de57
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 @@ -2209,7 +2209,7 @@ static int em_cmpxchg(struct x86_emulate_ctxt *ctxt)
/* Save real source value, then compare EAX against destination. */
ctxt->src.orig_val = ctxt->src.val;
ctxt->src.val = reg_read(ctxt, VCPU_REGS_RAX);
emulate_2op_SrcV(ctxt, "cmp");
fastop(ctxt, em_cmp);

if (ctxt->eflags & EFLG_ZF) {
/* Success: write back to memory. */
Expand Down Expand Up @@ -2977,7 +2977,7 @@ static int em_das(struct x86_emulate_ctxt *ctxt)
ctxt->src.type = OP_IMM;
ctxt->src.val = 0;
ctxt->src.bytes = 1;
emulate_2op_SrcV(ctxt, "or");
fastop(ctxt, em_or);
ctxt->eflags &= ~(X86_EFLAGS_AF | X86_EFLAGS_CF);
if (cf)
ctxt->eflags |= X86_EFLAGS_CF;
Expand Down Expand Up @@ -4816,7 +4816,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
(s16) ctxt->src.val;
break;
case 0xc0 ... 0xc1: /* xadd */
emulate_2op_SrcV(ctxt, "add");
fastop(ctxt, em_add);
/* Write back the register source. */
ctxt->src.val = ctxt->dst.orig_val;
write_register_operand(&ctxt->src);
Expand Down

0 comments on commit 158de57

Please sign in to comment.