kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Nelson Elhage <nelhage@ksplice.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM: emulator: Use linearize() when fetching instructions.
Date: Wed, 20 Apr 2011 16:04:44 +0300	[thread overview]
Message-ID: <4DAED9EC.5080604@redhat.com> (raw)
In-Reply-To: <1303142753-24562-1-git-send-email-nelhage@ksplice.com>

On 04/18/2011 07:05 PM, Nelson Elhage wrote:
> Since segments need to be handled slightly differently when fetching
> instructions, we add a __linearize helper that accepts a new 'fetch' boolean.

>   static int segmented_read_std(struct x86_emulate_ctxt *ctxt,
>   			      struct segmented_address addr,
>   			      void *data,
> @@ -637,11 +646,13 @@ static int do_fetch_insn_byte(struct x86_emulate_ctxt *ctxt,
>   	int size, cur_size;
>
>   	if (eip == fc->end) {
> -		unsigned long linear = eip + ctxt->cs_base;
> -		if (ctxt->mode != X86EMUL_MODE_PROT64)
> -			linear&= (u32)-1;
> +		unsigned long linear;
> +		struct segmented_address addr = {VCPU_SREG_CS, eip};
>   		cur_size = fc->end - fc->start;
>   		size = min(15UL - cur_size, PAGE_SIZE - offset_in_page(eip));

Breaks immediately - the segmented_address initializer is backwards.  
I've fixed this in my tree.

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

      parent reply	other threads:[~2011-04-20 13:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 16:05 [PATCH v2] KVM: emulator: Use linearize() when fetching instructions Nelson Elhage
2011-04-20  9:12 ` Avi Kivity
2011-04-20 13:04 ` Avi Kivity [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=4DAED9EC.5080604@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nelhage@ksplice.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).