kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Sean Christopherson" <sean.j.christopherson@intel.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: Fix x86_decode_insn() return when fetching insn bytes fails
Date: Mon, 19 Aug 2019 17:18:33 +0200	[thread overview]
Message-ID: <9bf79098-703c-e82b-7e7d-1c0a6a1023c2@redhat.com> (raw)
In-Reply-To: <20190815162032.6679-1-sean.j.christopherson@intel.com>

On 15/08/19 18:20, Sean Christopherson wrote:
> Jump to the common error handling in x86_decode_insn() if
> __do_insn_fetch_bytes() fails so that its error code is converted to the
> appropriate return type.  Although the various helpers used by
> x86_decode_insn() return X86EMUL_* values, x86_decode_insn() itself
> returns EMULATION_FAILED or EMULATION_OK.
> 
> This doesn't cause a functional issue as the sole caller,
> x86_emulate_instruction(), currently only cares about success vs.
> failure, and success is indicated by '0' for both types
> (X86EMUL_CONTINUE and EMULATION_OK).
> 
> Fixes: 285ca9e948fa ("KVM: emulate: speed up do_insn_fetch")
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
>  arch/x86/kvm/emulate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 8e409ad448f9..6d2273e71020 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -5126,7 +5126,7 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len)
>  	else {
>  		rc = __do_insn_fetch_bytes(ctxt, 1);
>  		if (rc != X86EMUL_CONTINUE)
> -			return rc;
> +			goto done;
>  	}
>  
>  	switch (mode) {
> 

Queued, thanks.

Paolo

      parent reply	other threads:[~2019-08-19 15:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15 16:20 [PATCH] KVM: x86: Fix x86_decode_insn() return when fetching insn bytes fails Sean Christopherson
2019-08-16 21:16 ` Jim Mattson
2019-08-19 15:18 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9bf79098-703c-e82b-7e7d-1c0a6a1023c2@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).