From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 7/7] Allow KVM from a normal QEMU binary Date: Sun, 05 Nov 2006 11:27:16 +0200 Message-ID: <454DAE74.4030306@qumranet.com> References: <454AE007.5070905@cs.utexas.edu> <454AE323.8090309@cs.utexas.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: To: Anthony Liguori In-Reply-To: <454AE323.8090309-NZpS4cJIG2HvQtjrzfazuQ@public.gmane.org> 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 Anthony Liguori wrote: > This patch depends on patch 6 and modifies the KVM changes to be an > "accelerator" for QEMU in much the same way kqemu is. > > The basic idea was to introduce a use_kvm flag in CPUState and, where > appropriate, check for use_kvm before doing KVM specific things. > There are a number of places where a valid CPUState is not available > or simply not created yet. In these cases, we use the global > kvm_allowed variable. Applied, with the following changes: - actually define kvm_allowed (gcc 3.4 insists) - a couple of places had kqemu_allowed instead of kvm_allowed - renamed the command line option to -no-kvm (similar to -no-kqemu) Most of the places where USE_KVM is used are now never called - they are relics from the days when we had mixed qemu/kvm execution. Now, the "big real" fiasco means that we need some sort of emulation, but I'm not sure the qemu cpu loop is the best choice. Qemu is very complex because it is geared to multi-host, multi-target, high-performance emulation. The cpu state is baroque, and SMP isn't going to be fun. I think we're better off with taking the x86 emulator from the kernel and extending it to support the non-memory instructions. It can run in the kernel or userspace since there's no performance requirement. > > This isn't a very pretty approach but it seems to work. Figuring out > how to make this all work with SMP is going to largely depend on how > SMP gets implemented in KVM. > If we proceed as outlined above all we need is to slap a lock on all accesses to the device model. Later we can fine-grain it so that each device has its own lock and accesses to multiple devices can occur in parallel. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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