public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Li, Xin" <xin.li@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: wrong placement of RIP-relative address computing
Date: Sun, 19 Jun 2011 14:38:38 +0300	[thread overview]
Message-ID: <4DFDDFBE.8000202@redhat.com> (raw)
In-Reply-To: <FC2FB65B4D919844ADE4BE3C2BB739AD5ADEE75B@shsmsx501.ccr.corp.intel.com>

On 06/16/2011 02:00 PM, Li, Xin wrote:
> >  diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> >  index 6df88c7..e269d20 100644
> >  --- a/arch/x86/kvm/emulate.c
> >  +++ b/arch/x86/kvm/emulate.c
> >  @@ -3547,9 +3547,6 @@ done_prefixes:
> >          if (memop.type == OP_MEM&&  c->ad_bytes != 8)
> >                  memop.addr.mem.ea = (u32)memop.addr.mem.ea;
> >
> >  -       if (memop.type == OP_MEM&&  c->rip_relative)
> >  -               memop.addr.mem.ea += c->eip;
> >  -
> >          /*
> >           * Decode and fetch the source operand: register, memory
> >           * or immediate.
> >  @@ -3704,6 +3701,9 @@ done_prefixes:
> >          }
> >
> >   done:
>
> It's not correct to move here, I saw some other problem.
>
> >  +       if (memop.type == OP_MEM&&  c->rip_relative)
> >  +               memop.addr.mem.ea += c->eip;
> >  +
> >          return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED :
> >  EMULATION_OK;
>

There's the "return 0" in the previous switch, but otherwise I think 
it's correct.  We didn't take into account the complete instruction length.

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


      reply	other threads:[~2011-06-19 11:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16  8:33 wrong placement of RIP-relative address computing Li, Xin
2011-06-16 11:00 ` Li, Xin
2011-06-19 11:38   ` 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=4DFDDFBE.8000202@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=xin.li@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