From patchwork Wed Jan 22 03:21:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 11344935 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6AAC8139A for ; Wed, 22 Jan 2020 03:19:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 526D12465B for ; Wed, 22 Jan 2020 03:19:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729225AbgAVDTw (ORCPT ); Tue, 21 Jan 2020 22:19:52 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:55916 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728779AbgAVDTw (ORCPT ); Tue, 21 Jan 2020 22:19:52 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D98259FE338F0A416F4A; Wed, 22 Jan 2020 11:19:50 +0800 (CST) Received: from huawei.com (10.175.105.18) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Wed, 22 Jan 2020 11:19:40 +0800 From: linmiaohe To: , , , , , , , , , , CC: , , , Subject: [PATCH] KVM: X86: Add 'else' to unify fastop and execute call path Date: Wed, 22 Jan 2020 11:21:44 +0800 Message-ID: <1579663304-14524-1-git-send-email-linmiaohe@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.105.18] X-CFilter-Loop: Reflected Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Miaohe Lin It also helps eliminate some duplicated code. Signed-off-by: Miaohe Lin Reviewed-by: Sean Christopherson --- arch/x86/kvm/emulate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c7a0da45f60a..0accce94f660 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -5683,11 +5683,9 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt) if (ctxt->d & Fastop) { void (*fop)(struct fastop *) = (void *)ctxt->execute; rc = fastop(ctxt, fop); - if (rc != X86EMUL_CONTINUE) - goto done; - goto writeback; + } else { + rc = ctxt->execute(ctxt); } - rc = ctxt->execute(ctxt); if (rc != X86EMUL_CONTINUE) goto done; goto writeback;