From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emre Can Sezer Subject: x86 instruction emulation in hvm Date: Thu, 07 May 2009 15:39:42 -0400 Message-ID: <4A0338FE.8010400@ncsu.edu> References: <49E50B49.7000706@ncsu.edu> <20090415083431.GA10010@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090415083431.GA10010@york.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Devel List-Id: xen-devel@lists.xenproject.org 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. Thanks, John