KVM: X86: Add 'else' to unify fastop and execute call path

It also helps eliminate some duplicated code.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Miaohe Lin 2020-01-22 11:21:44 +08:00 committed by Paolo Bonzini
parent 91b0d268a5
commit 52db369823

View file

@ -5683,11 +5683,9 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
if (ctxt->d & Fastop) { if (ctxt->d & Fastop) {
void (*fop)(struct fastop *) = (void *)ctxt->execute; void (*fop)(struct fastop *) = (void *)ctxt->execute;
rc = fastop(ctxt, fop); rc = fastop(ctxt, fop);
if (rc != X86EMUL_CONTINUE) } else {
goto done; rc = ctxt->execute(ctxt);
goto writeback;
} }
rc = ctxt->execute(ctxt);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
goto done; goto done;
goto writeback; goto writeback;