From: Pavel Machek Subject: Re: [PATCH 12/14] KVM: x86 emulator Date: Tue, 7 Nov 2006 13:49:12 +0100 Message-ID: <20061107124912.GA23118@elf.ucw.cz> References: <454E4941.7000108@qumranet.com> <20061105204035.DF0F62500A7@cleopatra.q> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, akpm-3NddpPZAyC0@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Return-path: To: Avi Kivity Content-Disposition: inline In-Reply-To: <20061105204035.DF0F62500A7@cleopatra.q> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org HI! > Add an x86 instruction emulator for kvm. > > We need an x86 emulator for the following reasons: > > - mmio instructions are intercepted as page faults, with no information about > the operation to be performed other than the virtual address > - real-mode is emulated using the old-fashined vm86 mode, with no special > intercepts for the privileged instructions, so we need to emulate mov cr, > lgdt, and lidt > - we plan to cache shadow page tables in the future, so that a guest context > switch will not throw away all the mappings we worked so hard to build. but > cachine page tables means write-protecting the guest page tables to keep > them in sync, so any writes to the guest page tables need to be emulated > > The emulator was lifted from the Xen hypervisor. > > Signed-off-by: Yaniv Kamay > Signed-off-by: Avi Kivity > > Index: linux-2.6/drivers/kvm/x86_emulate.c > =================================================================== > --- /dev/null > +++ linux-2.6/drivers/kvm/x86_emulate.c > @@ -0,0 +1,1370 @@ > +/****************************************************************************** > + * x86_emulate.c > + * > + * Generic x86 (32-bit and 64-bit) instruction decoder and emulator. > + * > + * Copyright (c) 2005 Keir Fraser > + * > + * Linux coding style, mod r/m decoder, segment base fixes, real-mode > + * privieged instructions: > + * > + * Copyright (C) 2006 Qumranet > + * > + * Avi Kivity > + * Yaniv Kamay > + * > + * From: xen-unstable 10676:af9809f51f81a3c43f276f00c81a52ef558afda4 > + */ This needs GPL, I'd say. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642