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

Re: [Xen-devel] x86 instruction emulation in hvm


  • To: Emre Can Sezer <ecsezer@xxxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Date: Thu, 07 May 2009 21:50:27 +0100
  • Cc:
  • Delivery-date: Thu, 07 May 2009 13:51:00 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcnPS6bq65JhdIhNRROXR4btB6i7jwACcxfy
  • Thread-topic: [Xen-devel] x86 instruction emulation in hvm

On 07/05/2009 20:39, "Emre Can Sezer" <ecsezer@xxxxxxxx> wrote:

> I'm running an HVM guest using shadow page tables on a 64bit machine.
> I'm working on a project where I mark certain pages read-only and
> capture the writes into these pages.  I then try to emulate the write
> instructions using x86_emulate as is done in arch/x86/mm/shadow/multi.c.
> 
> The instruction I'm trying to emulate is:
> asm("mov %%gs,%0" : "=m" (p->thread.gsindex));
> 
> Since the source operand is a segment register, and the x86_emulate_ops
> structure that is being used does not have a ops->read_segment function
> defined, the emulation fails.
> 
> Is there an easy way to add or activate this functionality?  Perhaps a
> full emulator, since one would expect to see other cases of memory
> writes that are not handled as well.

Easily implemented -- you pass through to hvm_get_segment_register(). My
guess is you'll quickly fault on another instruction which is not so easily
fixed up, however.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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