[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] What's a good way of skipping an instruction for a HVM guest?


  • To: Razvan Cojocaru <rzvncj@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Thu, 16 May 2013 16:49:38 +0100
  • Delivery-date: Thu, 16 May 2013 15:50:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac5STPh5CqZpIIdOwUmvDHCjsN1TfQ==
  • Thread-topic: [Xen-devel] What's a good way of skipping an instruction for a HVM guest?

On 16/05/2013 16:04, "Razvan Cojocaru" <rzvncj@xxxxxxxxx> 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@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.