All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
Cc: kvm <kvm@vger.kernel.org>, Mohammed Gamal <m.gamal005@gmail.com>
Subject: Re: [RFC] Getting correct eip in skip_emulated_instruction()
Date: Wed, 22 Oct 2008 12:09:48 +0200	[thread overview]
Message-ID: <48FEFBEC.1020101@redhat.com> (raw)
In-Reply-To: <20081021154327.11939162@frecb000711>

Guillaume Thouvenin wrote:
> Hello,
>
>  Presently when we want to skip an emulated instruction we update the
> eip by reading the instruction length from VMCS structure and we add
> this value to the current eip. It gives us the new eip. A problem occurs
> when the guest state doesn't allow us to use VT because in that case,
> the values in VMCS structure are not up to date. That means that if we
> call skip_emulated_instruction() while guest state is invalid, the
> computed eip will be false.
>
>  To fix the problem I introduced a new field in the structure kvm_io to
> store the eip value if guest state is invalid. If the stored value is
> equal to 0 we read the length of the current instruction in VMCS and if
> not, we use it as the new eip. It works but I'm not really happy with
> that hack and I don't see how to solve the problem nicely.
>   

If we call the emulator we shouldn't call skip_emulated_instruction() in 
the first place, since the emulator already computes the next rip for 
us. I suggest moving ->skip_emulated_instruction() out of 
kvm_emulate_pio() and into handle_io() (and the svm equivalent).

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


      reply	other threads:[~2008-10-22 10:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 13:43 [RFC] Getting correct eip in skip_emulated_instruction() Guillaume Thouvenin
2008-10-22 10:09 ` 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=48FEFBEC.1020101@redhat.com \
    --to=avi@redhat.com \
    --cc=guillaume.thouvenin@ext.bull.net \
    --cc=kvm@vger.kernel.org \
    --cc=m.gamal005@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.