From: Keir Fraser <keir.xen@gmail.com>
To: Razvan Cojocaru <rzvncj@gmail.com>, xen-devel@lists.xen.org
Subject: Re: What's a good way of skipping an instruction for a HVM guest?
Date: Thu, 16 May 2013 16:49:38 +0100 [thread overview]
Message-ID: <CDBABEA2.25218%keir.xen@gmail.com> (raw)
In-Reply-To: <CAM-wkEvc31mR-uGoSRErFg3CEwMNQ5sZp-6OAkV3nYvtYR1dYA@mail.gmail.com>
On 16/05/2013 16:04, "Razvan Cojocaru" <rzvncj@gmail.com> wrote:
> Hello,
>
> how do I skip the current instruction from the HV? That is, how do I
> know what instruction length to add to guest_cpu_user_regs()->eip to
> achieve this?
>
> Could this be done by hvm_emulate_one() with a copy of
> guest_cpu_user_regs() and then setting guest_cpu_user_regs()->eip to
> the eip in the hvmemul_ctxt? Would this have side-effects?
You would also need to provide a set of x86_emulate_ops that are side-effect
free (e.g., to avoid modifying CRn, DRn, memory, MSRs, ...).
There is no other fully generic way to do it though. VMX provides the
trapping instruction length on vmexit, but not in all cases. Our SVM code
also has a limited instruction-length helper function, but only for a few
instructions for which it is required.
-- Keir
>
> Thanks,
> Razvan Cojocaru
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
prev parent reply other threads:[~2013-05-16 15:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-16 15:04 What's a good way of skipping an instruction for a HVM guest? Razvan Cojocaru
2013-05-16 15:49 ` Keir Fraser [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=CDBABEA2.25218%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=rzvncj@gmail.com \
--cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).