From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0OVj-0002JR-J0 for qemu-devel@nongnu.org; Wed, 12 Nov 2008 17:48:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0OVi-0002JF-Vk for qemu-devel@nongnu.org; Wed, 12 Nov 2008 17:48:31 -0500 Received: from [199.232.76.173] (port=49792 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0OVi-0002J8-R3 for qemu-devel@nongnu.org; Wed, 12 Nov 2008 17:48:30 -0500 Received: from relay3-v.mail.gandi.net ([217.70.178.77]:40120) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0OVi-00084M-CE for qemu-devel@nongnu.org; Wed, 12 Nov 2008 17:48:30 -0500 Message-ID: <491B5D33.7060601@bellard.org> Date: Wed, 12 Nov 2008 23:48:19 +0100 From: Fabrice Bellard MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH][RFC] Split non-TCG bits out of exec.c References: <1226527840-14183-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1226527840-14183-1-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Carsten Otte , Anthony Liguori , Hollis Blanchard , kvm-devel , Paul Brook Anthony Liguori wrote: > Unlike kqemu, KVM does not use TCG at all when accelerating QEMU. Having TCG > present is not a problem when using KVM on x86. x86 already has TCG host and > target support and it's quite convenient to be able to disable/enable KVM and > compare it to TCG when debugging. > > KVM also supports architectures that do not have TCG host and target support > such as ia64, s390, and PPC[1]. For these architectures, TCG is an inhibitor > for upstream inclusion. > > TCG is pretty well isolated in QEMU so building these targets without TCG > should be easy enough. This breaks down in exec.c though. There is a lot of > TCG specific code in exec.c, but also a lot of code that KVM needs. > > This patch moves the non-TCG specific bits of exec.c into a separate file, > exec-all.c. This makes it relatively easy to build QEMU without TCG support. > More patches will come to complete this work but the exec.c bits are probably > 95% of what is needed. > > The remaining bits are some general cleanups where layering has been violated > and the introduction of a new -kvm subtarget, similar to -softmmu or > -linux-user. This target will not have TCG support and only support KVM. > However, before going down that path, I wanted to see if anyone objected to this > bit of the cleanup. > > Any objections? I suggest to go even further: there should be a way in QEMU to define CPUs which do not rely on the dynamic translator and this choice should be doable at runtime (i.e. not with a bunch of #ifdefs as you may do it). This way you could not only plug KVM CPUs without having the equivalent TCG one, but also CPUs from other sources (i.e. the x86 interpreter of malc, or the cycle accurate PTLsim x86 emulator). Fabrice.