public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 02/01] KVM: x86: Use a typedef for fastop functions
@ 2020-01-22  6:45 linmiaohe
  0 siblings, 0 replies; 3+ messages in thread
From: linmiaohe @ 2020-01-22  6:45 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini

Hi:
Sean Christopherson <sean.j.christopherson@intel.com> wrote:
> Add a typedef to for the fastop function prototype to make the code more readable.
>
> No functional change intended.
>
> Cc: Miaohe Lin <linmiaohe@huawei.com>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
>
> Applies on top of Miaohe's patch.  Feel free to squash this.
>
> arch/x86/kvm/emulate.c | 14 +++++++-------

Thanks for making the code more readable and clean.

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH] KVM: X86: Add 'else' to unify fastop and execute call path
@ 2020-01-22  3:21 linmiaohe
  2020-01-22  4:43 ` [PATCH 02/01] KVM: x86: Use a typedef for fastop functions Sean Christopherson
  0 siblings, 1 reply; 3+ messages in thread
From: linmiaohe @ 2020-01-22  3:21 UTC (permalink / raw)
  To: pbonzini, rkrcmar, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx, mingo, bp, hpa
  Cc: linmiaohe, kvm, linux-kernel, x86

From: Miaohe Lin <linmiaohe@huawei.com>

It also helps eliminate some duplicated code.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 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;
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-22 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-22  6:45 [PATCH 02/01] KVM: x86: Use a typedef for fastop functions linmiaohe
  -- strict thread matches above, loose matches on Subject: below --
2020-01-22  3:21 [PATCH] KVM: X86: Add 'else' to unify fastop and execute call path linmiaohe
2020-01-22  4:43 ` [PATCH 02/01] KVM: x86: Use a typedef for fastop functions Sean Christopherson
2020-01-22 14:25   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox