From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NxFYH-0002ma-Le for qemu-devel@nongnu.org; Thu, 01 Apr 2010 04:14:57 -0400 Received: from [140.186.70.92] (port=42314 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NxFYE-0002fJ-VS for qemu-devel@nongnu.org; Thu, 01 Apr 2010 04:14:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NxFYD-0006ID-3n for qemu-devel@nongnu.org; Thu, 01 Apr 2010 04:14:54 -0400 Received: from mail-ew0-f227.google.com ([209.85.219.227]:48566) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NxFYC-0006I9-U9 for qemu-devel@nongnu.org; Thu, 01 Apr 2010 04:14:53 -0400 Received: by ewy27 with SMTP id 27so267245ewy.10 for ; Thu, 01 Apr 2010 01:14:52 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4BB455F6.7070402@redhat.com> Date: Thu, 01 Apr 2010 10:14:46 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4BB397A1.2000508@codemonkey.ws> <4BB3A230.4080606@codemonkey.ws> In-Reply-To: <4BB3A230.4080606@codemonkey.ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 7/7] Refactor target specific handling, compile vl.c only once List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Blue Swirl , qemu-devel On 03/31/2010 09:27 PM, Anthony Liguori wrote: > On 03/31/2010 02:19 PM, Blue Swirl wrote: >> On 3/31/10, Anthony Liguori wrote: >>> On 03/27/2010 05:11 PM, Blue Swirl wrote: >>> >>>> Move target specific functions and RAM handling to arch_init.c. >>>> >>>> Add a flag to QEMUOptions structure to indicate for which >>>> architectures the option is allowed, check the flag >>>> in run time and remove conditional code in option handling. >>>> >>>> Now that no target dependencies remain, compile vl.c only once >>>> for all targets. >>>> >>>> Signed-off-by: Blue Swirl >>>> >>>> >>> This causes -enable-kvm to seg fault. >> Variable kvm_state is used but it has not been initialized. This is >> because kvm_init is not called. And this happens because CONFIG_KVM is >> not set by config.h when included from vl.c. > > I spoke too soon before. A lot of code depends on if (kvm_enabled()) > going to 0 so it's a bigger refactoring to fix this once you start > compiling targets that !defined(CONFIG_KVM) Code that is not compiled per-target would need to switch to kvm_available(). Also, a dummy version of the functions declared in kvm.h needs to be written so that it can be linked against targets that do not support KVM (possibly with a link_warning). Paolo