From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoEPn-0002sf-1i for qemu-devel@nongnu.org; Tue, 02 Aug 2011 08:49:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QoEPl-000454-Nx for qemu-devel@nongnu.org; Tue, 02 Aug 2011 08:49:43 -0400 Received: from david.siemens.de ([192.35.17.14]:33396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoEPl-00044N-D6 for qemu-devel@nongnu.org; Tue, 02 Aug 2011 08:49:41 -0400 Message-ID: <4E37F25D.8020009@siemens.com> Date: Tue, 02 Aug 2011 14:49:33 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1312226782-26882-1-git-send-email-anthony.perard@citrix.com> <4E37052E.70707@web.de> <4E37D621.3050302@siemens.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] xen: Avoid useless allocation in Xen case. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony PERARD Cc: Xen Devel , Alexander Graf , Stefano Stabellini , QEMU-devel On 2011-08-02 14:13, Anthony PERARD wrote: > On Tue, Aug 2, 2011 at 11:49, Jan Kiszka wrote: >>> The same applies to kvm, please generalize. >> >> Actually, qemu-kvm avoids this overhead today by making code_gen_alloc >> return immediately when kvm is on. Also not very beautiful. >> >> Can't we simply skip cpu_exec_init_all for any accel != TCG, e.g. by >> moving that call to tcg_init? > > In the function cpu_exec_init_all(), the call to cpu_gen_init() (and I > suppose to io_mem_init()) is still required. So we can not move the > whole function to tcg_init(). > > But I can maybe use "if (!tcg_enabled())" instead of a check to xen. > Until no tcg code is use when kvm/xen is enabled. I would prefer to take the chance and clean up. Anything TCG related belongs to tcg_init (or a function called from it). Shared services should be initialized as before. Will send a patch to make a start. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux