public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Dong, Eddie" <eddie.dong@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: Fix kernel pio emulation mistake
Date: Thu, 19 Mar 2009 11:35:45 +0200	[thread overview]
Message-ID: <49C211F1.50508@redhat.com> (raw)
In-Reply-To: <9832F13BD22FB94A829F798DA4A828050196AF5598@pdsmsx503.ccr.corp.intel.com>

Dong, Eddie wrote:
> Kernel pio emulation return value is mistakenly checked, fortuantely it is not hit yet for normal OS bootup :(
>
>
> diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
> index ca91749..0edd2e7 100644
> --- a/arch/x86/kvm/x86_emulate.c
> +++ b/arch/x86/kvm/x86_emulate.c
> @@ -1838,7 +1838,7 @@ special_insn:
>  		io_dir_in = 0;
>  	do_io:	if (kvm_emulate_pio(ctxt->vcpu, NULL, io_dir_in,
>  				   (c->d & ByteOp) ? 1 : c->op_bytes,
> -				   port) != 0) {
> +				   port) == 0) {
>  			c->eip = saved_eip;
>  			goto cannot_emulate;
>  		}

kvm_emulate_pio() returns 1 when emulation is complete, and 0 when 
emulation needs further processing in userspace.  So I think in both 
cases cannot_emulate is the wrong answer.  I think 'in' emulation gets 
it right.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-03-19  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19  7:06 Fix kernel pio emulation mistake Dong, Eddie
2009-03-19  9:35 ` Avi Kivity [this message]
2009-03-20  9:07   ` Dong, Eddie
2009-03-22  9:09     ` Avi Kivity

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=49C211F1.50508@redhat.com \
    --to=avi@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=kvm@vger.kernel.org \
    /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